Tabbing not working in vb 6.0 forms

  • Thread starter Thread starter rmiller
  • Start date Start date
R

rmiller

I'm in dire straits. I'm converting part of a product into VB.NET, but
still need to access forms written in VB 6.0. I've got just about
everyting working, but the tabbing on the form. The form captures the
tab key when it's pressed, but fails to go through the series of
controls. Help!
 
rmiller said:
I'm in dire straits. I'm converting part of a product into VB.NET, but
still need to access forms written in VB 6.0. I've got just about
everyting working, but the tabbing on the form. The form captures the
tab key when it's pressed, but fails to go through the series of
controls. Help!

Did that form behave correctly from VB6? Are you using any APIs to reset the
Parent of that VB6 form (fwiw, a misbehaved tab key is one of the side
effects of the SetParent API)? You mention that the form traps the tab
key.... how? Normally, in VB6, you can detect Tab only if TabStop = False on
every control on the form. Is this the case? More info please <g>

Thing is, if you set TabStop = False on all controls in that VB6 form, I can
dig up some code that gathers all controls into a collection, sorts them
based on TabIndex and when Tab (or Shift Tab) is pressed, the code figures
out (easily) which control needs to get focus.
 
Thanks Ken. The form behaves normally when called from another VB6.0
application. I use an API (ShowWindow, i believe) to show the form
because one cannot call a COM non-modal form from .NET app. This makes
it an out of process object and it looses the ability to capture the
Tab key for some reason, so instead it enters the KeyDown routine for
the Form rather than just skipping to the next control. I added some
code to find the ActiveControl and then set the ActiveControl to the
next one in the TabIndex order which seems to work well, but kind of a
hack in my opinon.
 
Back
Top