Discussion:
Using CTabCtrl!!!
(too old to reply)
Bilal Anjum
2003-09-19 07:17:08 UTC
Permalink
Hi All!
I am looking forward to have an idea of how to draw controls on the
CTabCtrl. One way I have in mind is draw the child controls on a separate
dialog and draw the dialog on the CTabCtrl window. But the problem is when I
do this with the code

CTestDlg *pDlg = new CTestDlg;
dlg.Create(IDC_TEST_DLG,GetDlgItem(IDC_TAB_CTRL));

it even covers the tabs. Now how can I fix it within the tab window at
appropriate place. I have tried to draw the group box on the area of tab
control and make that group box the parent window, this will make the new
dialog at the appropriate position. But I don't like this way. Is there any
other more appropriate way to do this?

Regards,
Bilal Anjum
Tim
2003-09-19 07:59:08 UTC
Permalink
Take a look at CPropertySheet and CPropertyPage.
A Property Page is a dialog that is sized to fit "inside" a tab control
within the Property Sheet.

You can use the CPropertySheet in wizard and non wizard modes as you wish.

For an example, take a look at Tools / Options in Internet Explorer.
You don't have to have the OK, Cancel, or Apply buttons....

Or.

When the dialog is created, calculated the size of the "client" area "in"
the tab control and size the dialog manually to fit.

HTH
- Tim
Post by Bilal Anjum
Hi All!
I am looking forward to have an idea of how to draw controls on the
CTabCtrl. One way I have in mind is draw the child controls on a separate
dialog and draw the dialog on the CTabCtrl window. But the problem is when I
do this with the code
CTestDlg *pDlg = new CTestDlg;
dlg.Create(IDC_TEST_DLG,GetDlgItem(IDC_TAB_CTRL));
it even covers the tabs. Now how can I fix it within the tab window at
appropriate place. I have tried to draw the group box on the area of tab
control and make that group box the parent window, this will make the new
dialog at the appropriate position. But I don't like this way. Is there any
other more appropriate way to do this?
Regards,
Bilal Anjum
Bilal Anjum
2003-09-19 08:16:12 UTC
Permalink
Thanks for the reply. How to calculate the size of the client area of the
CTabCtrl? Property sheet won't do a thing coz I have some other controls in
the dialog that has tab control. Resizing the dialog might help me, i 'll
sure try it but if you have any other way in mind, please let me know.

Regards,
Bilal Anjum
AK
2003-09-23 05:52:04 UTC
Permalink
CTabCtrl::GetItemRect - Retrieves the bounding rectangle for a tab in a
tab control. You can retrieve client area
Post by Bilal Anjum
Thanks for the reply. How to calculate the size of the client area of the
CTabCtrl? Property sheet won't do a thing coz I have some other controls in
the dialog that has tab control. Resizing the dialog might help me, i 'll
sure try it but if you have any other way in mind, please let me know.
Regards,
Bilal Anjum
Loading...