Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to stop controls losing focus
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00431350
Message ID:
00431353
Views:
11
>What's the best way to prevent particular controls losing focus? In FoxPro 2.6, I'd use the VALID snippet & return false if a condition wasn't met, or set the _CUROBJ back to the current objects number.
>
>Is there a different method for the different object types, ie text boxes, combo boxes, etc?
>
>Thanks,
>
> Andy Crawshaw


Do you mean in VFP?

There you can Return .F. in the valid too.
You can also issue NoDefault in the LostFocus Event.
It is the same for all objects.
But look out for the Grid.
There the object in the grid loses the focus after in the grid valid event fires.
So you can have that in the control in your grid you don't allow the user to move out the grid, and in the grid you have already allowed it.
You can workaround this by calling the control's valid event in the grid's valid event.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform