Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions TextDocumentEditor/Form1.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

30 changes: 30 additions & 0 deletions TextDocumentEditor/Form1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -107,5 +107,35 @@ private void openFileToolStripMenuItem_Click(object sender, EventArgs e)
}
}
}

//Additions

private void CreateNew_Click(object sender, EventArgs e)
{
childDialogs.Add(new InnerForm(this));
childDialogs[childDialogs.Count - 1].Show();
}

private void Open_Click(object sender, EventArgs e)
{
if (openFileDialog.ShowDialog() == System.Windows.Forms.DialogResult.OK &&
openFileDialog.FileName.Length > 0)
{
childDialogs.Add(new InnerForm(this));
childDialogs[childDialogs.Count - 1].Show();

switch (saveFileDialog.FilterIndex)
{
case 1:
childDialogs[childDialogs.Count - 1].OpenFile(openFileDialog.FileName, RichTextBoxStreamType.PlainText);
break;

case 2:
childDialogs[childDialogs.Count - 1].OpenFile(openFileDialog.FileName, RichTextBoxStreamType.RichText);
break;
}
}
}

}
}