RE: VB - Import Text From .txt file? -- Help! 03-21-2013, 07:17 AM
#2
You would never assign to:
So is this all the same TextBox or a bunch of different TextBoxes?
If it's all the same use File.ReadAllText() to copy the string over to the control. If it is different TextBoxes, I would index from File.ReadAllLines().
Might look something like this...
Code:
TextBox.TextSo is this all the same TextBox or a bunch of different TextBoxes?
If it's all the same use File.ReadAllText() to copy the string over to the control. If it is different TextBoxes, I would index from File.ReadAllLines().
Might look something like this...
Code:
Dim lines As String() = File.ReadAllLines("FILEPATH")
For i As Integer = 0 To lines.Length - 1
Me.Controls("TextBox" + i.ToString()).Text = lines(i)
Next
ArkPhaze
"Object oriented way to get rich? Inheritance"
Getting Started: C/C++ | Common Mistakes
[ Assembly / C++ / .NET / Haskell / J Programmer ]
"Object oriented way to get rich? Inheritance"
Getting Started: C/C++ | Common Mistakes
[ Assembly / C++ / .NET / Haskell / J Programmer ]


![[+]](https://sinister.li/images/modern/collapse_collapsed.png)