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

📄 c++ builder 程序设计实用教程 - 3_1_1 对话框函数简介 - 张晋 - 17xie.htm

📁 已经消失的不易找到的C++ builder网络教程总结
💻 HTM
📖 第 1 页 / 共 3 页
字号:
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">控件的作用如下:</SPAN></P>
<P class=MsoNormal 
style="MARGIN-LEFT: 42.5pt; TEXT-INDENT: -21.25pt; tab-stops: list 21.25pt 42.5pt; mso-list: l0 level1 lfo1"><SPAN 
lang=EN-US 
style="FONT-FAMILY: Wingdings; mso-fareast-font-family: Wingdings; mso-bidi-font-family: Wingdings"><SPAN 
style="mso-list: Ignore">n<SPAN 
style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
</SPAN></SPAN></SPAN><SPAN 
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">按钮空间</SPAN><SPAN 
lang=EN-US>Button1</SPAN><SPAN 
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">:用来显示一个数字输入框;</SPAN></P>
<P class=MsoNormal 
style="MARGIN-LEFT: 42.5pt; TEXT-INDENT: -21.25pt; tab-stops: list 21.25pt 42.5pt; mso-list: l0 level1 lfo1"><SPAN 
lang=EN-US 
style="FONT-FAMILY: Wingdings; mso-fareast-font-family: Wingdings; mso-bidi-font-family: Wingdings"><SPAN 
style="mso-list: Ignore">n<SPAN 
style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
</SPAN></SPAN></SPAN><SPAN 
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">文本框空间</SPAN><SPAN 
lang=EN-US>Edit1</SPAN><SPAN 
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">:用来显示信息输入框中输入数字的平方值。</SPAN></P>
<H4><SPAN lang=EN-US>11</SPAN><SPAN 
style="FONT-FAMILY: 楷体_GB2312; mso-ascii-font-family: 'Times New Roman'">.添加代码</SPAN></H4>
<P class=MsoNormal><SPAN 
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">并且在按钮的响应事件中添加如下代码:</SPAN></P>
<P class=a0><SPAN class=SpellE><SPAN lang=EN-US 
style="FONT-FAMILY: 'Times New Roman'">AnsiString</SPAN></SPAN><SPAN lang=EN-US 
style="FONT-FAMILY: 'Times New Roman'"> <SPAN class=SpellE><SPAN 
class=GramE>str</SPAN></SPAN>;<o:p></o:p></SPAN></P>
<P class=a0><SPAN lang=EN-US 
style="FONT-FAMILY: 'Times New Roman'"><o:p>&nbsp;</o:p></SPAN></P>
<P class=a0><SPAN class=GramE><SPAN lang=EN-US 
style="FONT-FAMILY: 'Times New Roman'">void</SPAN></SPAN><SPAN lang=EN-US 
style="FONT-FAMILY: 'Times New Roman'"> __<SPAN class=SpellE>fastcall</SPAN> 
TForm1::Button1Click(<SPAN class=SpellE>TObject</SPAN> 
*Sender)<o:p></o:p></SPAN></P>
<P class=a0><SPAN lang=EN-US 
style="FONT-FAMILY: 'Times New Roman'">{<o:p></o:p></SPAN></P>
<P class=a0><SPAN class=SpellE><SPAN lang=EN-US 
style="FONT-FAMILY: 'Times New Roman'">str</SPAN></SPAN><SPAN lang=EN-US 
style="FONT-FAMILY: 'Times New Roman'">=<SPAN 
class=SpellE>InputBox</SPAN>("</SPAN><SPAN 
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">平方计算器</SPAN><SPAN 
lang=EN-US style="FONT-FAMILY: 'Times New Roman'">","</SPAN><SPAN 
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">请输入原始数据:</SPAN><SPAN 
lang=EN-US style="FONT-FAMILY: 'Times New Roman'">","");<o:p></o:p></SPAN></P>
<P class=a0><SPAN lang=EN-US 
style="FONT-FAMILY: 'Times New Roman'">//</SPAN><SPAN 
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">显示一个输入对话框</SPAN><SPAN 
lang=EN-US style="FONT-FAMILY: 'Times New Roman'"><o:p></o:p></SPAN></P>
<P class=a0><SPAN lang=EN-US 
style="FONT-FAMILY: 'Times New Roman'">Edit1-&gt;Text=<SPAN class=SpellE><SPAN 
class=GramE>FloatToStr</SPAN></SPAN><SPAN class=GramE>(</SPAN><SPAN 
class=SpellE>StrToFloat</SPAN>(<SPAN class=SpellE>str</SPAN>)*<SPAN 
class=SpellE>StrToFloat</SPAN>(<SPAN 
class=SpellE>str</SPAN>));<o:p></o:p></SPAN></P>
<P class=a0><SPAN lang=EN-US 
style="FONT-FAMILY: 'Times New Roman'">//</SPAN><SPAN 
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">显示输入数据的平方值</SPAN><SPAN 
lang=EN-US style="FONT-FAMILY: 'Times New Roman'"><o:p></o:p></SPAN></P>
<P class=a0><SPAN lang=EN-US 
style="FONT-FAMILY: 'Times New Roman'">}<o:p></o:p></SPAN></P>
<H4><SPAN lang=EN-US>12</SPAN><SPAN 
style="FONT-FAMILY: 楷体_GB2312; mso-ascii-font-family: 'Times New Roman'">.运行程序</SPAN></H4>
<P class=MsoNormal><SPAN 
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">存储文件,运行程序,如图</SPAN><SPAN 
lang=EN-US>3-4</SPAN><SPAN 
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">(左)所示。然后单击“数据数据”按钮上,在窗体的上方就会出现一个如图</SPAN><SPAN 
lang=EN-US>3-4</SPAN><SPAN 
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">(右)所示的输入对话框。</SPAN></P>
<P class=a><SPAN lang=EN-US><IMG height=86 src="" width=199 
v:shapes="_x0000_i1028"><SPAN style="mso-spacerun: yes">&nbsp; </SPAN><SPAN 
style="mso-spacerun: yes">&nbsp;</SPAN><IMG height=85 
src="C++ Builder 程序设计实用教程 - 3_1_1 对话框函数简介 - 张晋 - 17xie.files/6237a55d66.jpg" 
width=186 v:shapes="_x0000_i1029"></SPAN></P>
<P class=MsoCaption><SPAN 
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">图</SPAN><SPAN 
lang=EN-US>3-4<SPAN style="mso-spacerun: yes">&nbsp; </SPAN></SPAN><SPAN 
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">输入对话框</SPAN></P>
<P class=MsoNormal><SPAN 
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">在输入对话框中输入一个正整数</SPAN><SPAN 
lang=EN-US>122</SPAN><SPAN 
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">,单击“</SPAN><SPAN 
lang=EN-US>OK</SPAN><SPAN 
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">”按钮,在程序运行的文本框中就会显示出</SPAN><SPAN 
lang=EN-US>122</SPAN><SPAN 
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的平方值,结果如图</SPAN><SPAN 
lang=EN-US>3-5</SPAN><SPAN 
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">所示。</SPAN></P>
<P class=a><SPAN lang=EN-US><IMG height=101 
src="C++ Builder 程序设计实用教程 - 3_1_1 对话框函数简介 - 张晋 - 17xie.files/44aa2e3717.jpg" 
width=233 v:shapes="_x0000_i1030"></SPAN></P>
<P class=MsoCaption><SPAN 
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">图</SPAN><SPAN 
lang=EN-US>3-5 <SPAN style="mso-spacerun: yes">&nbsp;</SPAN></SPAN><SPAN 
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">程序运行结果</SPAN></P>
<P class=MsoNormal><SPAN 
lang=EN-US><o:p>&nbsp;</o:p></SPAN></P></DIV></DIV></CENTER>
<HR>
<SPAN id=theurl 
style="FONT-SIZE: 12px">本页地址:http://www.17xie.com/read.php?pid=5530</SPAN> 
</DIV>
<DIV id=read-title style="BORDER-TOP: white 1px solid">
<DIV 
style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FLOAT: right; PADDING-BOTTOM: 8px; PADDING-TOP: 8px">
<TABLE>
  <TBODY>
  <TR>
    <TD><NOBR><SPAN class=page-nor 
      onclick="window.location.href='/read.php?bid=303&amp;seq=1'">|&lt;</SPAN> 
      <SPAN class=page-nor 
      onclick="window.location.href='/read.php?bid=303&amp;seq=22'">上一页</SPAN> 
      <SPAN class=page-nor 
      onclick="window.location.href='/read.php?bid=303&amp;seq=20'">20</SPAN> 
      <SPAN class=page-nor 
      onclick="window.location.href='/read.php?bid=303&amp;seq=21'">21</SPAN> 
      <SPAN class=page-nor 
      onclick="window.location.href='/read.php?bid=303&amp;seq=22'">22</SPAN> 
      <SPAN class=page-here 
      onclick="window.location.href='/read.php?bid=303&amp;seq=23'">23</SPAN> 
      <SPAN class=page-nor 
      onclick="window.location.href='/read.php?bid=303&amp;seq=24'">24</SPAN> 
      <SPAN class=page-nor 
      onclick="window.location.href='/read.php?bid=303&amp;seq=25'">25</SPAN> 
      <SPAN class=page-nor 
      onclick="window.location.href='/read.php?bid=303&amp;seq=26'">26</SPAN> 
      <SPAN class=page-nor 
      onclick="window.location.href='/read.php?bid=303&amp;seq=24'">下一页</SPAN> 
      <SPAN class=page-nor 
      onclick="window.location.href='/read.php?bid=303&amp;seq=105'">&gt;|</SPAN></NOBR>.</TD>
    <TD><INPUT class=input-text 
      onkeydown='if(window.event.keyCode==13)window.location.href="/read.php?bid=303&amp;seq="+this.value' 
      style="WIDTH: 25px"></TD>
    <TD style="PADDING-TOP: 2px">[共105页]</TD></TR></TBODY></TABLE></DIV></DIV>
<DIV id=read-mpage>
<DIV 
style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; PADDING-BOTTOM: 8px; PADDING-TOP: 8px; TEXT-ALIGN: center">[关注本页] 
[在本页中加入书签] [收藏本书] [推荐本书] </DIV></DIV><!-- foot -->
<DIV id=xie_bottom><A class=xie1 href="http://www.17xie.com/help/help-wzjs.html" 
target=_blank>关于我们</A> <SPAN class=xiefont1>| </SPAN><A class=xie1 
href="http://www.17xie.com/help/index.html" target=_blank>帮助中心</A> <SPAN 
class=xiefont1>| </SPAN><A class=xie1 
href="http://www.17xie.com/help/help-wzjs.html#m6" target=_blank>版权声明</A> <SPAN 
class=xiefont1>| </SPAN><A class=xie1 
href="http://www.17xie.com/help/help-wzjs.html#m7" target=_blank>免责声明</A> <SPAN 
class=xiefont1>| </SPAN><A class=xie1 
href="http://www.17xie.com/help/help-wzjs.html#m8" target=_blank>联系我们</A> <SPAN 
class=xiefont1>| </SPAN><A class=xie1 
href="http://www.17xie.com/help/help-wzjs.html#m9" target=_blank>友情链接</A> <SPAN 
class=xiefont1>| </SPAN><A class=xie1 
href="http://www.17xie.com/bbs/show_bbs.php?fid=130"><FONT 
color=red>提交意见</FONT></A> <BR>Copyright <SPAN 
style="FONT-FAMILY: arial">©</SPAN> 2007 17xie.com 互联网协同写书平台<BR>
<SCRIPT language=javascript 
src="C++ Builder 程序设计实用教程 - 3_1_1 对话框函数简介 - 张晋 - 17xie.files/1261343.js" 
type=text/javascript></SCRIPT>
<NOSCRIPT><A href="http://www.51.la/?1261343" target=_blank><IMG 
style="BORDER-TOP-STYLE: none; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BORDER-BOTTOM-STYLE: none" 
alt=我要啦免费统计 
src="C++ Builder 程序设计实用教程 - 3_1_1 对话框函数简介 - 张晋 - 17xie.files/go.htm"></A></NOSCRIPT> 
</DIV></DIV>
<SCRIPT>			setInterval("ajax_sr('/live.php','')",600000);			function chcolor(sz)			{				$('read-conts').style.backgroundColor = sz;			}						function clcp()			{				var rng = document.body.createTextRange();		        rng.moveToElementText(document.getElementById("theurl"));		        rng.execCommand("Copy");			}			document.body.onkeydown = clcp;			document.body.onmouseout = clcp;			document.body.onclick = clcp;					</SCRIPT>
</BODY></HTML>

⌨️ 快捷键说明

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