Hallo,
ich arbeite gerade daran eine TabControll in mein Programm(MFC)
einzufügen.
Es werden auch zwei Dialoge mit unterschiedlichen Titel erstellt. Das
Problem ist, dass in jedem Tab der gleiche Dialog/Text angezeigt wird.
1 | CTabCtrl* pTabCtrl = (CTabCtrl*)GetDlgItem(IDC_TABCONTROL);
|
2 |
|
3 | m_Tab1.Create(IDD_TAB1, pTabCtrl);
|
4 |
|
5 | TCITEM item1;
|
6 | item1.mask = TCIF_TEXT | TCIF_PARAM;
|
7 | item1.lParam = (LPARAM)& m_Tab1;
|
8 | item1.pszText = _T("Titel Tab1");
|
9 | pTabCtrl->InsertItem(0, &item1);
|
10 |
|
11 | CRect rcItem1;
|
12 | //m_tabcontrol.InsertItem(0, &item1);
|
13 | pTabCtrl->GetItemRect(0, &rcItem1);
|
14 |
|
15 | m_Tab1.SetWindowPos(NULL, rcItem1.left, rcItem1.bottom + 1, 0, 0, SWP_NOSIZE | SWP_NOZORDER );
|
16 | m_Tab1.ShowWindow(SW_SHOW);
|
17 |
|
18 | m_Tab2.Create(IDD_TAB2, pTabCtrl);
|
19 | TCITEM item2;
|
20 | item2.mask = TCIF_TEXT | TCIF_PARAM;
|
21 | item2.lParam = (LPARAM)& m_Tab2;
|
22 | item2.pszText = _T("Titel Tab2");
|
23 | pTabCtrl->InsertItem(1, &item2);
|
24 |
|
25 | // Dialog positionieren
|
26 | CRect rcItem2;
|
27 | //m_tabcontrol.InsertItem(1, &item2);
|
28 | pTabCtrl->GetItemRect(1, &rcItem2);
|
29 |
|
30 | m_Tab2.SetWindowPos(NULL, rcItem2.left, rcItem2.bottom + 1, 0, 0, SWP_NOSIZE | SWP_NOZORDER );
|
31 |
|
32 | m_Tab2.ShowWindow(SW_SHOW);
|
Ich habe schon andere Codes studiert und rumprobiert. Aber es klappt
irgendwie nicht, dass ich jeweiligen Tab den entsprechenden Dialog
zuordne. Es wird in beiden Tabs das gleich angezeigt.
Wäre super wenn ihr mir einen Tip geben könntet.
danke schonmal
ani