vb.net dynamic control creation
Posted on 2004-08-02
I'm developing an application in VB.NET on compact framework.
I'm creating a form with a variable number of controls, so i must create then at runtime. In vb6 i can create an array of controls and increment it. But not in vb.net.
so i need to create controls (textbox and combobox) giving then a name but how?
i can't declare something like << dim "textbox_12" as new textbox >> obviously
For i = 0 To 10
Dim newcontrol As New TextBox
newcontrol.Top = 20 * i
and it adds the controls to the form how can i manage then? How do i know what there is in textbox_12?
i could cycle in me.controls, but i can't identify the right control because "name" property is not supported in compact framework...