Hi
I would like to create a new Label object in run time(on blank form), but I don't know how to do it. Please, help. Thanks!
Jure
Printable View
Hi
I would like to create a new Label object in run time(on blank form), but I don't know how to do it. Please, help. Thanks!
Jure
[code]
Option Explicit
Private WithEvents btnObj As Label
Private Sub Form_Load()
Set btnObj = Controls.Add("VB.Label", "btnObj")
With btnObj
.Visible = True
.Width = 2000
.Caption = "Hello"
.Top = 1000
.Left = 1000
.BackColor = vbRed
.ForeColor = vbWhite
.FontBold = True
.FontSize = 14
End With
End Sub
[code]