Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private void BtnOpenFile_Click(object sender, RoutedEventArgs e)
- {
- OpenFileDialog dlg = new OpenFileDialog();
- dlg.Filter = "Rich Text Format (*.rtf)|*.rtf|All files (*.*)|*.*";
- if (dlg.ShowDialog() == true)
- {
- FileStream fileStream = new FileStream(dlg.FileName, FileMode.Open);
- TextRange range = new TextRange(mainRTB.Document.ContentStart, mainRTB.Document.ContentEnd);
- range.Load(fileStream, DataFormats.Rtf);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement