Kent Belan wrote on 2012-07-13:
> Happy Friday,
>
> I have a request from a user to make all numeric text boxes turn blue
when
> the user clicks in the text box.
>
> The SelectOnEntry property is set to True and everything works fine if
the
> user tabs into the numeric text box, but they sometimes use the mouse and
> click into the field, but the cursor stays where ever the user clicks.
>
> So if they click to the right of the decimal and start typing the amount,
> they only get decimals.
>
> Any way to make the text box simulate SelectOnEntry if the user clicks
into
> the field with the mouse ?
>
> Thanks,
> Kent
>
Kent,
Consider when the user wants to highlight part of the text. You'll need to
work around that. This is how I handle putting the cursor at the beginning
of the field. You will probably just add a line like THIS.SelLength =
LEN(THIS.Value) in the MouseUp event.
Add a new property on the textbox. I used LISACTIVE.
GotFocus event:
IF NOT MDOWN()
THIS.lIsActive = .T.
ENDIF
LostFocus event:
THIS.lIsActive = .F.
MouseUp event:
IF NOT THIS.lIsActive and THIS.SelLength = 0
THIS.SelStart = 0
ENDIF
THIS.lIsActive = .T.
Tracy Pearson
PowerChurch Software
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message:
http://leafe.com/archives/byMID/profox/[email protected]
** All postings, unless explicitly stated otherwise, are the opinions of the
author, and do not constitute legal or medical advice. This statement is added
to the messages for those lawyers who are too stupid to see the obvious.