Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Collection Problem
Message
Information générale
Forum:
Visual Basic
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00784441
Message ID:
00786446
Vues:
31
I've never worked with the vbcontrolExtender, so I don't have much to offer! Sorry -- good luck!

>I forgot the 'NEW' keyword. Thanks for you expert help
>
>Another question; I'm adding controls at runtime. I'm using the
>VBControlExtender to trap a custom "Clicked" event in the control
>i'm adding.
>
>Yet the event is only trapped for the LAST control thats
>added.
>
>Any ideas?
>
>
>
>Private WithEvents oGroup As VBControlExtender
>Public Groups As New Collection
>
>Public Function AddGroup(Caption As String) As Object
>
>  Dim sName As String
>  Dim iTotGroups As Integer
>
>  iTotGroups = Groups.Count + 1
>  sName = "Group" + LTrim(Str(iTotGroups))
>
>  Set oGroup = Controls.Add("MyProject.crlGroup", sName)
>
>  With oGroup
>
>    .Alignment = 1
>    .Caption = Caption
>    .Left = 10
>    .Top = 10 + (iCurrentGroup * GroupHeight)
>    .Height = GroupHeight
>    .Width = UserControl.Width - 23
>    .IndexValue = iTotGroups
>    .Visible = True
>
>  End With
>
>  ' Add the group to the collection here
>  Groups.Add oGroup, sName
>
>  Set AddGroup = oGroup
>
>
>Private Sub oGroup_ObjectEvent(Info As EventInfo)
>
>    ' The name of the event
>    Select Case Info.Name
>
>     Case "Clicked"
>
>        ' Read in parameters passed to the Clicked event here
>        MsgBox Info.EventParameters("Index").Value
>
>      ' Handle unknown events here.
>      Case Else
>
>    End Select
>
>End Sub
>
The whole problem with the world is that fools and fanatics are always so certain of themselves, but wiser people so full of doubts. - Bertrand Russell
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform