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
Titre:
Collection Problem
Divers
Thread ID:
00784441
Message ID:
00784441
Vues:
70
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
Everything makes sense in someone's mind
public class SystemCrasher :ICrashable
In addition, an integer field is not for irrational people
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform