哥哥姐姐们,现在有一个问题需要请教!
现在有两个TextBox, TextBox1和TextBox2。
问题如下:
当我把鼠标放到TextBox1里面时, TextBox2的内容马上显示“成功了”!
如何实现着急啊!~

解决方案 »

  1.   

    WinForm:
    this.textBox1.Enter += new EventHandler(textBox1_Enter);

    private void textBox1_Enter(object sender, EventArgs e)
    {
        this.textBox2.Text = "successfully";
    }
      

  2.   

    private void textBox1_MouseMove(object sender, System.Windows.Forms.MouseEventArgs e)
    {
     textBox2.Text="成功";
    }
      

  3.   

    刚才忘记说明了,我是在webform窗体中!
      

  4.   

    fangxinggood(JustACoder)  大哥说的是winform中!
      

  5.   

    <asp:TextBox id="TextBox1" runat=server onfocus="doit()"/>
    <script language=javascript>
    function doit()
    {
      document.Form1.TextBox1.value = "成功了";
    }
    </script>
      

  6.   

    或者在cs文件中
    this.textbox1.Attributes.Add("onfocus","document.Form1.textBox2.value='选中拉'");
      

  7.   

    定义个委托,把TextBox1的事件委托定义给TextBox2.
      

  8.   

    Page_Load 中: 
    this.Textbox1.Attributes.Add("onfocus","document.Form1.TextBox2.value='选中拉'");