473,327 Members | 2,007 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

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 20727
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Suresh Kumaran | last post by:
Hi All, Does anybody know the sytax in VB.NET to write the contents of a multiline text box to a text file? Appreciate help. Suresh
3
by: Chris | last post by:
Hi, In Delphi there is the possibilty to load a textfile into a textfield (memo) without writing too much code. It goes like memo1.Lines.LoadFromFile('myfile.txt'); What is the C# equivalent...
5
by: Gaurav - http://www.gauravcreations.com | last post by:
what is the fastest method to sort and load 1 lakh + strings in a list box from a text file. each string is in a new line -- Gaurav Creations
14
by: Ilias Lazaridis | last post by:
within a python script, I like to create a collection which I fill with values from an external text-file (user editable). How is this accomplished the easiest way (if possible without the need...
3
by: jiayanxiang | last post by:
Is there any sample code to use Javascript to load and display a text file? It will be best if the user can select files using some kind of explorer. If that's complex, a text box to specify the...
2
by: jzheng22 | last post by:
Hi all, I am new to VB .NET. I am currently wring a simple GUI, a TextBox (multilined), a button and an OpenFileDialog. When user click the button, the OpenFileDialog fired and after user...
0
by: Tom | last post by:
I have about 30 labels and textboxes on my web form and the user can input data into the text boxes. Then they click a button and a text file needs to be created. I can create the text file but how...
5
by: CCLeasing | last post by:
Hello, I have searched google but can not find a straight forward answer to my problem. Hopefuly someone will be kind enough to offer their expertise. Please forgive if this seems a bit convoluted...
2
by: Poten Tate | last post by:
Does anyone know a simple way to load a text file into an html file? I know how to do it with server side includes. But you have to name the file with a 'shtml' extension and this creates a problem...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.