private void nEWToolStripMenuItem_Click(object sender, EventArgs e)
        {
            richTextBoxText.Text = "";
        }        private void MenuItemSave_Click(object sender, EventArgs e)
        {
            try
            {
                richTextBoxText.SaveFile(@".Example.rtf");            }
            catch
            { 
            }
        }        private void MenuItemOpen_Click(object sender, EventArgs e)
        {
            try
            {
                              richTextBoxText.LoadFile(@".\Example.rtf");            }
            catch
            { }
        }自定义了个菜单 想实现清除 打开临时文件 还是存储功能。
清除功能实现了 可保存和打开点了没反应 代码如上 大家看看是什么问题呢

解决方案 »

  1.   

    private void MenuItemSave_Click(object sender, EventArgs e) 
            { 
                try 
                { 
                    richTextBoxText.SaveFile(@".Example.rtf");             } 
                catch 
                { 
                } 
            } 保存的文件名有问题,少了个\,所以出错,但try...catch隐藏了错误
    打开时该文件没有,出错,但try...catch隐藏了错误
    建议在Catch中增加一个messagebox.show(ex.message),会捕捉到错误的