SHARE
TWEET

Untitled

a guest Jun 26th, 2019 55 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. private void BtnOpenFile_Click(object sender, RoutedEventArgs e)
  2. {
  3.     OpenFileDialog dlg = new OpenFileDialog();
  4.     dlg.Filter = "Rich Text Format (*.rtf)|*.rtf|All files (*.*)|*.*";
  5.     if (dlg.ShowDialog() == true)
  6.     {
  7.         FileStream fileStream = new FileStream(dlg.FileName, FileMode.Open);
  8.         TextRange range = new TextRange(mainRTB.Document.ContentStart, mainRTB.Document.ContentEnd);
  9.         range.Load(fileStream, DataFormats.Rtf);
  10.     }
  11. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top