Click here to Skip to main content
15,914,066 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: stop document vew from appearing upon start up. Pin
Tomasz Sowinski24-Apr-01 5:09
Tomasz Sowinski24-Apr-01 5:09 
GeneralRe: stop document vew from appearing upon start up. Pin
Josh Knox24-Apr-01 5:34
Josh Knox24-Apr-01 5:34 
GeneralCOM: Getting PID of virtual folders Pin
Henrik24-Apr-01 3:34
Henrik24-Apr-01 3:34 
GeneralCreting a menu bar like in Internet Explorer Pin
24-Apr-01 3:31
suss24-Apr-01 3:31 
GeneralRe: Creting a menu bar like in Internet Explorer Pin
24-Apr-01 5:36
suss24-Apr-01 5:36 
QuestionHow can I set CFileDialog icons... Pin
23-Apr-01 23:33
suss23-Apr-01 23:33 
GeneralBuilding an Class Wizard looking Dialog Pin
23-Apr-01 20:16
suss23-Apr-01 20:16 
GeneralRe: Building an Class Wizard looking Dialog Pin
Manfred Ramosch23-Apr-01 22:03
Manfred Ramosch23-Apr-01 22:03 

If it doesn't bother you that the standard buttons of a property sheet are always there use it.

If you do - like I do in my dialog-based-application now - you have to use the CTabCtrl.

The difference is that you have to create a dialog for each rider of the tab. The tab itself
is just a container. So by selecting the riders of a tab you just call up a user-defined dialog.


  • Put a tab (like IDC_TAB1) in your dialog (CMyDialog) with the dialog editor
  • Open the Class-Wizard and attach a CTabCtrl-Member-Variable (like MyTabCtrl) to your tab-resource (IDC_TAB1)
  • Then you have to tell your tab about the number of riders and their names (with a TC_ITEM structure)
    BOOL CMyDialog::OnInitDialog()<br>
    {
       CDialog::OnInitDialog();
       <br>   TC_ITEM TabCtrlItem;
       TabCtrlItem.mask = TCIF_TEXT;
       <br>   TabCtrlItem.pszText = "Name of the Rider 1"
       MyTabCtrl.InsertItem(0, &TabCtrlItem);
       <br>   TabCtrlItem.pszText = "Name of the Rider 2"
       MyTabCtrl.InsertItem(1, &TabCtrlItem);
       <br>   TabCtrlItem.pszText = "Name of the Rider 3"
       MyTabCtrl.InsertItem(2, &TabCtrlItem);
    }

  • Derive a dialog-class (like CMyFirstRiderDialog) from CDialog
  • You should create another dialog resource (like IDD_MY_FIRST_RIDER) that represents the content of your rider
  • In the function void CMyDialog::OnShowWindow(BOOL bShow, UINT nStatus)
    you'll have to create your rider-dialog.
    void CMyDialog::OnShowWindow(BOOL bShow, UINT nStatus)
    {
       CDialog::OnShowWindow(bShow, nStatus)
       <br>   if(bShow)
       {
          MyFirstRiderDialog->Create(IDD_MY_FIRST_RIDER, MyTabCtrl.GetActiveWindow());
          MyFirstRiderDialog->ShowWindow(SW_SHOW);
       }
    }

  • In the Message Handler of your TCN_SELCHANGE and TCN_SELCHANGING message of your IDC_TAB1 object
    you have to destroy your MyFirstRiderDialog and create the dialog dedicated to your other tabs.
    void MyDialog::OnSelchangingZone(NMHDR* pNMHDR, LRESULT* pResult)
    {
       switch(MyTabCtrl.GetCurSelection())
       {
       case 0:
          CMyFirstRiderDialog->DestroyWindow();
          break;
       <br>   case 1:
          CMySecondRiderDialog->DestroyWindow();
          break;
       <br>   default:
          ASSERT(0);
          break:
       }
    }

    void MyDialog::OnSelchangZone(NMHDR* pNMHDR, LRESULT* pResult)
    {
       switch(MyTabCtrl.GetCurSelection())
       {
       case 0:
          MyFirstRiderDialog->Create(IDD_MY_FIRST_RIDER, MyTabCtrl.GetActiveWindow());
          break;
       <br>   case 1:
          MySecondRiderDialog->Create(IDD_MY_SECOND_RIDER, MyTabCtrl.GetActiveWindow());
          break;
       <br>   default:
          ASSERT(0);
          break:
       }
    }



I think with this you can find the missing links in the VC-manual.


Manfred




---

Programming is knowing...
QuestionWhy are my list box members null? Pin
23-Apr-01 16:51
suss23-Apr-01 16:51 
AnswerRe: Why are my list box members null? Pin
Michael Dunn23-Apr-01 20:09
sitebuilderMichael Dunn23-Apr-01 20:09 
GeneralReza Pin
23-Apr-01 16:36
suss23-Apr-01 16:36 
GeneralRe: Check Master Chris Maunder's code. Pin
Masaaki Onishi23-Apr-01 17:55
Masaaki Onishi23-Apr-01 17:55 
GeneralIShellFolder pointers, how to copy them safely... (COM) Pin
Henrik23-Apr-01 13:43
Henrik23-Apr-01 13:43 
GeneralRe: IShellFolder pointers, how to copy them safely... (COM) Pin
Michael Dunn23-Apr-01 15:49
sitebuilderMichael Dunn23-Apr-01 15:49 
GeneralVB Add-In Programming Pin
Jamie Nordmeyer23-Apr-01 10:53
Jamie Nordmeyer23-Apr-01 10:53 
Generalbook on ado via vc Pin
23-Apr-01 9:28
suss23-Apr-01 9:28 
GeneralRe: book on ado via vc Pin
23-Apr-01 10:15
suss23-Apr-01 10:15 
GeneralRe: book on ado via vc Pin
Brendan Tregear23-Apr-01 16:43
Brendan Tregear23-Apr-01 16:43 
GeneralSetWaitableTimer Pin
Joe O'Connor23-Apr-01 8:09
Joe O'Connor23-Apr-01 8:09 
GeneralAccess Violation Pin
23-Apr-01 6:57
suss23-Apr-01 6:57 
GeneralRe: Access Violation Pin
Tim Deveaux23-Apr-01 7:45
Tim Deveaux23-Apr-01 7:45 
GeneralSTL map warning messages Pin
Arun Saha23-Apr-01 5:27
Arun Saha23-Apr-01 5:27 
GeneralRe: STL map warning messages Pin
Michael Dunn23-Apr-01 5:37
sitebuilderMichael Dunn23-Apr-01 5:37 
GeneralRe: STL map warning messages Pin
AHa23-Apr-01 6:50
AHa23-Apr-01 6:50 
GeneralRe: STL map warning messages Pin
Michael Dunn23-Apr-01 15:53
sitebuilderMichael Dunn23-Apr-01 15:53 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.