📄 c++ builder 程序设计实用教程 - 附程序完整的源代码如 - 张晋 - 17xie.htm
字号:
(Form1->Memo1->SelText!="")<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><SPAN
style="mso-spacerun: yes">
</SPAN>Form1->Memo1->PasteFromClipboard();<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'"><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>}<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::Delete1Click(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>Form1->Memo1->ClearSelection();<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::SelectAll1Click(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>Form1->Memo1->SelectAll();<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'"><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>}<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::Left1Click(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>Form1->Memo1->Alignment=taLeftJustify;<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::Center1Click(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>Form1->Memo1->Alignment=taCenter;<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::Right1Click(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>Form1->Memo1->Alignment=taRightJustify;<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::Bold1Click(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>Form1->Bold1->Checked=!
Form1->Bold1->Checked;<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><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>if
(Form1->Bold1->Checked)<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>Form1->Memo1->Font->Style=Form1->Memo1->Font->Style<<fsBold;<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>else<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->Memo1->Font->Style=Form1->Memo1->Font->Style>>fsBold;<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::Italic1Click(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>Form1->Italic1->Checked=!
Form1->Italic1->Checked;<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><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>if
(Form1->Italic1->Checked)<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 + -