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:
00784605
Vues:
21
You need to create a collection object named Headers, right? Or is that a module-level variable that has already been set?

>I'v added a control dynamically, and now I want to place
>the control in a collection. I'm getting the error
>"Object variable or With block variable not set" on the bold line:
>
>
>Private WithEvents ctlExtender As VBControlExtender
>Private Headers As Collection
>
>
>Public Function AddGroup(Caption As String) As Object
>
> Dim sName As String
> Dim iGroup As Integer
>
> iTotHeaders = iTotHeaders + 1
> sName = "Header" + LTrim(Str(iTotHeaders))
>
> Set ctlExtender = Controls.Add("SuperSideBar.crlButton", sName)
>
> With ctlExtender
>
> .Alignment = 1
> .Caption = Caption
> .Left = 10
> .Top = 10
> .Width = UserControl.Width - 23
>
> .Visible = True
>
> End With
>
>
> Headers.Add ctlExtender, sName
>

>
> Set AddGroup = ctlExtender
>
>End Function
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