Looping Controls

B

Big E

I'm using VB.Net and SQL Server. I have a text box and a Image on a form. I
want to create some type of loop that will create textboxes and images
dynamically. If there are 15 records in the database I want it to create 15
textboxes and images.
I know how to do it in ASP but not in VB.Net windows forms.

Thanks.

Erik
 
H

Herfried K. Wagner [MVP]

* "Big E said:
I'm using VB.Net and SQL Server. I have a text box and a Image on a form. I
want to create some type of loop that will create textboxes and images
dynamically. If there are 15 records in the database I want it to create 15
textboxes and images.
I know how to do it in ASP but not in VB.Net windows forms.

\\\
For ...
Dim b As New Button()
With b
.Left = ...
.Right = ...
.Text = ...
End With
Me.Controls.Add(b)
Next ...
///
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top