Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to create a control in runtime. 1

Status
Not open for further replies.

Peepain

Programmer
May 15, 2002
43
AR
Hi all!

I have a label on my form and I need to create more labels as the user clicks on a commandbutton.

Can't find the way to do it... somebody could help me?

Thanks a lot.
Peepain
 
Here you go. Add a label to a form and set its index to 0, then add a command button and put this code in

Private Sub Command1_Click()
Dim iX As Long
iX = Label1.Count
Load Label1(iX)
Label1(iX).Move Label1(iX - 1).Left, Label1(iX - 1).Top + Label1(iX - 1).Height
Label1(iX).Visible = True
End Sub

Let me know if this helps. If you choose to battle wits with the witless be prepared to lose.
[machinegun][hammer]
 
Thanks a lot!
Exactly what I needed. Very clear Foada.

Thanks again.
 
Thanks FOADA!
That's exactly what I needed. Very good explanation.

Thanks again
Peepain
 
[cheers] If you choose to battle wits with the witless be prepared to lose.
[machinegun][hammer]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top