Controls.Add

_Brian_

Registered User.
Local time
Today, 17:17
Joined
Nov 26, 2004
Messages
29
I need create controls with Controls.Add in one forms on event LOAD . :confused:
 
Controls

May be it would be easier to create the controls at design time and set the property to Visible = True or Visible = False at the proper event.
 
I need to create them in run time.

code:

Private Sub Comando11_Click()

Dim c As Control
Set c = Me.Controls.Add("VB.Label", "NombreNuevoLabel")
c.Visible = True
c.Top = 200
c.Caption = "Prueba"
End Sub

but it gives an error:

was not the method or the data member in line:

Set c = Me.Controls.Add("VB.Label", "NombreNuevoLabel")

error in Controls.Add

as it is the reference to apply it. :confused: :confused: :rolleyes:
 

Users who are viewing this thread

Back
Top Bottom