-
Jan 6th, 2022, 10:16 AM
#1
Thread Starter
New Member
control.TabStop gives combobox a focus
When I set
comboA.TabStop = False
The comboA will get focused.
I found a thread about this:
https://www.vbforums.com/showthread....hlight=tabstop
So, is this a bug?
-
Jan 6th, 2022, 01:39 PM
#2
Re: control.TabStop gives combobox a focus
Are you saying that when you press the Tab key focus moves to comboA? Need a full explanation.
-
Jan 6th, 2022, 06:30 PM
#3
Thread Starter
New Member
Re: control.TabStop gives combobox a focus
Originally Posted by wes4dbt
Are you saying that when you press the Tab key focus moves to comboA? Need a full explanation.
No, when the form displayed first time, without any extra action.
-
Jan 6th, 2022, 08:54 PM
#4
Re: control.TabStop gives combobox a focus
When a form is displayed, if it contains controls that can receive focus then one of those controls will receive focus. By default, that will be the first control in the Tab order. If you want a different control to receive focus by default then you need to make it the first control in the Tab order. If you want a control other than the first in the Tab order to have focus when a form is displayed then you need to do that manually. Handle the Shown event of the form, which is raised immediately after the form is displayed for the first time, and call the Select method of the control you want to have focus.
-
Jan 7th, 2022, 02:41 AM
#5
Re: control.TabStop gives combobox a focus
Originally Posted by jmcilhinney
When a form is displayed, if it contains controls that can receive focus then one of those controls will receive focus. By default, that will be the first control in the Tab order. If you want a different control to receive focus by default then you need to make it the first control in the Tab order. If you want a control other than the first in the Tab order to have focus when a form is displayed then you need to do that manually. Handle the Shown event of the form, which is raised immediately after the form is displayed for the first time, and call the Select method of the control you want to have focus.
@ChrisAka - If you Select a Label, you won't see any focus on Form_Shown
- Coding Examples:
- Features:
- Online Games:
- Compiled Games:
-
Jan 7th, 2022, 04:53 AM
#6
Re: control.TabStop gives combobox a focus
Originally Posted by .paul.
If you Select a Label, you won't see any focus on Form_Shown
Or you could just set ActiveControl to Nothing if you don't want there to be an active control.
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
|