Originally posted by: Thirukkumaran
How can i write events for more than one command button.suppose i want to create a ten commandbutton and i want to write events for all cmd button.
ReplyOriginally posted by: Jaime
Very clear, easy-to-follow example.
Ta much.
ReplyOriginally posted by: deven
This code is very useful . Manoj Tuli u r "Code guru ka Guru"
ReplyOriginally posted by: chandan dutta
i want to get controls from database at runtime.
suppose i have selected some fields with their name. it will store to the database with a cmmand button. i want to get back in a new form with all the fields with their name which i have selected and corresponding blank text box to fill the corresponding data and it will store accordingly.
ReplyOriginally posted by: Juan
The array is great, but, how can an array of command buttons dinamically created have events??
ReplyOriginally posted by: J
That's what I was lookin' for! Thanx!
Reply
Originally posted by: Todd Chaplin
I think this is what some of the people are asking for. The ability to add many controls at run time using an array.
Of course the properities to the text box can be changed eg position, type ect. Just add the following to your form called "form1"
Private Sub Form_Load()
Dim i As Integer
Dim ctlName(1 To 6) As Control
For i = 1 To 6
Set ctlName(i) = Form1.Controls.Add("VB.TextBox", _
"Text" & (i), Form1)
ctlName(i).Top = i * 600
ctlName(i).Left = 400
ctlName(i).Visible = True
Next i
End Sub
Originally posted by: Aalok Desai
it's very good to create control dynamically and no need to use microsoft organisation chart software
Originally posted by: Geat
Private Sub Command1_Click()
Load Text1(1)
Load Label1(1)
End Sub
It's not my code - I got it off another web site a while back, but I know it's definitely useful!
Geat.
Add a button, TextBox and Label to a form and slap this code in - clicking the button will create a brand new button and label with the specified coordinates.
Of course, replacing 1 with n will allow you to create as many controls as required, without declaring the number upper bound first.
As far as I know, this will allow you to create up to 32768 of each named control, which I think is plenty.
Text1(1).Left = 500
Text1(1).Top = 300 * 1
Text1(1).Visible = True
Label1(1).Left = 1900
Label1(1).Top = 1500 * 1
Label1(1).Visible = True
Originally posted by: Lalita
How do i add a listview control at run time?
Also while adding items to my listview control,it flickers.how do i stop my control from flickering .i've used 'Lockwindow' Api,but still it flickers.please, if u have any solution ,mail me.