遍历整个winform的textbox,使得所有textbox共享同一个事件方法。 比如让Textbox2,Textbox3也使用Textbox1的MouseMove事件: this.textBox2.MouseMove += new System.Windows.Forms.MouseEventHandler(this.textBox1_MouseMove); this.textBox3.MouseMove += new System.Windows.Forms.MouseEventHandler(this.textBox1_MouseMove);如上代码没有遍历,表达清楚就行了,呵呵
比如让Textbox2,Textbox3也使用Textbox1的MouseMove事件:
this.textBox2.MouseMove += new System.Windows.Forms.MouseEventHandler(this.textBox1_MouseMove);
this.textBox3.MouseMove += new System.Windows.Forms.MouseEventHandler(this.textBox1_MouseMove);如上代码没有遍历,表达清楚就行了,呵呵