tags:

views:

42

answers:

1

How do you parse the caret position in a text box, then use that for setting the index in a listbox, all in VB.NET

A: 

I'm not sure about a richtextbox, but in a normal textbox you look at the SelectionStart property.

Update a quick check in Visual Studio confirms the property at least exists for RichTextBox. You should really start there.

Joel Coehoorn
It does but how would you parse that data?
muckdog12
There's nothing to parse - it's just an integer property that tells you where the caret is. Read the docs http://msdn.microsoft.com/en-us/library/system.windows.forms.richtextbox.aspx http://msdn.microsoft.com/en-us/library/system.windows.forms.textboxbase.selectionstart.aspx - that's always a good idea:
Joel Coehoorn