Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to get current instance of Visual Basic
Message
De
09/03/2001 04:36:43
 
 
À
Tous
Information générale
Forum:
Visual Basic
Catégorie:
Codage, syntaxe et commandes
Titre:
How to get current instance of Visual Basic
Divers
Thread ID:
00483440
Message ID:
00483440
Vues:
49
How to get current instance of Visual Basic

How to set variable named "vbi", which is a variable to reference the current instance of Visual Basic.
Variable vbi used in samples : Manipulating Projects with Add-Ins (MSDN Library Visual studio 6).The following code fragments demonstrate how to reference the VBProject object and VBProjects collection, as well as other extensibility objects:

' Create new project.
Private Sub cmdCreateNew_Click()
Dim p As VBProject
Set p = vbi.VBProjects.Add _
(cmbProjKind.ItemData(cmbProjKind.ListIndex))
If txtProjName.Text <> "" Then
p.Name = txtProjName.Text
End If
End Sub

' Activate component.
Private Sub cmdActivate_Click()
Dim sc As String
Dim sp As String
Dim c As VBComponent

sp = cmbProj.Text
sc = cmbComp.Text
If sp <> "" And sc <> "" Then
Set c = _
vbi.VBProjects.Item(sp).VBComponents.Item(sc)
c.Activate
End If
End Sub

' Create new component of the type indicated in the
' cmbCompKind combo.
Private Sub cmdCreateNewVBComponent_Click()
Dim p As VBProject
Dim c As VBComponent
Dim sp As String
sp = cmbProj.Text
If sp <> "" Then
Set p = vbi.VBProjects.Item(sp)
Set c = p.VBComponents.Add _
(cmbCompKind.ItemData(cmbCompKind.ListIndex))
End If
End Sub

Thanks,
Dusan Grujic
e-mail: ozisabac@ptt.yu
Répondre
Fil
Voir

Click here to load this message in the networking platform