My suggestions for improving the code as given:
Keep only the minimum needed code inside the loop; everything else should be placed before or after the loop. In particular, move the code that opens the StreamReader before the loop. You have it restarting the file each time through the loop, … Read More
You should **not** use
Me.Controls("txbUserFld" & intIndex).Text = reader.ReadLine
because Me.Controls does not return a TextBox control. It returns a reference that must be converted to a TextBox reference. You can do that by assigning it to a TextBox variable or by doing an explicit cast (which is probably the … Read More
> "NullReferenceException was Unhandled"
Try this `Dim strLine As String = ""`. It's usally a good habit to initialize every variable when you declare it.
> send the number of "intIndex" to the Imediate box
Debug.WriteLine(intIndex). Also you could set up a breakpoint, when your code stops, show the locals … Read More
You are beginning to see the issues that I tried to cautioned you about in this post.
Consider the time that you have wasted already just to trying and save some time typing in names of the controls that you wish to save the text from by using … Read More
Or he could do
Public Class Form1
Private TextBoxes(37) As TextBox
Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
For i As Integer = 1 To 36
Dim txt As New TextBox
txt.Location = New Point(10, 25 * i)
txt.Name = "TextBox" & i
txt.Text = "TextBox" & … Read More
I realized that I did not address the questions you raised in the following text.
> ...it is within a Panel that I'm using because it needs a vertical scroll bar. This suggests that I may need some other code for it to recognize the TextBox within the panel … Read More
I had seen your prior post and decided to add some comments to the example that I had previouly provided. For once I refreshed my browser before posting it and seen that you have got it working. Good job!
Since you seen to be having problems with terminology (wat! … Read More