MFC child (WS_CHILD) dialog has different style than parent

拟墨画扇 提交于 2021-02-10 06:23:26

问题


I have 2 dialog and I´m trying to embedded one to another. It is accomplished by setting style of embedded dialog to WS_CHILD. It works correctly, but embedded dialog has wrong (default windows) style. Is it windows thing, that cannot be changed, or is there any way to fix it? I tried to changed all options for both dialogs in resource editor, but none seems to work.

Main dialog is normal modal dialog. Embedded dialog is created in OnInitDialog() of main dialog like

CDialog m_dlg1;
m_dlg1.Create(CDialog1::IDD, this);
m_dlg1.SetWindowPos(NULL, 0, 0, 0, 0, SWP_SHOWWINDOW|SWP_NOSIZE|SWP_NOMOVE)

and has Style set to Child in Resource editor.

Result looks like

How I want it to look (it looks like it with popup and overlapped style)

Thanks in advance for any help, or recommendations.

来源:https://stackoverflow.com/questions/44064782/mfc-child-ws-child-dialog-has-different-style-than-parent

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!