private void BtnOption_Click(object sender, EventArgs e) { // Selectes Button Options if (BtnOption.Text == "Open") { // Open File Routine DirectoryInfo dinfo = new DirectoryInfo(SysDir); String FileFound = dinfo + LBxListMyFiles.SelectedItem.ToString(); RTxWritingPad.LoadFile(FileFound, RichTextBoxStreamType.RichText); RTPreview.Clear(); } else if (BtnOption.Text == "Save") { // Save File Routine DirectoryInfo dinfo = new DirectoryInfo(SysDir); String FileFound = dinfo + TBxFilename.Text + ".rtf"; filescan.Add(Path.GetFileName(FileFound)); RTxWritingPad.SaveFile(FileFound, RichTextBoxStreamType.RichText); SubUpdateDisplay(); } else if (BtnOption.Text == "Delete") { // Delete File Routine DirectoryInfo dinfo = new DirectoryInfo(SysDir); String FileFound = dinfo + LBxListMyFiles.SelectedItem.ToString(); filescan.RemoveAt(LBxListMyFiles.SelectedIndex); File.Delete(FileFound); RTPreview.Clear(); SubUpdateDisplay(); } }
private void Form1_Load(object sender, EventArgs e) { LblFilename.Visible = false; TBxFilename.Visible = false; button1.Enabled = true; button2.Enabled = true; button2.ForeColor = Color.White; // Checks For Directory if (Directory.Exists(SysDir)) { SubCheckForFiles(); SubLoadFontAndColourSettings(); this.Show(); RTxWritingPad.Focus(); } else { // Creates A Directory Directory.CreateDirectory(SysDir); this.Show(); RTxWritingPad.Focus(); } }
private void selectAllToolStripMenuItem_Click(object sender, EventArgs e) { // Highlights Selected RTxWritingPad.SelectAll(); }
private void pasteToolStripMenuItem_Click(object sender, EventArgs e) { // Pastes Selected Text RTxWritingPad.Paste(); }
private void cutToolStripMenuItem_Click(object sender, EventArgs e) { // Cut Selected Text RTxWritingPad.Cut(); }
private void copyToolStripMenuItem_Click(object sender, EventArgs e) { // Copy Selected Text RTxWritingPad.Copy(); }
private void newToolStripMenuItem_Click(object sender, EventArgs e) { // Clears WrittingPad RTxWritingPad.Clear(); }
private void selectAllToolStripMenuItem1_Click(object sender, EventArgs e) { // Context Highlight All Text RTxWritingPad.SelectAll(); }
private void pasteToolStripMenuItem1_Click(object sender, EventArgs e) { // Context Paste Text RTxWritingPad.Paste(); }