This will allow you to browse and select a text file on your computer
and have the text put right into a textbox or richtextbox
on your program.
Just open a richtextbox, A command button, And 1 Openfiledialog.
[IMG]http://i30.[censored].com/2md1bvt.jpg[/IMG]
Put this code in after double clicking on the command button.
[IMG]http://i25.[censored].com/aywtwz.jpg[/IMG]
You can now test out your program.
You will see that when you click on your command put
where you put the code in, you can browse and select a text file
off your computer to be added into the programs Richtextbox1.
[IMG]http://i30.[censored].com/34pjptw.jpg[/IMG]
Once you select which text file you would like
Double click on the text file or highlight the text
file you would like and click "Open" on the browser.
You will then see your text go into the richtextbox on the program
and you will be able to scroll through all of it and read it.
This is good for having "How to use" text files that come with your program, Since no one ever really opens the read me.txt or the how to use.txt
now you can add the choice right into the program incase
they eventually need to read it.
[IMG]http://i28.[censored].com/117wjft.jpg[/IMG]
and have the text put right into a textbox or richtextbox
on your program.
Just open a richtextbox, A command button, And 1 Openfiledialog.
[IMG]http://i30.[censored].com/2md1bvt.jpg[/IMG]
Put this code in after double clicking on the command button.
Code
OpenFileDialog1.ShowDialog()
Dim fname As String = OpenFileDialog1.FileName
If System.IO.File.Exists(fname) Then
Dim read As New System.IO.StreamReader(fname)
RichTextBox1.Text = read.ReadToEnd
read.Close()
Else
MsgBox("Error: File does not exists, Please choose another")
End If
End Sub[IMG]http://i25.[censored].com/aywtwz.jpg[/IMG]
You can now test out your program.
You will see that when you click on your command put
where you put the code in, you can browse and select a text file
off your computer to be added into the programs Richtextbox1.
[IMG]http://i30.[censored].com/34pjptw.jpg[/IMG]
Once you select which text file you would like
Double click on the text file or highlight the text
file you would like and click "Open" on the browser.
You will then see your text go into the richtextbox on the program
and you will be able to scroll through all of it and read it.
This is good for having "How to use" text files that come with your program, Since no one ever really opens the read me.txt or the how to use.txt
now you can add the choice right into the program incase
they eventually need to read it.
[IMG]http://i28.[censored].com/117wjft.jpg[/IMG]
