home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Programmer'…arterly (Limited Edition) / Visual_Basic_Programmers_Journal_VB-CD_Quarterly_Limited_Edition_1995.iso / code / ch24code / applicat.cls next >
Encoding:
Text File  |  1994-09-20  |  1.5 KB  |  46 lines

  1. Version 1.0 Class
  2. Attribute VB_Name = "Application"
  3. Attribute VB_Creatable = True
  4. Attribute VB_Exposed = True
  5. Attribute VB_Description = "Create Directory Dialog Box"
  6. Option Explicit
  7. Private mnuitCreateDirectory As Object
  8.  
  9. ' Initialize the add-in.
  10. Public Sub ConnectAddIn(Application As Object)
  11.     ' Create a new MenuLine object.
  12.     Set mnuitCreateDirectory = Application. _
  13.         AddInMenu.MenuItems.Add("Create Directory")
  14.     ' Associate the MenuLine AfterClick event
  15.     ' with this object.
  16.     mnuitCreateDirectory.ConnectEvents Me
  17.     ' Create a new instance of an object
  18.     ' to receive file control events.
  19.     Dim objFileControl As New clsFileControl
  20.     ' Connect the VB FileControlEvents to the object.
  21.     Application.FileControl.ConnectEvents objFileControl
  22. End Sub
  23.  
  24. ' The AfterClick event procedure for the
  25. ' Create Directory menu item.
  26. Public Sub afterclick()
  27.     ' Display the Create Directory form.
  28.     frmCreateDirectory.Show vbModal
  29. End Sub
  30.  
  31. ' De-initialize the add-in.
  32. Public Sub DisconnectAddIn(Mode As Integer)
  33.     ' Determine whether or not VB is quitting.
  34.     Select Case Mode
  35.         ' VB is quitting, so unload form.
  36.         Case 0
  37.             Unload frmCreateDirectory
  38.         ' User has deselected add-in in the Add-In Manager
  39.         ' remove the add-in's menu item, then unload form.
  40.         Case 1
  41.             mnuitCreateDirectory.Parent.Remove mnuitCreateDirectory
  42.             Unload frmCreateDirectory
  43.         End Select
  44. End Sub
  45.  
  46.