程序如何获得鼠标在IE里选中的数据? 我想实现的功能就是鼠标在IE里选择了一个string,然后把这个string用鼠标拖到自己的程序上面.程序上的textbox就能显示这个string.请问这能实现吗? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 // // textBox1 // this.textBox1.AllowDrop = true; this.textBox1.Location = new System.Drawing.Point(12, 12); this.textBox1.Multiline = true; this.textBox1.Name = "textBox1"; this.textBox1.Size = new System.Drawing.Size(268, 231); this.textBox1.TabIndex = 0; this.textBox1.DragEnter += new System.Windows.Forms.DragEventHandler(textBox1_DragEnter); this.textBox1.DragDrop += new System.Windows.Forms.DragEventHandler(this.textBox1_DragDrop); //========================================= void textBox1_DragEnter(object sender, System.Windows.Forms.DragEventArgs e) { e.Effect = System.Windows.Forms.DragDropEffects.Copy; } void textBox1_DragDrop(object sender, System.Windows.Forms.DragEventArgs e) { if (e.Data.GetDataPresent(typeof(string))) { textBox1.Text = (string)(e.Data.GetData(typeof(string))); } } 解析word文件 socket监听 到 soap 包? byte[]问题 参数委托的顺序问题 急求,c#调远端DCOM组件的程序 50分 菜鸟问题: 2005中 web移动from 如何让textbox保持焦点? C#如何实现C++那样的接口的定义和实现分离的编程方式 连接建立SQL连接的问题 如何查找XML文件中重复的节点并删除之? 有没有类似VC里CString类里的Format的函数? 如果获取设置文件属性中摘要里面的关键字 C#数字取尾数 在线等
// textBox1
//
this.textBox1.AllowDrop = true;
this.textBox1.Location = new System.Drawing.Point(12, 12);
this.textBox1.Multiline = true;
this.textBox1.Name = "textBox1";
this.textBox1.Size = new System.Drawing.Size(268, 231);
this.textBox1.TabIndex = 0;
this.textBox1.DragEnter += new System.Windows.Forms.DragEventHandler(textBox1_DragEnter);
this.textBox1.DragDrop += new System.Windows.Forms.DragEventHandler(this.textBox1_DragDrop);
//=========================================
void textBox1_DragEnter(object sender, System.Windows.Forms.DragEventArgs e)
{
e.Effect = System.Windows.Forms.DragDropEffects.Copy;
} void textBox1_DragDrop(object sender, System.Windows.Forms.DragEventArgs e)
{
if (e.Data.GetDataPresent(typeof(string)))
{
textBox1.Text = (string)(e.Data.GetData(typeof(string)));
}
}