B _Brian_ Registered User. Local time Tomorrow, 00:03 Joined Nov 26, 2004 Messages 29 Apr 21, 2005 #1 I need create controls with Controls.Add in one forms on event LOAD .
T trucktime Registered User. Local time Today, 16:03 Joined Oct 24, 2004 Messages 556 Apr 21, 2005 #2 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.
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.
B _Brian_ Registered User. Local time Tomorrow, 00:03 Joined Nov 26, 2004 Messages 29 Apr 22, 2005 #3 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.
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.