Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Format K & SetFocus()
Message
From
05/04/2000 12:37:27
 
 
To
05/04/2000 10:41:52
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00355430
Message ID:
00355755
Views:
27
>>>The SelectOnEntry should work if you have 5.0 or higher....but there must be something else wrong because the Format K should work also, even if SelectOnEntry is .F. the Format K should highlight the information in field. What type of control is this? Are you loading anything into the keyboard buffer before or after the SetFocus? Does the information get highlighed if you tab into the field instead of doing SetFocus?
>>>
>>
>>TextBox behavior when you Tab into the box differs from the behavior if you mouse-click into the box - I find I need to add code to the GotFocus event to adjust the SelStart and SelLength properties and prevent the native VFP action with a NODEFAULT to make them work identically. The subclass of a typical numeric textbox that I want to give this behavior to looks like:
>>
>>
PROCEDURE GotFocus()
>>   LOCAL uDoDefaultResult
>>   uDoDefaultResult = DODEFAULT()
>>   WITH this
>>      .SelStart = 0
>>      .SelLength = 1000
>>   ENDWITH
>>   NODEFAULT
>>   RETURN uDoDefaultResult
>>ENDPROC
>
>This is true Ed. The way I understood John's question though is that he is explicitly calling the .SetFocus() method to obtain focus into the control.
>The expected result should be the information in the control being highlighted, which doesn't seem to be happening for him. So I was trying to gather more information to help determine what the problem might be. Maybe I have totally misunderstood his question.

The same code fires if you call SetFocus(), since the control's GotFocus() event fires. If this is the behavior he desires, he should incorporate this into his textbox class hierarchy somewhere; once in the inheritance chain, it calls any superclass behavior, does the selection, and passes up any parent class return results. I'd try to add this as a base behavior to a class so that its instances and any of its subclasses get the benefit of this without resorting to instance behavior modification.

Similar behavior can be added to other control classes where you want everything selected on entry such as some editboxes.
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Previous
Reply
Map
View

Click here to load this message in the networking platform