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

📄 right10-4.htm

📁 Visual C++面向对象程序设计教程(配套习题资源)
💻 HTM
字号:
<html>

<head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>第 10 章</title>
<base target="rbottom">
<style>
<!--
.右标题   { font-size: 10pt; color: #000080; text-indent: 0; margin: 0 }
.右内容   { font-size: 10pt; text-align: left; text-indent: 0; line-height: 100%; margin: 
               0 }
-->
</style>
</head>

<body>

<p style="line-height: 100%; margin-top: 0; margin-bottom: 0"> </p>
<p style="line-height: 100%; margin-top: 0; margin-bottom: 0"><span style="position: absolute; left: 4; top: -8"><img border="0" src="1.gif" width="63" height="70"></span></p>
<p style="line-height: 100%; margin-top: 0; margin-bottom: 0">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</p>
<p style="line-height: 100%; text-indent: 0; margin: 0" class="右标题" align="left">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;                                                            
&nbsp;&nbsp;&nbsp; <span style="background-color: #CCFF99">第 10 章</span><span style="background-color: #CCFF99">&nbsp;                                                   
</span>&gt;<span style="background-color: #CCFF99"> 第 </span><span style="background-color: #CCFF99">4 
节 </span>&gt;<span style="background-color: #CCFF99"> 10.4 对话框编辑器的使用</span></p>                 
<hr color="#008000" size="1">

<p ALIGN="JUSTIFY" style="line-height: 100%; margin-top: 0; margin-bottom: 0"><font size="2">1.  
<font LANG="ZH-CN">对话框的创建</font></font></p>
<font SIZE="3">
<p ALIGN="JUSTIFY" style="line-height: 100%; margin-top: 0; margin-bottom: 0"></font><font size="2"><font LANG="ZH-CN">对话框作为</font>Windows<font LANG="ZH-CN">的资源,其创建方法类似于其他资源的创建。选取“</font>Insert<font LANG="ZH-CN">”菜单下的“</font>Resource<font LANG="ZH-CN">”命令(或使用加速键〈</font>Ctrl<font LANG="ZH-CN">〉</font>+<font LANG="ZH-CN">〈</font>R<font LANG="ZH-CN">〉),在弹出的资源列表中选取“</font>Dialog<font LANG="ZH-CN">”项,单击“</font>New<font LANG="ZH-CN">”即可。</font></font></p>
<p ALIGN="JUSTIFY" style="line-height: 100%; margin-top: 0; margin-bottom: 0"><font LANG="ZH-CN" size="2">(1)  
对话框属性</font></p>
<font SIZE="3">
<p ALIGN="JUSTIFY" style="line-height: 100%; margin-top: 0; margin-bottom: 0"></font><font size="2"><font LANG="ZH-CN">双击对话框或者单击对话框选择“</font>View<font LANG="ZH-CN">”菜单下的“</font>Properties<font LANG="ZH-CN">”命令或者右键单击对话框选择“</font>Properties<font LANG="ZH-CN">”会显示对话框属性对话框,如图</font>10-8<font LANG="ZH-CN">所示</font></font></p>
<p style="line-height: 100%; margin-top: 0; margin-bottom: 0"> </p>
<p style="line-height: 100%; margin-top: 0; margin-bottom: 0" align="center"><span lang="EN-US" style="font-size:10.5pt;mso-bidi-font-size:
10.0pt;font-family:&quot;Times New Roman&quot;;mso-fareast-font-family:宋体;mso-font-kerning:
10.5pt;mso-ansi-language:EN-US;mso-fareast-language:ZH-CN;mso-bidi-language:
AR-SA"><img src="right126.jpg" v:shapes="_x0000_i1025" width="348" height="124"></span><font size="2">&nbsp;</font></p>
<p ALIGN="center" style="line-height: 100%; margin-top: 0; margin-bottom: 0"><font size="2">图10-8  
(a) General<font LANG="ZH-CN">选项卡</font>&nbsp;&nbsp;</font></p> 
<p ALIGN="center" style="line-height: 100%; margin-top: 0; margin-bottom: 0"><font size="2">ID<font LANG="ZH-CN">:对话框的标识符名称。</font></font></p>
<p ALIGN="center" style="line-height: 100%; margin-top: 0; margin-bottom: 0"><font size="2">Caption<font LANG="ZH-CN">:对话框的标题名称。</font></font></p>
<p ALIGN="center" style="line-height: 100%; margin-top: 0; margin-bottom: 0"><font size="2"><span lang="EN-US" style="font-size:10.5pt;mso-bidi-font-size:
10.0pt;font-family:&quot;Times New Roman&quot;;mso-fareast-font-family:宋体;mso-font-kerning:
10.5pt;mso-ansi-language:EN-US;mso-fareast-language:ZH-CN;mso-bidi-language:
AR-SA"><img src="right127.jpg" v:shapes="_x0000_i1025" width="348" height="124"></span></font></p>
<p ALIGN="center" style="line-height: 100%; margin-top: 0; margin-bottom: 0">&nbsp;<font size="2">图10-8  
(b) Styles<font LANG="ZH-CN">选项卡</font></font></p> 
<p ALIGN="center" style="line-height: 100%; margin-top: 0; margin-bottom: 0"><font size="2">Titlebar<font LANG="ZH-CN">复选框:为对话框创建一个标题条。</font></font></p>
<p ALIGN="center" style="line-height: 100%; margin-top: 0; margin-bottom: 0"><font size="2">System  
menu<font LANG="ZH-CN">复选框:为对话框创建一个系统菜单。</font></font></p>
<p ALIGN="JUSTIFY" style="line-height: 100%; margin-top: 0; margin-bottom: 0"> </p>
<p ALIGN="JUSTIFY" style="line-height: 100%; margin-top: 0; margin-bottom: 0"><font size="2">注:<font LANG="ZH-CN">单击相应的属性页然后按</font>F1<font LANG="ZH-CN">得到属性页的相关帮助。</font></font></p>
<p ALIGN="justify" style="line-height: 100%; margin-top: 10; margin-bottom: 0"><font lang="ZH-CN" size="2">(2)</font><font LANG="ZH-CN" size="2"> 
对话框工具栏</font></p> 
<font SIZE="3">
<p ALIGN="JUSTIFY" style="line-height: 100%; margin-top: 0; margin-bottom: 0"></font><font size="2"><font LANG="ZH-CN">对话框创建之后,在其右边可以看到对话框工具栏,如图</font>10-9<font LANG="ZH-CN">所示。</font></font></p>
<font SIZE="3">
<p ALIGN="JUSTIFY" style="line-height: 100%; margin-top: 0; margin-bottom: 0"> </p>
</font>
<p ALIGN="CENTER" style="line-height: 100%; margin-top: 0; margin-bottom: 0"><font size="2"><img SRC="Image15.gif" WIDTH="319" HEIGHT="68"></font></p>
<font SIZE="3"></font>
<p ALIGN="CENTER" style="line-height: 100%; margin-top: 0; margin-bottom: 0"><font size="2">图10-9  
<font LANG="ZH-CN">对话框编辑器中使用的工具栏</font></font></p>
<p ALIGN="JUSTIFY" style="line-height: 100%; margin-top: 0; margin-bottom: 0"><font size="2">2.  
<font LANG="ZH-CN">对话框内控件的添加</font></font></p>
<font SIZE="3">
<p ALIGN="JUSTIFY" style="line-height: 100%; margin-top: 0; margin-bottom: 0"></font><font size="2"><font LANG="ZH-CN">使用如图</font>10-9<font LANG="ZH-CN">所示的对话框工具栏可以方便地向对话框添加控件,添加的方法有两种。</font></font></p>
<p ALIGN="JUSTIFY" style="line-height: 100%; margin-top: 0; margin-bottom: 0"><font LANG="ZH-CN" size="2">(1)  
单击方式添加控件</font></p>
<p ALIGN="JUSTIFY" style="line-height: 100%; margin-top: 0; margin-bottom: 0"><font LANG="ZH-CN" size="2">(2)  
拖动方式添加控件</font></p>
<p ALIGN="JUSTIFY" style="line-height: 100%; margin-top: 0; margin-bottom: 0"> </p>
<p ALIGN="JUSTIFY" style="line-height: 100%; margin-top: 0; margin-bottom: 0"><font size="2">3.  
<font LANG="ZH-CN">对话框内控件的布局及尺寸控制</font></font></p>
<font SIZE="3">
<p ALIGN="JUSTIFY" style="line-height: 100%; margin-top: 0; margin-bottom: 0"></font><font size="2"><font LANG="ZH-CN">为了使对话框中的控件布局美观整齐,必须对控件的位置进行控制,在</font>VC<font LANG="ZH-CN">集成开发环境中提供两种方法对控件布局进行控制:</font></font></p>
<p ALIGN="JUSTIFY" style="line-height: 100%; margin-top: 0; margin-bottom: 0"><font size="2"><font LANG="ZH-CN">① 
使用在</font>VC<font LANG="ZH-CN">集成开发环境底部的布局工具栏控制控件的布局</font><font LANG="ZH-CN">,见图10-10。</font></font></p>
<p ALIGN="JUSTIFY" style="line-height: 100%; margin-top: 0; margin-bottom: 0"><font LANG="ZH-CN" size="2">②  
使用Layout菜单中的菜单命令控制控件的布局。</font><font size="2"><font lang="ZH-CN">注:</font><font FACE="??ì?,SimSun" LANG="ZH-CN">打开对话框编辑器时集成开发环境会出现“</font>Layout<font FACE="??ì?,SimSun" LANG="ZH-CN">”菜单。</font></font></p>
<font SIZE="3">
<p ALIGN="JUSTIFY" style="line-height: 100%; margin-top: 0; margin-bottom: 0"></font><font LANG="ZH-CN" size="2">两种方法十分相似,只不过菜单的控制更加丰富。</font></p>
<font SIZE="3">
<p ALIGN="JUSTIFY" style="line-height: 100%; margin-top: 0; margin-bottom: 0"> </p>
</font>
<p ALIGN="CENTER" style="line-height: 100%; margin-top: 0; margin-bottom: 0"><font size="2"><img SRC="Image16.gif" WIDTH="370" HEIGHT="28"></font></p>
<font SIZE="3"></font>
<p ALIGN="CENTER" style="line-height: 100%; margin-top: 0; margin-bottom: 0"><font size="2">图10-10  
<font LANG="ZH-CN">对话框编辑器的布局工具按钮</font></font></p>
<p style="line-height: 100%; text-indent: 0; margin: 0" class="右标题" align="left"> </p>

<hr size="1" color="#008000">
<p style="line-height: 100%; margin-top: 0; margin-bottom: 0"> </p>            

<p style="line-height: 100%; margin-top: 0; margin-bottom: 0">&nbsp;&nbsp; <span style="position: absolute; left: 32; top: 978"><a href="right10-3.htm" target="_self"><img border="0" src="rightd1.gif" width="113" height="70"></a></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;                                 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="position: absolute; left: 503; top: 985"><a href="right10-5.htm" target="_self"><img border="0" src="rightd2.gif" width="124" height="63"></a></span></p>                    

</body>

</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -