I have a form and on that form is a number of TextBox controls. I have set the property "SelText" to TRUE. When I run the form the contents of the TextBox control will be "selected" if I TAB to the control but if I use my mouse and click on the control the contents are not "selected".
Is this how "SelText" is supposed to work? How can I get the contents of the TextBox control to be "selected" when I click into the control?
You could try setting the selection during the WM_LBUTTONUP message handler:
'--------------------------------------------------------------------------------
Function FORM1_TEXT1_WM_LBUTTONUP ( _
ControlIndex As Long, _ ' index in Control Array
hWndForm As Dword, _ ' handle of Form
hWndControl As Dword, _ ' handle of Control
MouseFlags As Long, _ ' virtual keys that are pressed
xPos As Long, _ ' x-coordinate of cursor
yPos As Long _ ' y-coordinate of cursor
) As Long
FF_TextBox_SetSel hWndControl, 0, -1
End Function
Paul,
Thanks for the suggestion. I will give it a try.
Out of curiousity, Is this the normal behavior for when a textbox control property is set to SelText to True. I use several other windows programs where mouse clicking into a TextBox will select the text contained therein. If it is possible I would like to see that be the behavior when a FF TextBox SelText property is set to True. Is that possible?
That is the normal behaviour. The textbox will select the text when it gets the focus, so that its contents are overwritten when you start typing. A mouseclick will deselect the text. The idea is that you can can use the mouse to select the point in the text to make changes, or select part of the text.
If you want to have all text selected when you click the textbox you would have to program that manually.
You could doubleclick on the Textbox to select, perhaps you forgot.