Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Private Sub loadButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles loadButton.Click
- ' Displays an OpenFileDialog so the user can select a Cursor.
- Dim openFileDialog1 As New OpenFileDialog()
- openFileDialog1.Filter = "Cursor Files|*.txt"
- openFileDialog1.Title = "Select a Cursor File"
- If openFileDialog1.ShowDialog() = System.Windows.Forms.DialogResult.OK Then
- ' Assign the cursor in the Stream to the Form's Cursor property.
- Me.mainRTBox = New Text(openFileDialog1.OpenFile())
- End If
- End Sub
- Public Class Form1
- Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
- ' Displays an OpenFileDialog so the user can select a Cursor.
- Dim openFileDialog1 As New OpenFileDialog()
- openFileDialog1.Filter = "Cursor Files|*.cur"
- openFileDialog1.Title = "Select a Cursor File"
- If openFileDialog1.ShowDialog() = System.Windows.Forms.DialogResult.OK Then
- ' Assign the cursor in the Stream to the Form's Cursor property.
- Dim extension = openFileDialog1.FileName.Substring(openFileDialog1.FileName.LastIndexOf("."))
- If extension Is "cur" Then
- Me.mainRTBox.Text = FileIO.FileSystem.ReadAllText(openFileDialog1.FileName)
- End If
- End If
- End Sub
- End Class
- RichTextBox1.LoadFile("YOUR DIRECTORY", RichTextBoxStreamType.RichText)
- RichTextBox1.LoadFile("YOUR DIRECTORY", RichTextBoxStreamType.PlainText)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement