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
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Hirendra SisodiyaPosted Feb 27, 2011, 5:06 AM
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