HI friends,
I want to design a button, which when clicked shud navigate the text files in the system and when selected should be copied to Richtextbox.I have tried this sample code from .NET documentation but didnt worked
So, plz help me with a better code
I want to design a button, which when clicked shud navigate the text files in the system and when selected should be copied to Richtextbox.I have tried this sample code from .NET documentation but didnt worked
VB.NET:
Public Sub LoadMyFile()
' Create an OpenFileDialog to request a file to open.
Dim openFile1 As New OpenFileDialog()
' Initialize the OpenFileDialog to look for RTF files.
openFile1.DefaultExt = "*.txt
openFile1.Filter = "TXT files|*.txt"
' 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.PlainText)
End If
End Sub
So, plz help me with a better code