Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VCR Controls
Message
 
To
09/03/1999 11:00:07
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Miscellaneous
Thread ID:
00195477
Message ID:
00195589
Views:
20
>> As to the placement of a cursor, you can always do a
>> THISFORM.Control.SetFocus() in the Init of the form to put the cursor > somewhere in particular.
>
>John - just a FYI - I ran into a problem when I inadvertently moved a .setfocus() into a form Init. It changed the behavior of my textboxes, I wanted a press of the Enter-key to cause focus to move to the next textbox (data, enter, data, enter, etc.). With the nontextbox.setfocus() in the Init the Enter-key would no longer cause the cursor to leave the current box. The notextbox.setfocus() in the Init seemed to have effects beyond what I would have expected.

You should avoid the placing .setfocus() in the Form.Init(), because it breaks normal event sequence when the form loads. Setting focus from Form.Init() causes preliminary Form.Activate(), so if you turn Event tracking on you will see that the Form.Init() fires twice (executing the code before and after .Setfocus()) It causes different kinds of odd controls behaviour. I did some consulting in December and debugged the app where the reason of odd behaviour was just that - .Setfocus() in Form.Init. You can also read Drew Speedie article about such problems in March 1999 issue of FPA.

Nick
Nick Neklioudov
Universal Thread Consultant
3 times Microsoft MVP - Visual FoxPro

"I have not failed. I've just found 10,000 ways that don't work." - Thomas Edison
Previous
Reply
Map
View

Click here to load this message in the networking platform