windos文本编辑器的问题~看代码
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.IO;
using System.Windows.Forms;
namespace Simple_Editor
{
public partial class SimpleEditorForm : Form
{
public string filename = "untitled ";
public SimpleEditorForm()
{
InitializeComponent();
}
private void OnFileNew_Click(object sender, EventArgs e)
{
filename = "untitled ";
textBox1.Clear();
}
private void OnFileOpen_Click(object sender, EventArgs e)
{
if (dlgOpenFile.ShowDialog() == DialogResult.OK)
{
filename = dlgOpenFile.FileName;
OpenFile();
}
}
}
}
这个时候提示OpenFile not exit in the current txtcontent..
怎么办啊。。。。我是照着书上做的啊:P
------解决方案--------------------OpenFile()显然是个自己写的代码段,你敲得代码应该少了一段