Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SelectOnEntry & Textbox control
Message
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00799247
Message ID:
00799280
Views:
22
Hello Sander.

How can I create a textbox that selects the value when I execute a mouseclick on it.

You need code like this in the GotFocus() of the textbox:
WITH This
  IF .SelectOnEntry
    TextBox::GotFocus()
    .SelStart = 0
    .SelLength = LEN( .Text )
    NODEFAULT
  ENDIF
ENDWITH
You need to execute the VFP base class behavior (Textbox::GotFocus()) before you set the SelStart and SelLength and supress it afterward (NODEFAULT) because the default behavior of the native GotFocus() behavior is to reset SelStart and SelLength.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform