TAB doesn't work for non-modal forms!

G

Guest

Hi group!
please, help me with the following problem:

When I open a non-modal form from a VB6 written MMC snap-in the form works
fine. But I can't use ob TAB key to navigate through its fields. The form
just ignores it.

I found some discussion about such case and they proposed a solution for a
form that doesn't use a Tab Control. But in my case the form has a Tab
Control and the proposed solution does't work.

There is no problem with the form when it works in modal mode (i.e. if its'
opened with ShowDialog() call).

I tried the following workarounds:

1) Started the non-modal form in a new thread.

Problem found: I can use TAB to switch between all form controls untill a
checkbox get the focuse. When the focuse comes to the checkbox TAB and
Shift-TAB keys are ignored again. When I select other control with the mouse
TAB key sarts to work again until the checkbox gets the focus again.

2) I added a hook using SetWindowsHookEx call to intercept all messages from
the main message loop and process them accordingly (See
http://www.tech-archive.net/Archive...tnet.framework.windowsforms/2004-05/0112.html)

Problem found:
a) TAB order in the form become random.
b) TAB key selects only Tab Pages and standalone controls but doesn't
allow to select a coltrol in these Tap Pages.

Please help!

Dima
 
L

Lloyd Dupont

looks obvious to me!
that's the WndProc/Event loop the problem!

I have write 2 such function in my whole life and it was a while ago so I
cannot give you a more detailed answer..... but maybe there is a WNDCLASS (a
system unique string describing the windows) issue there?

well, I can't do more, but hope it will gives you some idea...
 
G

Guest

Hi Lloyd,
I agree that the problem is with the processing of the keyboard events.

But the question is how to fix it. Currently, I do not see a reliable way to
fix the issue.

I do not think that the problem may be with the corresponding WNDCLASS
because of the following reasons:
1) C# should take care about assigning a unique window indentifier.
2) The same windoe works fine if it is started from a .NET application.

So, the problem happens anly when the C# form is opened in non-modal mode
from a Win32 application. (In this case it's mmc.exe).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top