Dim MyTextBox(myDataset.Tables(0).Rows.Count ) As TextBox
For i = 0 To myDataset.Tables(0).Rows.Count - 1
MyTextBox(i) = New TextBox
MyTextBox(i).Parent = Me
MyTextBox(i).ReadOnly = True
MyTextBox(i).Multiline = True
MyTextBox(i).Enabled = False
MyTextBox(i).Size = New System.Drawing.Size(... Some Size Here ...)
MyTextBox(i).BorderStyle = BorderStyle.FixedSingle
MyTextBox(i).TabIndex = 0
MyTextBox(i).TextAlign = HorizontalAlignment.Left
MyTextBox(i).Name = "MyTextBox" + i.ToString
MyTextBox(i).Text = "MyTextBox_Text_" + i.ToString
MyTextBox(i).Font = New System.Drawing.Font("Tahoma", 8.0!, System.Drawing.FontStyle.Bold)
MyTextBox(i).Location = New Point(... Some Location Here ...)
AddHandler MyTextBox(i).Click, AddressOf MyTextBox_Click
Next
Private Sub MyTextBox_Click(ByVal sender As Object, ByVal e As EventArgs)
Dim TxtBox As TextBox = DirectCast(sender, TextBox)
MsgBox(TxtBox.Text)
End Sub
Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.
”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.
Our community of experts have been thoroughly vetted for their expertise and industry experience.