General information
Category:
Coding, syntax & commands
Hi nichole!
I don't understand very well the situation of yours but i think i can help if you explain a little bit better.
the code you showed does not gives any errors at all, check the hole form code.
You can check:
* if there's some code on timers that execute the .setfocus method
* if there is a .setfocus on the form_load (this one gives an error when you load the form, because you cannot force the focus of an object while loading a form)
* if the control property .enabled is set to true (if set to false the control cannot have focus)
About the order of the events on a form i've read of it only in the msdn library.
When the form loads it gives the focus to the control that haves the lower value on the property .tabindex and check if it can get focus, if it doesn't then the form try to give focus to the next control in the .tabindex rank, when it find a control that can get focus then it gives the focus and raise the event got_focus.
If you give focus to another control (by clicking on it, or pressing the tab key) then the control raises the event validate, and then the event lost_focus.
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only