hi friends
i am making one windows application in vb.net.i want to create controls dynamically and their respective value will store in database.
thanks in advance
How to create controls dynamically in vb.net windows application
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.

Hirendra SisodiyaRank #258 · 9.8K reputationPosted Feb 27, 2011, 12:06 AM EST
suppose you have table tbl_Control with these fields
ArrTxtBox() As TextBox
Dim ArrCmbBox() As ComboBox
Dim intTxt As Integer = -1
Dim intCmb As Integer = -1
Select ControlType
Case "TextBox"
intTxt = intTxt + 1
Dim tempTxt As New TextBoxt
ReDim ArrTxtBox(intTxt)
temptxt.Location=New Point(x, y)
Form1.Controls.Add(temptxt)
AddHandler ArrTxtBox(intTxt - 1).Click, AddressOf Textbox_click()
Case "ComboBox"
intCmb = intCmb + 1
tempcmb.Name = cmb1
tempcmb.Location = New Point(x, y)
tempcmb.Tag = cmb1
Form1.controls.add(tempcmb)
AddressOf Combobox_SelectedIndexChanged()
End Select
Private Sub TextBox_click()
End Sub
Private Sub Combobox_SelectedIndexChanged()
End Sub
i think it helps
thanks