Dynamically loaded controls

A

Arne Garvander

How can I dynamically load controls unto a windows form?
I need to write some custom controls that are a composite of other controls.
These custom controls needs to be dynamically loaded into a container, maybe
a panel.
I know this can easily be done in Asp.net. Now I need to duplicate this
trick in windows .net 2.0.
 
H

Herfried K. Wagner [MVP]

Arne Garvander said:
How can I dynamically load controls unto a windows form?

\\\
Dim NewButton As New Button()
NewButton.Text = "Hello World"
....
Me.Controls.Add(NewButton)
///
I need to write some custom controls that are a composite of other
controls.

Take a look at user controls ("Project" -> "Add new element..." -> "User
control".
 

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