Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Conditional selecting in the TextBox
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Conditional selecting in the TextBox
Miscellaneous
Thread ID:
00785262
Message ID:
00785262
Views:
57
Hallo,

I'd like to implement the following behaviour in the textbox:

if thr textbox is entered with TAB or ENTER - then it must be selected. If it is entered with the mouse - then it must be only selected if the mouseclick succeeded in the filled part of the textbox or left to it (in the white space if the allignment is R).

With other words, I'd like to have a combination of what is described by Marcia Atkins for GotFocus

TextBox::GotFocus()
This.Selstart = 0
This.SelLength=LEN(this.Text)
NODEFAULT

and a "normal" behaviour with SelectOnEntry set to .t.

My problem is to find out the position of the mouse cursor relative to the text in the textbox as it clicks on the control. I've tried to retrieve the SelStart in GotFocus, but it seems to be always 0

Does anyone have some idea?

Thanks
Alexander Lerner
a_lerner@heinrich-schmid.de

The life is somewhat easier than it seems to be.
Next
Reply
Map
View

Click here to load this message in the networking platform