PDA

Click to See Complete Forum and Search --> : [2003] textbox click


grahamxyz
Oct 25th, 2006, 07:41 AM
I am trying to get the text from a multiline textbox at the point where it is clicked using Me.TextBox1.SelectionStart().

the click event of the textbox doesn't fire, should it?

I tried a panel underneath the textbox but click only fires if you click outside the textbox area.

I have considered using a listbox and SelectedIndexChanged but it doesn't scroll.

any ideas how I can get the desired effect with either a textbox or listbox?


Thanks in advance.

Strider
Oct 26th, 2006, 03:42 AM
i think you would have to use the mouse down event or else maybe the gotfocus event.

are you trying to get the text from the start of the textbox to the point thats selected

Shaggy Hiker
Oct 28th, 2006, 10:07 PM
I agree with Strider in general, though I just posted a long rambling answer that might be of interest here (though JM posted a simpler solution to that question, some of the ideas I discussed might get around the panel behind the textbox issue):

http://www.vbforums.com/showthread.php?t=435203

However, to generalize what Strider stated: Find an event that fires when the mouse is clicked, and gives you the click location. If the click event doesn't work (it shouldn't, it's a mouse event you need), then try MouseDown, MouseEtc.