Usercontrol tab-order wrap problem 
Author Message
 Usercontrol tab-order wrap problem

It seems that VB has a problem "wrapping" the tab order on a usercontrol.

1) I've created a usercontrol (user1) with 3 command buttons
2) Then created a new project with a form, and placed the usercontrol on it
3) Now - If I press the Tab button, focus moved from button 1  to 2 to 3,
but then stops. It's possible to reverse the tab by using SHIFT_TAB, but I
what it to wrap around.

Can anybody help me with this problem ??

p.s. If a place a 4'th button on the main form, everything works fine. That
is from 1,2,3,4 -> back to 1

Br Mads H?ffner



Fri, 19 Nov 2004 22:31:56 GMT  
 Usercontrol tab-order wrap problem
You've been bitten...

BUG: Unable to Tab Through Controls on UserControl (Q192196)
http://support.microsoft.com/default.aspx?scid=kb;en-us;Q192196

I was able to work around it by placing a picturebox on the form (which can
rec'v focus) and immediately setting focus back to the usercontrol. You can
hide the picturebox all together by setting its border = none and a back
color to match your form... (can't disable or set its visible property =
false though)... of course, if you have any other controls that can rec'v
focus, the problem goes away so you can dump the picturebox.
'======
Private Sub Picture1_GotFocus()
   On Error Resume Next
   UserControl11.SetFocus
   Err.Clear
End Sub
'======

--
Ken Halter
MS-MVP-VB
http://www.vbsight.com/
Please keep it in the groups..

Quote:

> It seems that VB has a problem "wrapping" the tab order on a
> usercontrol.

> 1) I've created a usercontrol (user1) with 3 command buttons
> 2) Then created a new project with a form, and placed the usercontrol
> on it 3) Now - If I press the Tab button, focus moved from button 1
> to 2 to 3, but then stops. It's possible to reverse the tab by using
> SHIFT_TAB, but I what it to wrap around.

> Can anybody help me with this problem ??

> p.s. If a place a 4'th button on the main form, everything works
> fine. That is from 1,2,3,4 -> back to 1

> Br Mads H?ffner



Sat, 20 Nov 2004 10:59:00 GMT  
 Usercontrol tab-order wrap problem
Note that the work around provided in the article works as well.. but
doesn't allow for the parent forms controls. Support for parent controls
should be fairly easy to add.

--
Ken Halter
MS-MVP-VB
http://www.vbsight.com/
Please keep it in the groups..

Quote:

> It seems that VB has a problem "wrapping" the tab order on a
> usercontrol.

> 1) I've created a usercontrol (user1) with 3 command buttons
> 2) Then created a new project with a form, and placed the usercontrol
> on it 3) Now - If I press the Tab button, focus moved from button 1
> to 2 to 3, but then stops. It's possible to reverse the tab by using
> SHIFT_TAB, but I what it to wrap around.

> Can anybody help me with this problem ??

> p.s. If a place a 4'th button on the main form, everything works
> fine. That is from 1,2,3,4 -> back to 1

> Br Mads H?ffner



Sat, 20 Nov 2004 11:03:45 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Usercontrol tab-order wrap problem

2. API created usercontrol tab order problem (Again)

3. API created usercontrol tab order problem

4. Help: Wrap around controls tab order in SSTab

5. Combining tab order with tab order of a child form

6. UserControl Z-Order problem

7. Slider z-order problem on UserControl

8. Problems with tab order

9. tab control - order of tabs

10. where's the FAQ, newbie tab order problem

11. Problem with tab order and ActiveX controls

12. Tab Page Order Problem

 

 
Powered by phpBB® Forum Software