这是我打开新文件的代码:
private void openToolStripMenuItem_Click(object sender, EventArgs e)
{
OpenFileDialog openFD = new OpenFileDialog();
string Chosen_File = "";
openFD.InitialDirectory = "C:";
openFD.Title = "Open a Text File";
openFD.FileName = "";
openFD.Filter = "Text Files|*.txt|Word Documents|*.doc";
if (openFD.ShowDialog() != DialogResult.Cancel)
{
Chosen_File = openFD.FileName;
GetRichTextBox().LoadFile(Chosen_File, RichTextBoxStreamType.PlainText);
}
我也在使用标签。我只能在打开选项卡时打开文件。如何将其设置为使用该文件打开一个新选项卡?它仅在我打开选项卡然后打开文件时才有效。