VB.NET TextBox跟随鼠标光标

时间:2011-12-19 13:54:30

标签: vb.net textbox cursor mouse

有人知道如何在一个简单的表格上按下鼠标光标制作文本框吗?

2 个答案:

答案 0 :(得分:0)

在表单的MouseMove事件处理程序中

textBox.Location = new Point(e.X, e.Y); Invalidate();

eMouseEventArgs

答案 1 :(得分:0)

我已经为你完成了这段代码,请查看以下答案:

   Private Sub Form1_MouseMove(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles MyBase.MouseMove
        Label1.Text = e.X.ToString
        Label2.Text = e.Y.ToString
        Me.TextBox1.Location = New System.Drawing.Point(e.X  + 10, e.Y + 10)

    End Sub