C程序写字板Word格式文档下载.docx
- 文档编号:167710
- 上传时间:2023-04-28
- 格式:DOCX
- 页数:16
- 大小:16.33KB
C程序写字板Word格式文档下载.docx
《C程序写字板Word格式文档下载.docx》由会员分享,可在线阅读,更多相关《C程序写字板Word格式文档下载.docx(16页珍藏版)》请在冰点文库上搜索。
=-1;
i++)
}
}
privatevoidForm1_Load(objectsender,EventArgse)
ilter="
文本文件(*.txt)|*.txt|RTF文档|*.rtf|所有文件|*.*"
;
if(打开.ShowDialog()==
stringfn=打开.FileName;
stringext=(fn);
xt"
)
(@fn,;
elseif()=="
.rtf"
else
("
系统不支持该类型文件!
"
"
写字板"
);
privatevoid保存SToolStripMenuItem_Click(objectsender,EventArgse)
SaveFileDialogsaveFileDialog1=newSaveFileDialog();
if==true)
="
保存"
*.txt"
xt|所有文档|*.*"
if()==
stringfn=;
(fn,;
=false;
=+"
-写字板"
;
privatevoid另存为ToolStripMenuItem_Click(objectsender,EventArgse)
另存为"
文本文档(*.txt)|*.txt|所有文档|*.*"
StreamWritersw=newStreamWriter;
(richTextBox1);
();
privatevoid打印PToolStripMenuItem_Click(objectsender,EventArgse)
if<
1)
请确保要查找的文件的内容不为空!
提示"
return;
PrintDialogprint=newPrintDialog();
DialogResultresult=();
privatevoid退出XToolStripMenuItem_Click(objectsender,EventArgse)
if!
="
保存SToolStripMenuItem_Click(sender,e);
etDataPresent)
this.粘贴=true;
this.粘贴=false;
isible=false;
工具栏=true;
工具栏.Visible=true;
privatevoid格式栏FToolStripMenuItem_Click(objectsender,EventArgse)
if(格式栏
格式栏=false;
格式栏.Visible=false;
格式栏=true;
格式栏.Visible=true;
privatevoid状态栏SToolStripMenuItem_Click(objectsender,EventArgse)
if(状态栏
状态栏=false;
状态栏.Visible=false;
状态栏=true;
状态栏.Visible=true;
ont=;
字体.Color=;
if(字体.ShowDialog()==
if>
0)
=字体.Font;
=字体.Color;
privatevoid颜色CToolStripMenuItem_Click(objectsender,EventArgse)
颜色.Color=;
if(颜色.ShowDialog()==
=颜色.Color;
this.剪切=true;
this.剪切=false;
//根据选择区域不为空,则复制、剪切、删除可用,否则不可用
复制=true;
剪切=true;
删除=true;
复制=false;
剪切=false;
删除=false;
//如果写字板内容不为空,则全选可用,否则不可用
全选=true;
全选=false;
///<
summary>
///窗体关闭按钮
/summary>
paramname="
sender"
>
<
/param>
e"
privatevoidForm1_FormClosing(objectsender,FormClosingEventArgse)
DialogResultr;
r=("
您是不要将更改保存到文档吗"
,;
if(r==
=true;
elseif(r==
///在状态栏显示鼠标位置
privatevoidrichTextBox1_MouseMove(objectsender,MouseEventArgse)
所在位置:
++"
"
+;
}
区分大小写、方向用不了)
查找窗体代码:
usingNOTEBOOK
publicpartialclassFind:
intp=0;
publicFind()
privatevoidtextBox1_TextChanged(objectsender,EventArgse)
if=="
else
privatevoidbutton1_Click(objectsender,EventArgse)
Form1fmain=(Form1);
p=if(p!
=-1)
p++;
已查找到文档尾!
,;
p=0;
privatevoidFind_FormClosing(objectsender,FormClosingEventArgse)
privatevoidbutton2_Click(objectsender,EventArgse)
那个区分大小写用不了)
publicpartialclassreplace:
intp=0;
boolthflag=false;
publicreplace()
{
Form1fmain=(Form1);
=0;
//查找下一个(未完善)
p=p);
if(p!
//替换
=;
已替换完!
“"
++"
”!
privatevoidbutton3_Click(objectsender,EventArgse)
//全部替换
intl=+if(l!
thflag=true;
if(thflag==true)
替换完毕!
替换内容不存在,请重新输入!
privatevoidreplace_FormClosing(objectsender,FormClosingEventArgse)
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 程序 写字板