469,343 Members | 5,524 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,343 developers. It's quick & easy.

Load text file to textBox

Hi EveryBody:

How can I load data from text file to textBox ?

any help will be appreciated

regard's

Husam
Nov 21 '05 #1
4 20333
Husam,

See this link there are a lot more methods and other classes to use on that
Streamreader
http://msdn.microsoft.com/library/de...classtopic.asp

I hope this helps,

Cor
Nov 21 '05 #2
Dim strFile As String = "C:\MyFileHere.txt"
Dim sr As New IO.StreamReader(strFile)

TextBox1.Text = sr.ReadToEnd()

sr.Close()

Crouchie1998
BA (HONS) MCP MCSE
Nov 21 '05 #3
A simple is to open the file and assign the entire content to the
TextBox.Text property:

Dim _sr As StreamReader = File.OpenText(<file_name>)

<TextBox>.Text = _sr.ReadToEnd()

_sr.Close()

making sure of course that you have set the TextBox.Multiline and other
relevant properties correctly.

If you happened to be feeling brave you could create your own TextBox class
derived from TextrBox and add a method to load the textbox from the
specified file.
"Husam" <Hu***@discussions.microsoft.com> wrote in message
news:AB**********************************@microsof t.com...
Hi EveryBody:

How can I load data from text file to textBox ?

any help will be appreciated

regard's

Husam

Nov 21 '05 #4
"Husam" <Hu***@discussions.microsoft.com> schrieb:
How can I load data from text file to textBox ?


Please read replies given to your question some days ago instead of asking
the same questions again and again:

<URL:http://www.google.de/groups?selm=uKUbJErQFHA.1392%40TK2MSFTNGP10.phx.gb l>

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 21 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Chris | last post: by
5 posts views Thread by Gaurav - http://www.gauravcreations.com | last post: by
14 posts views Thread by Ilias Lazaridis | last post: by
3 posts views Thread by jiayanxiang | last post: by
reply views Thread by Tom | last post: by
2 posts views Thread by Poten Tate | last post: by
1 post views Thread by CARIGAR | last post: by
1 post views Thread by Marylou17 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.