編輯模塊只實現了全選和時間
如果需要全部源碼的請留言或者發郵件至hen
版本
主要代碼如下
using System;
using System
using System
using System
using System
using System
using System
using System
namespace MyNotePad
{
public partial class MyNotePad : Form
{
public MyNotePad()
{
InitializeComponent();
this
}
private void textBox
{
//textBox
}
private void 退出ToolStripMenuItem_Click(object sender
{
Application
}
private void 日期ToolStripMenuItem_Click(object sender
{
if (this
{
this
}
else
{
this
}
}
private void timer
{
this
}
private void 狀態欄ToolStripMenuItem_Click(object sender
{
if (this
{
this
}
else
{
this
this
}
}
private void 關於MyNotePadAToolStripMenuItem_Click(object sender
{
About ab = new About();
ab
}
private void 全選ToolStripMenuItem_Click(object sender
{
this
}
private void 字體ToolStripMenuItem_Click(object sender
{
if (fontDialog
{
textBox
}
}
private void MyNotePad_Resize(object sender
{
this
this
this
this
}
private void 自動換行ToolStripMenuItem_Click(object sender
{
}
private void 保存ToolStripMenuItem_Click(object sender
{
using (SaveFileDialog saveDig = new SaveFileDialog())
{
saveDig
saveDig
if (saveDig
{
StreamWriter sw = new StreamWriter(saveDig
sw
sw
this
}
}
}
private void 另存為ToolStripMenuItem_Click(object sender
{
using (SaveFileDialog saveDig = new SaveFileDialog())
{
saveDig
saveDig
if (saveDig
{
StreamWriter sw = new StreamWriter(saveDig
sw
sw
}
}
}
private void 新建ToolStripMenuItem_Click(object sender
{
if (this
{
DialogResult d = MessageBox
想保存文件嗎?
switch (d)
{
case DialogResult
using (SaveFileDialog saveDig = new SaveFileDialog())
{
saveDig
saveDig
if (saveDig
{
StreamWriter sw = new StreamWriter(saveDig
sw
sw
this
}
}
break;
case DialogResult
this
break;
case DialogResult
break;
default: System
break;
}
}
}
private void 打開ToolStripMenuItem_Click(object sender
{
if (this
{
DialogResult d = MessageBox
想保存文件嗎?
switch (d)
{
case DialogResult
using (SaveFileDialog saveDig = new SaveFileDialog())
{
saveDig
saveDig
if (saveDig
{
StreamWriter sw = new StreamWriter(saveDig
sw
sw
this
}
}
break;
case DialogResult
this
break;
case DialogResult
break;
default: System
break;
}
}
else
{
using (OpenFileDialog dlgText = new OpenFileDialog())
{
dlgText
if (dlgText
{
if (File
{
StreamReader rStream = new StreamReader(dlgText
string s=default(string);
this
while ((s = rStream
{
this
}
rStream
}
}
}
}
}
private void MyNotePad_FormClosing(object sender
{
if (this
{
DialogResult d = MessageBox
想保存文件嗎?
switch (d)
{
case DialogResult
using (SaveFileDialog saveDig = new SaveFileDialog())
{
saveDig
saveDig
if (saveDig
{
StreamWriter sw = new StreamWriter(saveDig
sw
sw
this
}
}
break;
case DialogResult
break;
case DialogResult
break;
default: System
break;
}
}
}
}
}
From:http://tw.wingwit.com/Article/program/net/201311/11890.html