Home > Software engineering >  TabControl pricing problem is not displayed
TabControl pricing problem is not displayed

Time:12-03

https://blog.csdn.net/qq_25241325/article/details/80254205
I was written reference this tutorial, but the result is like that, don't know what went wrong, please advise!

CodePudding user response:

Every step of your code to look at, should do not have what problem he has written, maybe your hair with hair, find out which step did or didn't do right

CodePudding user response:

Will not be a child dialogs covered ~ the Tab Control controls

CodePudding user response:

CodePudding user response:


CodePudding user response:

reference 1/f, tiger bobo response:
every step of your code to look at, he should do not have what problem, maybe your hair with hair, find out which step did not do or not do for

Already sent

CodePudding user response:

To use InsertItem!
//TODO: Add extra initialization here
M_Tab. DeleteAllItems ();
Char TXT [40].
TCITEM TabCtrlItem;
Memset (& amp; TabCtrlItem, 0, sizeof (TabCtrlItem));
TabCtrlItem. Mask=TCIF_TEXT | TCIF_PARAM;
TabCtrlItem. CchTextMax=260;
For (int jj=0; Jj<5; Jj++)
{
//if (jj==0)
//TabCtrlItem. LParam=1;//disable
//else
//TabCtrlItem. LParam=0;//enable
Sprintf (TXT, Dlg "% d", jj + 1);
TabCtrlItem. PszText=TXT;//(LPSTR) (LPCSTR) "1";//tabCaption;
M_Tab. InsertItem (jj, & amp; TabCtrlItem);
}


Void CTabDlgDlg: : ShowSelectedDlg ()
{//hide all
M_Dlg1. ShowWindow (SW_HIDE);
M_Dlg2. ShowWindow (SW_HIDE);
M_Dlg3. ShowWindow (SW_HIDE);
M_Dlg4. ShowWindow (SW_HIDE);
M_Dlg5. ShowWindow (SW_HIDE);

Int. Now=m_Tab GetCurSel ();
The switch (now)
{
Case 0:
M_Dlg1. ShowWindow (SW_SHOW);
break;
Case 1:
M_Dlg2. ShowWindow (SW_SHOW);
break;
Case 2:
M_Dlg3. ShowWindow (SW_SHOW);
break;
Case 3:
M_Dlg4. ShowWindow (SW_SHOW);
break;
Case 4:
M_Dlg5. ShowWindow (SW_SHOW);
break;
}
}

CodePudding user response:

Void CTabDlgDlg: : CreateAllDlgs ()
{
CRect rc;
M_Tab. GetClientRect (& amp; Rc);
Rc. Top +=26;//TAB head height
//not visible!
M_Dlg1. Create (MAKEINTRESOURCE (IDD_DIALOG1), & amp; M_Tab);
M_Dlg1. MoveWindow (rc) left, rc, top, rc. The Width (), rc, Height ());
//
M_Dlg2. Create (MAKEINTRESOURCE (IDD_DIALOG2), & amp; M_Tab);
M_Dlg2. MoveWindow (rc) left, rc, top, rc. The Width (), rc, Height ());
//
M_Dlg3. Create (MAKEINTRESOURCE (IDD_DIALOG3), & amp; M_Tab);
M_Dlg3. MoveWindow (rc) left, rc, top, rc. The Width (), rc, Height ());
//
M_Dlg4. Create (MAKEINTRESOURCE (IDD_DIALOG4), & amp; M_Tab);
M_Dlg4. MoveWindow (rc) left, rc, top, rc. The Width (), rc, Height ());

M_Dlg5. Create (MAKEINTRESOURCE (IDD_DIALOG5), & amp; M_Tab);
M_Dlg5. MoveWindow (rc) left, rc, top, rc. The Width (), rc, Height ());
}
  • Related