2

How to determine blinking cursor position x,y on the form?

EDIT:

Okay, after many years I decided to take a look at my question. The description is very short and doesn't tell anything. I remember, was doing a desktop application for a medical device with automatic suggestions of names, while the beginning of a patient name is typed. I needed a list-control to have VS like suggestions just after the caret.

4

1 回答 1

1

For this I used yourTextBox.GetPositionFromCharIndex(CharacterIndexAsIntegerTypeHere)

ListBox is moving on X axis with TextBox characters:

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
于 2013-03-09T23:17:55.080 回答