|
-
Feb 14th, 2003, 10:31 AM
#1
Thread Starter
Lively Member
yet another setfocus question
I am getting frusterated with this....
I have a simple form and on the form there is a textbox called
txtDetailerEnteredMileage
I am trying to set focus to this on form load. Simply so the user does not have to move the cursor over and click in the box.
However, when i try txtDetailerEnteredMileage.SetFocus
I am getting Invalid Procedure Call or argument.
I looked in the archives and from that made sure to verify that the textbox was visible and enabled. Any ideas? Any help would be immensely appreciated. Thanks
Nightfox02
-
Feb 14th, 2003, 10:48 AM
#2
Unless you put a me.Show someplace in the Load event, the controls do not become visible until the Load is done so you can't set focus to them. The easiest thing to do is to set the focus in the Activate event instead of the Load event.
-
Feb 14th, 2003, 11:08 AM
#3
When a form is first loaded VB will set focus to the control whose TabIndex property is 0. No need to call the SetFocus method.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|