-2

I want to open a text file into a richtextbox without using a OpenFileDialog in VB.NET

Nat569On
  • 23
  • 1
  • 4

1 Answers1

0

In VB.NET 2012. Something like this works

Public Class Form1
    Private Sub Form1_Load(sender As Object, e As EventArgs) Handles Me.Load
        Me.RichTextBox1.LoadFile("C:\MyDocument.rtf", RichTextBoxStreamType.PlainText)
    End Sub
End Class

Take a look at the RichTextBoxStreamType Enumeration

http://msdn.microsoft.com/en-us/library/vstudio/system.windows.forms.richtextboxstreamtype(v=vs.90).aspx

Rose
  • 641
  • 7
  • 17