如何将对话框加载到另一个对话框 [英] how to load a dialog to another dialog

查看:122
本文介绍了如何将对话框加载到另一个对话框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨所有

i有一个对话框application.wherein我想加载另一个对话框到父对话框的特定矩形部分(按一下按钮)

i包含了代码如下,但它不起作用

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);

}



任何想法?



提前感谢

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

推荐答案

它不是很好的GUI-设计。应在新窗口中打开一个新的任务和对话框。如果只添加了一些选项,它们应始终可见,但如果不需要则显示为灰色。



否则,您可以使用选项卡式对话框。
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





问题似乎在上面的行中。请确保您使用父窗口内的坐标,它们是不会超出范围。
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.


这篇关于如何将对话框加载到另一个对话框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆