关于保存字体颜色
我用C#写了一个记事本程序,存储文字用的控件是RICHTEXTBOX,
在程序里能改变文字的字体,但是为什么保存了自后再打开的话
文字字体就又变成了默认的??颜色也变成了黑色,
还有就是,怎么样像WORD似的,能把图片插入到文档里,然后能够实现保存??
小弟新手,请高手解答 谢谢了
//打开文件
public void OpenFile()
{
this.openFileDialog1.Filter = "*.abc|*.abc|*.sql|*.sql ";
this.openFileDialog1.AddExtension = true;
this.openFileDialog1.DefaultExt = "*.abc ";
this.openFileDialog1.FileName = "*.abc ";
this.openFileDialog1.ValidateNames = true;
this.openFileDialog1.CheckFileExists = true;
this.openFileDialog1.CheckPathExists = true;
if (this.openFileDialog1.ShowDialog() == DialogResult.OK) //判断是否确定打开文件
{
this.txtBox.LoadFile(this.openFileDialog1.FileName, RichTextBoxStreamType.PlainText); //打开文件
}
path = openFileDialog1.FileName.ToString();
str = this.txtBox.Text.ToString();
}
private void 另存为ToolStripMenuItem_Click(object sender, EventArgs e)
{
Stream st = null;
StreamWriter sw = null;
try
{
this.saveFileDialog1.Filter = "*.abc|*.abc|*.sql|*.sql ";
this.saveFileDialog1.AddExtension = true;
//this.saveFileDialog1.CheckFileExists = true;
&n