Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Adding Controls At Runtime
Message
 
À
16/04/2002 17:13:51
Information générale
Forum:
Visual Basic
Catégorie:
Contrôles ActiveX
Divers
Thread ID:
00645508
Message ID:
00645731
Vues:
26
Ok, thanks

What if I used a collection? Is it possible to add events
to objects in a collection?


Private oButtons As New Collection

Public Sub AddButton()

  Dim oNewButton As Object

  iTotButtons = oButtons.Count + 1

  sName = "Test" & iTotButtons
  Set oNewButton = Me.Controls.Add("VB.CommandButton", sName)

  oButtons.Add oNewButton

  With oNewButton
    .Caption = sName
    .Top = 1000 * iTotButtons
    .Left = 1000
    .Visible = True
  End With

End Sub
<>/font
Everything makes sense in someone's mind
public class SystemCrasher :ICrashable
In addition, an integer field is not for irrational people
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform