如何确定闪烁光标位置VB.net

时间:2013-03-09 23:17:55

标签: vb.net cursor

如何确定窗体上闪烁的光标位置x,y?

1 个答案:

答案 0 :(得分:1)

为此,我使用了yourTextBox.GetPositionFromCharIndex(CharacterIndexAsIntegerTypeHere)

我使用TextBox字符在X轴上移动了ListBox:

Dim Lstb as new ListBox
Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged  
  With Lstb
    .size = new size(50,50)
    .BackColor = Color.aqua
    .location = New Point(TextBox1.Location.X + TextBox1.GetPositionFromCharIndex(TextBox1.Text.Length - 1).X,  TextBox1.Location.Y + 50)
  End with    
  Controls.Add(Lstb)
End Sub