Expand|Select|Wrap|Line Numbers
- Dim openFile1 As New OpenFileDialog()
- If DiscardChanges() Then
- Me.UseWaitCursor = True
- ' Initialize the OpenFileDialog to look for RTF files.
- openFile1.DefaultExt = "*.rtf"
- openFile1.Filter = "RTF Files|*.rtf|Doc Files|*.DOC|" & _
- "Text Files|*.txt|All Flies|*.*"
- ' Determine whether the user selected a file from the OpenFileDialog.
- If (openFile1.ShowDialog() = System.Windows.Forms.DialogResult.OK) _
- And (openFile1.FileName.Length > 0) Then
- ' Load the contents of the file into the RichTextBox.
- RichTextBox1.LoadFile(openFile1.FileName, _
- RichTextBoxStreamType.RichText)
- RichTextBox1.Modified = False
- fName = openFile1.FileName
- End If
- End If
- Me.UseWaitCursor = False