📄 subject_56986.htm
字号:
<p>
序号:56986 发表者:王世刚 发表日期:2003-10-22 10:21:16
<br>主题:各位好!请问在SDI中如果加载一个dialog到view不用分割能否实现?
<br>内容:也就是用dialog去覆盖SDI的位置,当然如果要想弹出一个模态或非模态窗体也太容易了,但是界面不好看。我查了很多资料,用Splitter<BR>Wnd好象只能分割2个以上的视图,一个它不支持。
<br><a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p>
<hr size=1>
<blockquote><p>
回复者:golen 回复日期:2003-10-22 10:30:23
<br>内容://记得把类CAboutDlg放在上面来.<BR><BR>BOOL CTest2App::InitInstance()<BR>{<BR>//在系统未显示前,显示下面的框<BR> CAboutDlg a; <BR> a.DoModal(); <BR>//完成<BR> AfxEnableControlContainer();<BR><BR> // Standard initialization<BR> // If you are not using these features and wish to reduce the size<BR> // of your final executable, you should remove from the following<BR> // the specific initialization routines you do not need.<BR><BR>#ifdef _AFXDLL<BR> Enable3dControls(); // Call this when using MFC in a shared DLL<BR>#else<BR> Enable3dControlsStatic(); // Call this when linking to MFC statically<BR>#endif<BR><BR> // Change the registry key under which our settings are stored.<BR> // TODO: You should modify this string to be something appropriate<BR> // such as the name of your company or organization.<BR> SetRegistryKey(_T("Local AppWizard-Generated Applications"));<BR><BR> LoadStdProfileSettings(); // Load standard INI file options (including MRU)<BR><BR> // Register the application's document templates. Document templates<BR> // serve as the connection between documents, frame windows and views.<BR><BR> CSingleDocTemplate* pDocTemplate;<BR> pDocTemplate = new CSingleDocTemplate(<BR> IDR_MAINFRAME,<BR> RUNTIME_CLASS(CTest2Doc),<BR> RUNTIME_CLASS(CMainFrame), // main SDI frame window<BR> RUNTIME_CLASS(CTest2View));<BR> AddDocTemplate(pDocTemplate);<BR><BR> // Parse command line for standard shell commands, DDE, file open<BR> CCommandLineInfo cmdInfo;<BR> ParseCommandLine(cmdInfo);<BR><BR> // Dispatch commands specified on the command line<BR> if (!ProcessShellCommand(cmdInfo))<BR> return FALSE;<BR><BR> // The one and only window has been initialized, so show and update it.<BR> m_pMainWnd->ShowWindow(SW_SHOW);<BR> m_pMainWnd->UpdateWindow();<BR><BR> <BR><BR> return TRUE;<BR>}<BR>
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>
<hr size=1>
<blockquote><p>
回复者:ohye212 回复日期:2003-10-22 10:34:28
<br>内容:先画好一个对话框!继承CFORMVIEW类aaa<BR>在CMAINFRAME 中定义<BR>aaa * www;<BR>CCreateContext context;<BR><BR>在你要触发的地方<BR> context.m_pCurrentDoc=NULL;<BR> context.m_pCurrentFrame=this;<BR> context.m_pLastView=NULL;<BR> context.m_pNewViewClass = RUNTIME_CLASS(aaa );<BR> www= STATIC_DOWNCAST(aaa,CreateView(&context));<BR> if (www != NULL)<BR> { <BR> <BR> GetActiveView()->ShowWindow(SW_HIDE);<BR> GetActiveView()->DestroyWindow();<BR> www->ShowWindow(SW_SHOWMAXIMIZED);<BR> www->OnInitialUpdate();<BR> SetActiveView(www);<BR> RecalcLayout();<BR> }
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>
<hr size=1>
<blockquote><p>
回复者:王世刚 回复日期:2003-10-22 10:35:53
<br>内容:谢谢楼上的回答,可能是我表述清楚,<BR>我不是在程序启动时弹出的对话框,而是程序已经进入主框架后,比如<BR>选择一菜单功能项:“用户登记“->将用户登记对应的窗体放在view里显示。
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>
<hr size=1>
<blockquote><p>
<font color=red>答案被接受</font><br>回复者:ohye212 回复日期:2003-10-22 10:38:43
<br>内容:我的程序就时你说的那样!时可以的!<BR><BR>点击菜单事件<BR> context.m_pCurrentDoc=NULL;<BR> context.m_pCurrentFrame=this;<BR> context.m_pLastView=NULL;<BR> context.m_pNewViewClass = RUNTIME_CLASS(aaa );<BR> www= STATIC_DOWNCAST(aaa,CreateView(&context));<BR> if (www != NULL)<BR> { <BR> <BR> GetActiveView()->ShowWindow(SW_HIDE);<BR> GetActiveView()->DestroyWindow();<BR> www->ShowWindow(SW_SHOWMAXIMIZED);<BR> www->OnInitialUpdate();<BR> SetActiveView(www);<BR> RecalcLayout();<BR> }
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>
<hr size=1>
<blockquote><p>
回复者:王世刚 回复日期:2003-10-22 10:53:00
<br>内容:哦,对不起,刚才本是回复golensoft的,<BR>看起来你的思路是对的,我的对话框已经继承了CFormView的,那我试试看.
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>
<hr size=1>
<blockquote><p>
回复者:王世刚 回复日期:2003-10-23 09:08:17
<br>内容:ohye212 说得没错,不过form 的style还该设成child才行。
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -