NeonFox__

Save Dialog Button

May 16th, 2020
2,375
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. FastColoredTextBox textBox = TabControl1.SelectedTab.Controls.Find(("ClonedTextBox"), true).FirstOrDefault() as FastColoredTextBox;
  2.  
  3. -- save dialog button:
  4.  
  5. SaveFileDialog sfd = new SaveFileDialog();
  6. sfd.Filter = "Txt Files (*.txt)|*.txt|Lua Files (*.lua)|*.lua|All Files (*.*)|*.*";
  7. if (sfd.ShowDialog() == DialogResult.OK)
  8. {
  9. Stream s = sfd.OpenFile();
  10. StreamWriter sw = new StreamWriter(s);
  11. sw.Write(textBox.Text);
  12. sw.Close();
  13. }
Add Comment
Please, Sign In to add comment