home *** CD-ROM | disk | FTP | other *** search
/ QBasic & Borland Pascal & C / Delphi5.iso / Basic / Visual Basic.60 / VB98 / WIZARDS / TEMPLATE / WIZARD.DSR (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1998-06-18  |  2.7 KB  |  68 lines

  1. VERSION 5.00
  2. Begin {AC0714F6-3D04-11D1-AE7D-00A0C90F26F4} Wizard 
  3.    ClientHeight    =   9945
  4.    ClientLeft      =   1740
  5.    ClientTop       =   1545
  6.    ClientWidth     =   6585
  7.    _ExtentX        =   11615
  8.    _ExtentY        =   17542
  9.    _Version        =   393216
  10.    DisplayName     =   "Wizard Template"
  11.    AppName         =   "Visual Basic"
  12.    AppVer          =   "Visual Basic 98 (ver 6.0)"
  13.    LoadName        =   "None"
  14.    LoadBehavior    =   2
  15.    RegLocation     =   "HKEY_CURRENT_USER\Software\Microsoft\Visual Basic\6.0"
  16.    CmdLineSupport  =   -1  'True
  17. Attribute VB_Name = "Wizard"
  18. Attribute VB_GlobalNameSpace = False
  19. Attribute VB_Creatable = True
  20. Attribute VB_PredeclaredId = False
  21. Attribute VB_Exposed = True
  22. Option Explicit
  23. Dim mcbMenuCommandBar         As Office.CommandBarControl  'command bar object
  24. Public WithEvents MenuHandler As CommandBarEvents          'command bar event handler
  25. Attribute MenuHandler.VB_VarHelpID = -1
  26. Dim mfrmWizard As frmWizard
  27. Dim VBInstance As VBIDE.VBE
  28. '------------------------------------------------------
  29. 'this method adds the Add-In to the VB menu
  30. 'it is called by the VB addin manager
  31. '------------------------------------------------------
  32. Private Sub AddinInstance_OnConnection(ByVal Application As Object, ByVal ConnectMode As AddInDesignerObjects.ext_ConnectMode, ByVal AddInInst As Object, custom() As Variant)
  33.    On Error GoTo error_handler
  34.    Set VBInstance = Application
  35.    If ConnectMode = ext_cm_External Then
  36.        'Used by the wizard toolbar to start this wizard
  37.        LoadMe
  38.    Else
  39.        Set mcbMenuCommandBar = AddToAddInCommandBar(VBInstance, LoadResString(15), LoadResPicture(5000, 0))
  40.        'sink the event
  41.        Set Me.MenuHandler = VBInstance.Events.CommandBarEvents(mcbMenuCommandBar)
  42.    End If
  43.    Exit Sub
  44.      
  45. error_handler:
  46.    MsgBox Err.Description
  47. End Sub
  48. '------------------------------------------------------
  49. 'this method removes the Add-In from the VB menu
  50. 'it is called by the VB addin manager
  51. '------------------------------------------------------
  52. Private Sub AddinInstance_OnDisconnection(ByVal RemoveMode As AddInDesignerObjects.ext_DisconnectMode, custom() As Variant)
  53.     'delete the command bar entry
  54.     mcbMenuCommandBar.Delete
  55. End Sub
  56. 'this event fires when the menu is clicked in the IDE
  57. Private Sub MenuHandler_Click(ByVal CommandBarControl As Object, handled As Boolean, CancelDefault As Boolean)
  58.     LoadMe
  59. End Sub
  60. Private Sub LoadMe()
  61.     Set mfrmWizard = New frmWizard
  62.     'pass the vb instance to the wizard module
  63.     Set mfrmWizard.VBInst = VBInstance
  64.     'load and show the form
  65.     mfrmWizard.Show vbModal
  66.     Set mfrmWizard = Nothing
  67. End Sub
  68.