📄 c++ builder 程序设计实用教程 - 程序完整源代码如下所 - 张晋 - 17xie.htm
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd">
<!-- saved from url=(0044)http://www.17xie.com/read.php?bid=303&seq=74 -->
<HTML xmlns:o = "urn:schemas-microsoft-com:office:office"><HEAD><TITLE>C++ Builder 程序设计实用教程 - 程序完整源代码如下所 - 张晋 - 17xie</TITLE>
<META http-equiv=Content-Type content="text/html; charset=utf-8"><LINK
href="C++ Builder 程序设计实用教程 - 程序完整源代码如下所 - 张晋 - 17xie.files/17xie.css"
type=text/css rel=stylesheet><LINK
href="C++ Builder 程序设计实用教程 - 程序完整源代码如下所 - 张晋 - 17xie.files/read.css"
type=text/css rel=stylesheet>
<SCRIPT src="C++ Builder 程序设计实用教程 - 程序完整源代码如下所 - 张晋 - 17xie.files/core.js"
type=text/javascript></SCRIPT>
<SCRIPT src="C++ Builder 程序设计实用教程 - 程序完整源代码如下所 - 张晋 - 17xie.files/iframe.js"
type=text/javascript></SCRIPT>
<SCRIPT src="C++ Builder 程序设计实用教程 - 程序完整源代码如下所 - 张晋 - 17xie.files/dialog.js"
type=text/javascript></SCRIPT>
<SCRIPT src="C++ Builder 程序设计实用教程 - 程序完整源代码如下所 - 张晋 - 17xie.files/ajax.js"
type=text/javascript></SCRIPT>
<SCRIPT src="C++ Builder 程序设计实用教程 - 程序完整源代码如下所 - 张晋 - 17xie.files/cookie.js"
type=text/javascript></SCRIPT>
<META content="MSHTML 6.00.2900.3020" name=GENERATOR></HEAD>
<BODY>
<DIV id=m-body>
<DIV id=read-top>
<DIV style="FLOAT: left"><A href="http://www.17xie.com/" target=_blank><IMG
src="C++ Builder 程序设计实用教程 - 程序完整源代码如下所 - 张晋 - 17xie.files/booklogo.gif"></A></DIV>
<DIV id=read-menu><NOBR><A
onclick="APIframe.open('快速登录','/m/user/poplogin.php',400,160)"
href="javascript:void(0)">登录</A> <A
onclick="APIframe.open('17xie-快速注册','/m/user/reg.php',480,460)"
href="javascript:void(0)">注册</A> | <A href="http://www.17xie.com/"
target=_blank>首页</A> <A href="http://www.17xie.com/bbs/index.php?ishow=y"
target=_blank>论坛</A> <A href="http://www.17xie.com/user.php"
target=_blank>会员中心</A> <A href="http://www.17xie.com/help/"
target=_blank>帮助</A></NOBR></DIV></DIV>
<DIV id=read-title>
<DIV
style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FLOAT: left; PADDING-BOTTOM: 8px; PADDING-TOP: 8px"><A
href="http://www.17xie.com/" target=_blank>17xie</A> > <A
href="http://www.17xie.com/book.php?bid=303">C++ Builder 程序设计实用教程</A> >
程序完整源代码如下所</DIV>
<DIV
style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FLOAT: right; PADDING-BOTTOM: 0px; PADDING-TOP: 4px"><INPUT class=button-red8 onclick="window.location.href='/m/book/write.php?pid=5580'" type=button value=点击编辑本页></DIV></DIV>
<DIV id=read-mpage>
<DIV
style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FLOAT: left; PADDING-BOTTOM: 8px; PADDING-TOP: 8px">背景:
<SPAN class=chcolor style="BACKGROUND-COLOR: #eeeeff"
onclick="chcolor('#eeeeff')"> </SPAN> <SPAN class=chcolor
style="BACKGROUND-COLOR: #ffeeee"
onclick="chcolor('#ffeeee')"> </SPAN> <SPAN class=chcolor
style="BACKGROUND-COLOR: #eeffee"
onclick="chcolor('#eeffee')"> </SPAN> <SPAN class=chcolor
style="BACKGROUND-COLOR: #ffffee"
onclick="chcolor('#ffffee')"> </SPAN> <SPAN class=chcolor
style="BACKGROUND-COLOR: #eeeeee"
onclick="chcolor('#eeeeee')"> </SPAN> <SPAN class=chcolor
style="BACKGROUND-COLOR: #ffffff"
onclick="chcolor('#ffffff')"> </SPAN> </DIV>
<DIV
style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FLOAT: right; PADDING-BOTTOM: 0px; PADDING-TOP: 3px">
<TABLE>
<TBODY>
<TR>
<TD><NOBR><SPAN class=page-nor
onclick="window.location.href='/read.php?bid=303&seq=1'">|<</SPAN>
<SPAN class=page-nor
onclick="window.location.href='/read.php?bid=303&seq=73'">上一页</SPAN>
<SPAN class=page-nor
onclick="window.location.href='/read.php?bid=303&seq=71'">71</SPAN>
<SPAN class=page-nor
onclick="window.location.href='/read.php?bid=303&seq=72'">72</SPAN>
<SPAN class=page-nor
onclick="window.location.href='/read.php?bid=303&seq=73'">73</SPAN>
<SPAN class=page-here
onclick="window.location.href='/read.php?bid=303&seq=74'">74</SPAN>
<SPAN class=page-nor
onclick="window.location.href='/read.php?bid=303&seq=75'">75</SPAN>
<SPAN class=page-nor
onclick="window.location.href='/read.php?bid=303&seq=76'">76</SPAN>
<SPAN class=page-nor
onclick="window.location.href='/read.php?bid=303&seq=77'">77</SPAN>
<SPAN class=page-nor
onclick="window.location.href='/read.php?bid=303&seq=75'">下一页</SPAN>
<SPAN class=page-nor
onclick="window.location.href='/read.php?bid=303&seq=105'">>|</SPAN></NOBR>.</TD>
<TD><INPUT class=input-text
onkeydown='if(window.event.keyCode==13)window.location.href="/read.php?bid=303&seq="+this.value'
style="WIDTH: 25px"></TD>
<TD style="PADDING-TOP: 2px">[共105页]</TD></TR></TBODY></TABLE></DIV></DIV>
<DIV id=read-conts style="BACKGROUND-COLOR: #ffffff"><SPAN
style="FONT-SIZE: 12px">本页字数:4761 最后更新:<NOBR>12天以前</NOBR>
<NOBR>[11-30 13:05]</NOBR> 由 <A onclick='$showu(1271,"张晋")'
href="javascript:void(0)">张晋</A> 编辑 <A class=aline
style="COLOR: red" href="http://www.17xie.com/m/user/inviter_reg.php"
target=_blank>注册17xie 一起来写书 实现您的出书梦想!</A></SPAN>
<HR>
<CENTER>
<DIV style="WIDTH: 547px; TEXT-ALIGN: left">
<P class=MsoNormalIndent style="MARGIN: 0cm 0cm 0pt"><SPAN
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">程序完整源代码如下所示:</SPAN></P>
<DIV
style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 0cm; BORDER-TOP: windowtext 1pt solid; PADDING-LEFT: 0cm; PADDING-BOTTOM: 1pt; BORDER-LEFT: windowtext 1pt solid; PADDING-TOP: 1pt; BORDER-BOTTOM: windowtext 1pt solid; mso-border-shadow: yes; mso-element: para-border-div">
<P class=a
style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0cm; BORDER-TOP: medium none; PADDING-LEFT: 0cm; PADDING-BOTTOM: 0cm; MARGIN: 6pt 0cm 12pt; BORDER-LEFT: medium none; PADDING-TOP: 0cm; BORDER-BOTTOM: medium none; mso-border-shadow: yes; mso-padding-alt: 1.0pt 0cm 1.0pt 0cm; mso-border-alt: solid windowtext 1.0pt"><SPAN
style="FONT-FAMILY: 仿宋_GB2312; mso-ascii-font-family: 'Times New Roman'">程序清单</SPAN><SPAN
lang=EN-US
style="FONT-SIZE: 9pt; mso-bidi-font-size: 10.0pt"><o:p></o:p></SPAN></P></DIV>
<P class=a0 style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US
style="FONT-FAMILY: 'Times New Roman'"><FONT
size=2>//-----------------------------------------------------------------------<o:p></o:p></FONT></SPAN></P>
<P class=a0 style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US
style="FONT-FAMILY: 'Times New Roman'"><FONT size=2>#include
<vcl.h><o:p></o:p></FONT></SPAN></P>
<P class=a0 style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US
style="FONT-FAMILY: 'Times New Roman'"><FONT size=2>#pragma
hdrstop<o:p></o:p></FONT></SPAN></P>
<P class=a0 style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US
style="FONT-FAMILY: 'Times New Roman'"><o:p><FONT
size=2> </FONT></o:p></SPAN></P>
<P class=a0 style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US
style="FONT-FAMILY: 'Times New Roman'"><FONT size=2>#include
"SQL.h"<o:p></o:p></FONT></SPAN></P>
<P class=a0 style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US
style="FONT-FAMILY: 'Times New Roman'"><FONT
size=2>//-----------------------------------------------------------------------<o:p></o:p></FONT></SPAN></P>
<P class=a0 style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US
style="FONT-FAMILY: 'Times New Roman'"><FONT size=2>#pragma
package(smart_init)<o:p></o:p></FONT></SPAN></P>
<P class=a0 style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US
style="FONT-FAMILY: 'Times New Roman'"><o:p><FONT
size=2> </FONT></o:p></SPAN></P>
<P class=a0 style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US
style="FONT-FAMILY: 'Times New Roman'"><FONT size=2>#pragma resource
"*.dfm"<o:p></o:p></FONT></SPAN></P>
<P class=a0 style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US
style="FONT-FAMILY: 'Times New Roman'"><FONT size=2>TForm1
*Form1;<o:p></o:p></FONT></SPAN></P>
<P class=a0 style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US
style="FONT-FAMILY: 'Times New Roman'"><FONT size=2>TBookmark
SavePlace;<o:p></o:p></FONT></SPAN></P>
<P class=a0 style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US
style="FONT-FAMILY: 'Times New Roman'"><FONT
size=2>//-----------------------------------------------------------------------<o:p></o:p></FONT></SPAN></P>
<P class=a0 style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US
style="FONT-FAMILY: 'Times New Roman'"><o:p><FONT
size=2> </FONT></o:p></SPAN></P>
<P class=a0 style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US
style="FONT-FAMILY: 'Times New Roman'"><FONT size=2>__fastcall
TForm1::TForm1(TComponent* Owner)<o:p></o:p></FONT></SPAN></P>
<P class=a0 style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US
style="FONT-FAMILY: 'Times New Roman'"><FONT size=2><SPAN
style="mso-spacerun: yes"> </SPAN>:
TForm(Owner)<o:p></o:p></FONT></SPAN></P>
<P class=a0 style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US
style="FONT-FAMILY: 'Times New Roman'"><FONT
size=2>{<o:p></o:p></FONT></SPAN></P>
<P class=a0 style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US
style="FONT-FAMILY: 'Times New Roman'"><FONT
size=2>}<o:p></o:p></FONT></SPAN></P>
<P class=a0 style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US
style="FONT-FAMILY: 'Times New Roman'"><FONT
size=2>//-----------------------------------------------------------------------<o:p></o:p></FONT></SPAN></P>
<P class=a0 style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US
style="FONT-FAMILY: 'Times New Roman'"><o:p><FONT
size=2> </FONT></o:p></SPAN></P>
<P class=a0 style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US
style="FONT-FAMILY: 'Times New Roman'"><FONT size=2>void __fastcall
TForm1::Button9Click(TObject *Sender)<o:p></o:p></FONT></SPAN></P>
<P class=a0 style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US
style="FONT-FAMILY: 'Times New Roman'"><FONT
size=2>{<o:p></o:p></FONT></SPAN></P>
<P class=a0 style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US
style="FONT-FAMILY: 'Times New Roman'"><FONT size=2><SPAN
style="mso-spacerun: yes">
</SPAN>SavePlace=Form1->Query1->GetBookmark();<o:p></o:p></FONT></SPAN></P>
<P class=a0 style="MARGIN: 0cm 0cm 0pt"><FONT size=2><SPAN lang=EN-US
style="FONT-FAMILY: 'Times New Roman'"><SPAN
style="mso-spacerun: yes"> </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'"><o:p></o:p></SPAN></FONT></P>
<P class=a0 style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US
style="FONT-FAMILY: 'Times New Roman'"><FONT
size=2>}<o:p></o:p></FONT></SPAN></P>
<P class=a0 style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US
style="FONT-FAMILY: 'Times New Roman'"><FONT
size=2>//-----------------------------------------------------------------------<o:p></o:p></FONT></SPAN></P>
<P class=a0 style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US
style="FONT-FAMILY: 'Times New Roman'"><o:p><FONT
size=2> </FONT></o:p></SPAN></P>
<P class=a0 style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US
style="FONT-FAMILY: 'Times New Roman'"><FONT size=2>void __fastcall
TForm1::Button10Click(TObject *Sender)<o:p></o:p></FONT></SPAN></P>
<P class=a0 style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US
style="FONT-FAMILY: 'Times New Roman'"><FONT
size=2>{<o:p></o:p></FONT></SPAN></P>
<P class=a0 style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US
style="FONT-FAMILY: 'Times New Roman'"><FONT size=2>if
(SavePlace!="")<o:p></o:p></FONT></SPAN></P>
<P class=a0 style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US
style="FONT-FAMILY: 'Times New Roman'"><FONT size=2><SPAN
style="mso-spacerun: yes"> </SPAN>{<o:p></o:p></FONT></SPAN></P>
<P class=a0 style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US
style="FONT-FAMILY: 'Times New Roman'"><FONT size=2><SPAN
style="mso-spacerun: yes">
</SPAN>Form1->Query1->GotoBookmark(SavePlace);<o:p></o:p></FONT></SPAN></P>
<P class=a0 style="MARGIN: 0cm 0cm 0pt"><FONT size=2><SPAN lang=EN-US
style="FONT-FAMILY: 'Times New Roman'"><SPAN
style="mso-spacerun: yes"> </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'"><o:p></o:p></SPAN></FONT></P>
<P class=a0 style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US
style="FONT-FAMILY: 'Times New Roman'"><FONT size=2><SPAN
style="mso-spacerun: yes"> </SPAN>}<o:p></o:p></FONT></SPAN></P>
<P class=a0 style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US
style="FONT-FAMILY: 'Times New Roman'"><FONT
size=2>}<o:p></o:p></FONT></SPAN></P>
<P class=a0 style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US
style="FONT-FAMILY: 'Times New Roman'"><FONT
size=2>//-----------------------------------------------------------------------<o:p></o:p></FONT></SPAN></P>
<P class=a0 style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US
style="FONT-FAMILY: 'Times New Roman'"><o:p><FONT
size=2> </FONT></o:p></SPAN></P>
<P class=a0 style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US
style="FONT-FAMILY: 'Times New Roman'"><FONT size=2>void __fastcall
TForm1::Query1BeforeClose(TDataSet *DataSet)<o:p></o:p></FONT></SPAN></P>
<P class=a0 style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US
style="FONT-FAMILY: 'Times New Roman'"><FONT
size=2>{<o:p></o:p></FONT></SPAN></P>
<P class=a0 style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US
style="FONT-FAMILY: 'Times New Roman'"><FONT size=2>if
(Form1->Query1->Modified)<o:p></o:p></FONT></SPAN></P>
<P class=a0 style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US
style="FONT-FAMILY: 'Times New Roman'"><FONT size=2><SPAN
style="mso-spacerun: yes"> </SPAN>{<o:p></o:p></FONT></SPAN></P>
<P class=a0 style="MARGIN: 0cm 0cm 0pt"><FONT size=2><SPAN lang=EN-US
style="FONT-FAMILY: 'Times New Roman'"><SPAN
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -