⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 subject_56986.htm

📁 vc
💻 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>&nbsp;&nbsp;&nbsp;&nbsp;CAboutDlg a;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;a.DoModal();&nbsp;&nbsp;&nbsp;&nbsp;<BR>//完成<BR>&nbsp;&nbsp;&nbsp;&nbsp;AfxEnableControlContainer();<BR><BR>&nbsp;&nbsp;&nbsp;&nbsp;// Standard initialization<BR>&nbsp;&nbsp;&nbsp;&nbsp;// If you are not using these features and wish to reduce the size<BR>&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;&nbsp;of your final executable, you should remove from the following<BR>&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;&nbsp;the specific initialization routines you do not need.<BR><BR>#ifdef _AFXDLL<BR>&nbsp;&nbsp;&nbsp;&nbsp;Enable3dControls();&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// Call this when using MFC in a shared DLL<BR>#else<BR>&nbsp;&nbsp;&nbsp;&nbsp;Enable3dControlsStatic();&nbsp;&nbsp;&nbsp;&nbsp;// Call this when linking to MFC statically<BR>#endif<BR><BR>&nbsp;&nbsp;&nbsp;&nbsp;// Change the registry key under which our settings are stored.<BR>&nbsp;&nbsp;&nbsp;&nbsp;// TODO: You should modify this string to be something appropriate<BR>&nbsp;&nbsp;&nbsp;&nbsp;// such as the name of your company or organization.<BR>&nbsp;&nbsp;&nbsp;&nbsp;SetRegistryKey(_T(&#34;Local AppWizard-Generated Applications&#34;));<BR><BR>&nbsp;&nbsp;&nbsp;&nbsp;LoadStdProfileSettings();&nbsp;&nbsp;// Load standard INI file options (including MRU)<BR><BR>&nbsp;&nbsp;&nbsp;&nbsp;// Register the application's document templates.&nbsp;&nbsp;Document templates<BR>&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;&nbsp;serve as the connection between documents, frame windows and views.<BR><BR>&nbsp;&nbsp;&nbsp;&nbsp;CSingleDocTemplate* pDocTemplate;<BR>&nbsp;&nbsp;&nbsp;&nbsp;pDocTemplate = new CSingleDocTemplate(<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;IDR_MAINFRAME,<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;RUNTIME_CLASS(CTest2Doc),<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;RUNTIME_CLASS(CMainFrame),&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // main SDI frame window<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;RUNTIME_CLASS(CTest2View));<BR>&nbsp;&nbsp;&nbsp;&nbsp;AddDocTemplate(pDocTemplate);<BR><BR>&nbsp;&nbsp;&nbsp;&nbsp;// Parse command line for standard shell commands, DDE, file open<BR>&nbsp;&nbsp;&nbsp;&nbsp;CCommandLineInfo cmdInfo;<BR>&nbsp;&nbsp;&nbsp;&nbsp;ParseCommandLine(cmdInfo);<BR><BR>&nbsp;&nbsp;&nbsp;&nbsp;// Dispatch commands specified on the command line<BR>&nbsp;&nbsp;&nbsp;&nbsp;if (!ProcessShellCommand(cmdInfo))<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return FALSE;<BR><BR>&nbsp;&nbsp;&nbsp;&nbsp;// The one and only window has been initialized, so show and update it.<BR>&nbsp;&nbsp;&nbsp;&nbsp;m_pMainWnd-&gt;ShowWindow(SW_SHOW);<BR>&nbsp;&nbsp;&nbsp;&nbsp;m_pMainWnd-&gt;UpdateWindow();<BR><BR>&nbsp;&nbsp;&nbsp;&nbsp;<BR><BR>&nbsp;&nbsp;&nbsp;&nbsp;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>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;context.m_pCurrentDoc=NULL;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;context.m_pCurrentFrame=this;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;context.m_pLastView=NULL;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;context.m_pNewViewClass = RUNTIME_CLASS(aaa );<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;www= STATIC_DOWNCAST(aaa,CreateView(&amp;context));<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (www&nbsp;&nbsp;!= NULL)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;&nbsp;&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;GetActiveView()-&gt;ShowWindow(SW_HIDE);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;GetActiveView()-&gt;DestroyWindow();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;www-&gt;ShowWindow(SW_SHOWMAXIMIZED);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;www-&gt;OnInitialUpdate();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SetActiveView(www);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;RecalcLayout();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;&nbsp;&nbsp;&nbsp;
<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>选择一菜单功能项:“用户登记“-&gt;将用户登记对应的窗体放在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>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;context.m_pCurrentDoc=NULL;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;context.m_pCurrentFrame=this;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;context.m_pLastView=NULL;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;context.m_pNewViewClass = RUNTIME_CLASS(aaa );<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;www= STATIC_DOWNCAST(aaa,CreateView(&amp;context));<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (www&nbsp;&nbsp;!= NULL)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;&nbsp;&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;GetActiveView()-&gt;ShowWindow(SW_HIDE);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;GetActiveView()-&gt;DestroyWindow();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;www-&gt;ShowWindow(SW_SHOWMAXIMIZED);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;www-&gt;OnInitialUpdate();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SetActiveView(www);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;RecalcLayout();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;&nbsp;&nbsp;&nbsp; 
<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 + -