Example #1
0
 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();
     }
 }
Example #2
0
        private void SubCheckSelectedFile()
        {
            // Loads Selected File
            DirectoryInfo dinfo     = new DirectoryInfo(SysDir);
            String        FileFound = dinfo + LBxListMyFiles.SelectedItem.ToString();

            RTPreview.LoadFile(FileFound, RichTextBoxStreamType.RichText);
        }