Click here to Skip to main content
14,695,443 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi all
i have a dialog application.wherein i want to load another dialog to a particular rectangular portion of parent dialog(by a button click)
i have included the code as follows,but it is not working
parentDlg::Initdialog()
{
childDlg.Create(IDD_CHILD_DLG,this);
childDlg.showWindow(FALSE);
}

parentDlg::OnButtonClick()
{
getclientrect(&rc);
clienttoscreen(&rc);
childDlg.SetWindowPos(FromHandle(m_hWnd),rc.left+100,rc.top+100,120,120,SWP_FRAMECHANGED|SWP_SHOWWINDOW|SWP_NOZORDER);
childDlg.showwindow(true);
}

any idea?

thanks in advance
Posted
Updated 21-Aug-13 21:31pm
v2
Comments
ThatsAlok 22-Aug-13 3:46am
   
Is your childDlg is create successfully?

it isnt good GUI-design. A new "task" and dialog should open in a new window. If only some options are added, they should always be visible but be grayed if not needed.

Else you can use a tabbed dialog.
   
getclientrect(&rc);
clienttoscreen(&rc);
childDlg.SetWindowPos(FromHandle(m_hWnd),rc.left+100,rc.top+100,120,120,SWP_FRAMECHANGED|SWP_SHOW


Problem seems in above lines. please make sure you are using the co-ordinates within parent window and they are not resulting out of range.
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900