How to op-en file and view in a rich text box using vb.net?
Posted
by
Aaron Warnke
on Stack Overflow
See other posts from Stack Overflow
or by Aaron Warnke
Published on 2012-10-21T22:57:51Z
Indexed on
2012/10/21
23:00 UTC
Read the original article
Hit count: 248
vb.net
Hi I am trying to open and view a files text in a rich text box. Here is what I have please let me know what I am doing wrong?
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
© Stack Overflow or respective owner