Beispiel #1
0
 // Creat new doc
 private void newArchFomr()
 {
     using (ArchForm1 newArch = new ArchForm1())
     {
         fileName            = "";
         statusFileName.Text = "Untitled.txt";
         newArch.Show();
         ArchRichBox.ForeColor = Color.FromArgb(65, 65, 65);
         ArchRichBox.Font      = new Font("Microsoft Sans", 12, FontStyle.Regular);
         ArchRichBox.Clear();
     }
 }
Beispiel #2
0
 // Open new file
 private void openToolStripMenuItem_Click(object sender, EventArgs e)
 {
     try
     {
         using (OpenFileDialog opnFile = new OpenFileDialog())
         {
             if (opnFile.ShowDialog() == DialogResult.OK)
             {
                 if (File.Exists(opnFile.FileName) == true)
                 {
                     fileName            = opnFile.FileName;
                     statusFileName.Text = fileName;
                     StreamReader archReader = new StreamReader(opnFile.FileName);
                     string       line       = archReader.ReadLine();
                     ArchRichBox.Text = line;
                     ArchRichBox.AppendText(archReader.ReadToEnd());
                     archReader.Close();
                 }
                 else
                 {
                     MessageBox.Show("There is no such file!", "Error reading file!", MessageBoxButtons.OK,
                                     MessageBoxIcon.Asterisk);
                 }
             }
         }
     }
     catch (FileLoadException)
     {
         MessageBox.Show("Cannot load file..", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
     catch (FileNotFoundException)
     {
         MessageBox.Show("File missing...", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
     catch (IOException)
     {
         MessageBox.Show("Oops something went wrong...", "Oops..", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
Beispiel #3
0
 //redo
 private void toolStripMenuItem3_Click(object sender, EventArgs e)
 {
     ArchRichBox.Redo();
 }
Beispiel #4
0
 private void pasteToolStripMenuItem_Click(object sender, EventArgs e)
 {
     ArchRichBox.Paste();
 }
Beispiel #5
0
 private void copyToolStripMenuItem_Click(object sender, EventArgs e)
 {
     ArchRichBox.Copy();
 }
Beispiel #6
0
 private void undoToolStripMenuItem_Click(object sender, EventArgs e)
 {
     ArchRichBox.Undo();
 }