c++ - child of tab dialog control cover the tab itself -
i create tab control in wm_initdialog
way:
initcommoncontrolsex icex = {0}; icex.dwsize = sizeof(initcommoncontrolsex); icex.dwicc = icc_tab_classes; initcommoncontrolsex(&icex); tcitem tie; lpstr text = "my tab"; tie.mask = tcif_text|tcif_image; tie.iimage = -1; tie.psztext = text; htab = createwindow(wc_tabcontrol, "", ws_child |ws_clipsiblings| ws_visible, 0,0, 400, 350, hwnd,null, g_hinstance, null); tabctrl_insertitem(htab,0,&tie); tabctrl_insertitem(htab,1,&tie); tabctrl_insertitem(htab,2,&tie);
and create 2 dialog here show in each tab content of tab. create them toolbox selecting formview dialog:
hwndtabcontentdialog1 = createdialogparam( getmodulehandle( null ), makeintresource( idd_formview1 ), htab, (dlgproc)proc1,lparam ); hwndtabcontentdialog2 = createdialogparam( getmodulehandle( null ), makeintresource( idd_formview ), htab, (dlgproc)proc2,lparam );
now in wm_notify
doing content of each tab when clicked:
case wm_notify: switch (((lpnmhdr)lparam)->code) { case tcn_selchange: { if( tabctrl_getcursel( ( ( lpnmhdr ) lparam) -> hwndfrom ) == 0 ) { showwindow( hwndtabcontentdialog1, sw_show ); showwindow( hwndtabcontentdialog2, sw_hide ); } else { showwindow( hwndtabcontentdialog1, sw_hide ); showwindow( hwndtabcontentdialog2, sw_show ); } }
now tab created , fine(content of current tab not visible), when click on 1 of tab items dialog cover tab control , cant see tabs anymore. wrong ? should modify ?
immediately after create dialogs reposition/resize them movewindow. tcm_adjustrect tab control message can figure out proper position/size make dialogs.
Comments
Post a Comment