How to add Control In Tab
-
Hello Friends, I am using win32 Application. In which I need to create the Tab Control. I have created the Tabs using following code, But don't know how to add Control in particular TAB. Can anybody tell me how to do this. Following is the code I am using to create the TAB.
HWND WINAPI DoCreateTabControl(HWND hwndParent)
{
RECT rcClient;
HWND hwndTab;
TCITEM tie1, tie2;
GetClientRect(hwndParent, &rcClient);
InitCommonControls();
hwndTab = GetDlgItem(hwndParent,IDC_TAB1);// Add tabs for each day of the week. tie1.mask = TCIF\_TEXT | TCIF\_IMAGE; tie1.iImage = -1; tie1.pszText = L"TAB 1"; tie2.mask = TCIF\_TEXT | TCIF\_IMAGE; tie2.iImage = -1; tie2.pszText = L"TAB2 ";
TabCtrl_InsertItem(hwndTab, 0,&tie1);
TabCtrl_InsertItem(hwndTab, 1,&tie2);return hwndTab;
}Thnx in advance..
[ Screen Capture ][ Tool Tip ]
-
Hello Friends, I am using win32 Application. In which I need to create the Tab Control. I have created the Tabs using following code, But don't know how to add Control in particular TAB. Can anybody tell me how to do this. Following is the code I am using to create the TAB.
HWND WINAPI DoCreateTabControl(HWND hwndParent)
{
RECT rcClient;
HWND hwndTab;
TCITEM tie1, tie2;
GetClientRect(hwndParent, &rcClient);
InitCommonControls();
hwndTab = GetDlgItem(hwndParent,IDC_TAB1);// Add tabs for each day of the week. tie1.mask = TCIF\_TEXT | TCIF\_IMAGE; tie1.iImage = -1; tie1.pszText = L"TAB 1"; tie2.mask = TCIF\_TEXT | TCIF\_IMAGE; tie2.iImage = -1; tie2.pszText = L"TAB2 ";
TabCtrl_InsertItem(hwndTab, 0,&tie1);
TabCtrl_InsertItem(hwndTab, 1,&tie2);return hwndTab;
}Thnx in advance..
[ Screen Capture ][ Tool Tip ]
GauranG33 wrote:
don't know how to add Control in particular TAB.
You cant add so. Actually we should process hide and show of each controls according to the current tab. For example, if there is a button in the first tab and an edit control in the second, then when the first tab is active, we have to hide the edit control and show the button. Similarly we have to hide the button and show the edit when the second tab is active. More for flexibility, we are using property sheets. In that controls for each tab are placed in different dialogs. Means one dialog for each tab. And when a particular tab is active then all the dialogs except that for this particular tab will be made hidden. So only the controls in the current tab(dialog) will be visible.
- NS -