Discussion:
Problem with nested tab controls
(too old to reply)
Drew
2011-08-29 21:32:43 UTC
Permalink
Windows 7/VS 2010 SP1
I'm using a tab control that I got from:

http://www.codeproject.com/KB/tabs/SimpleTab.aspx?msg=4008575#xx4008575xx

My hierarchy is as follows:

Top level dialog
|
Tab control A
|
Dialogs A (in Tab Control A)

|

Tab Control B(in Dialogs A)

|

Dialogs B(in Tab
Control B)

When I click in the empty area near the Tab Control B (where tabs would
reside if they existed) or push any button on the keyboard the currently
displayed dialog (Dialogs B) disappears. When I then click on the tab again
it reappears. I can't seem to figure out why this happens. I thought it may
be a question of z-order or maybe a style bit of the dialogs or tab but I've
played with SetWindowPos() and various styles and no joy. Also, I've tried
using Spy++ to see what kinds of messages the Dialogs B are getting but
nothing pops out as being an explanation for this behavior. If anyone has an
idea about this I'd be grateful. I can provide a minimal example to you in
solution form if necessary.

Thanks,
Drew
Drew
2011-08-29 21:45:57 UTC
Permalink
Sorry... "push any button on the keyboard" should read "push the Enter key
or the Escape key". Also, the dialogs do not have an OK or Cancel button.

Drew

"Drew" wrote in message news:j3h0i0$jja$***@dont-email.me...

Windows 7/VS 2010 SP1
I'm using a tab control that I got from:

http://www.codeproject.com/KB/tabs/SimpleTab.aspx?msg=4008575#xx4008575xx

My hierarchy is as follows:

Top level dialog
|
Tab control A
|
Dialogs A (in Tab Control A)

|

Tab Control B(in Dialogs A)

|

Dialogs B(in Tab
Control B)

When I click in the empty area near the Tab Control B (where tabs would
reside if they existed) or push any button on the keyboard the currently
displayed dialog (Dialogs B) disappears. When I then click on the tab again
it reappears. I can't seem to figure out why this happens. I thought it may
be a question of z-order or maybe a style bit of the dialogs or tab but I've
played with SetWindowPos() and various styles and no joy. Also, I've tried
using Spy++ to see what kinds of messages the Dialogs B are getting but
nothing pops out as being an explanation for this behavior. If anyone has an
idea about this I'd be grateful. I can provide a minimal example to you in
solution form if necessary.

Thanks,
Drew
ScottMcP [MVP]
2011-08-31 04:17:24 UTC
Permalink
Post by Drew
Sorry... "push any button on the keyboard" should read "push the Enter key
or the Escape key". Also, the dialogs do not have an OK or Cancel button.
Even though the dialogs do not have OK or Cancel buttons, the Enter
key generates OnOK and the Escape key generates OnCancel, and those
functions are implemented in CDialog. Try overriding those functions
with empty OnOK and OnCancel functions of your own. (I.e., do not call
the CDialog versions from your versions.)
Drew
2011-08-31 14:31:22 UTC
Permalink
Thanks Scott! That did the trick. Now if only I could figure out why
clicking outside the tab area causes the dialogs to disappear I'd be all
set.

Best regards,
Drew
Post by Drew
Sorry... "push any button on the keyboard" should read "push the Enter key
or the Escape key". Also, the dialogs do not have an OK or Cancel button.
Even though the dialogs do not have OK or Cancel buttons, the Enter
key generates OnOK and the Escape key generates OnCancel, and those
functions are implemented in CDialog. Try overriding those functions
with empty OnOK and OnCancel functions of your own. (I.e., do not call
the CDialog versions from your versions.)

Loading...