Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre question// détermination du rectangle où placer les dialogues enfants à partir du rectangle // du TabCtrl, conversion dans le system de coordonnées de la boîte de dialogue // parente CRect rcTabCtrl; m_TabCtrl.GetWindowRect(rcTabCtrl); m_TabCtrl.AdjustRect(FALSE, rcTabCtrl); ScreenToClient(rcTabCtrl); // création des boîtes de dialogues filles CSize sizeMax(0, 0); m_apChildTabDlg = new CChildTabDlg* [_countof(s_aChildTabDescr)]; for(int i = 0; i < _countof(s_aChildTabDescr); i++) { // création dialogue m_apChildTabDlg[i] = (CChildTabDlg*) s_aChildTabDescr[i].m_pClass->CreateObject(); m_apChildTabDlg[i]->Create(s_aChildTabDescr[i].m_nId, this); // ajout onglet m_TabCtrl.InsertItem(i, s_aChildTabDescr[i].m_lpszName); // taille, on le place au centre du TabCtrl CRect rcChildDlg; m_apChildTabDlg[i]->GetWindowRect(rcChildDlg); int x = (rcTabCtrl.left+rcTabCtrl.right)/2 - (rcChildDlg.Width())/2; int y = (rcTabCtrl.top+rcTabCtrl.bottom)/2 - (rcChildDlg.Height())/2; m_apChildTabDlg[i]->SetWindowPos(NULL, x, y, 0, 0, SWP_NOZORDER|SWP_NOSIZE); }