home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic 4 Power Pack / Visual_Basic4_Power_Pack.bin / vb4files / vbof / vboflbox.cls < prev    next >
Encoding:
Text File  |  1996-11-20  |  19.2 KB  |  692 lines

  1. VERSION 1.0 CLASS
  2. BEGIN
  3.   MultiUse = 0   'False
  4. END
  5. Attribute VB_Name = "VBOFListBoxWrapper"
  6. Attribute VB_Creatable = True
  7. Attribute VB_Exposed = True
  8. Option Explicit
  9.  
  10. ' (c) Copyright 1995 Ken Fitzpatrick
  11. '     All Rights Reserved
  12. '     Cannot be distributed or sold without permission
  13. '
  14. ' VBOFListBoxWrapper is a supplemental GUI Control
  15. '   Wrapper for Microsoft Visual Basic 4.0.
  16. '   It is valid only in conjunction with the
  17. '   following Classes Modules:
  18. '       VBOFCollection
  19. '       VBOFObjectLink
  20. '       VBOFObjectManager
  21.  
  22. ' VBOFListBoxWrapper is a wrapper class for
  23. '   providing automatic interfacing between a
  24. '   ListBox VB control and an underlying
  25. '   VBOFCollection
  26.  
  27. Private pvtVBOFObjectManager As VBOFObjectManager
  28. Private pvtCollection As VBOFCollection
  29. Private pvtListBox As Variant
  30. Private pvtSupportedTypeNames As String
  31.  
  32. Public ObjectID As Long
  33.  
  34. Public Function Unbind() As Boolean
  35.  
  36.     Set pvtCollection = Nothing
  37.     Set pvtListBox = Nothing
  38.     Set pvtVBOFObjectManager = Nothing
  39.  
  40. End Function
  41.  
  42.  
  43. Public Function Rebind(Optional Collection As Variant, Optional ListBox As Variant) As Boolean
  44. Attribute Rebind.VB_Description = "Rebinds the VBOFCollection and ListBox to the Wrapper"
  45. ' Rebinds the Wrapper to a Collection or ListBox
  46. '   after having changed the assignment of either.
  47. '   For example, in the following scenario, the
  48. '   VBOFDBGridWrapper must be rebound because the
  49. '   VBOFCollection has been significantly altered:
  50. '
  51. '   Dim pvtAddresses as VBOFCollection
  52. '   Dim pvtPerson as Person
  53. '   Dim MyListBoxWrapper as VBOFListBoxWrapper
  54. '   Set MyListBoxWrapper = _
  55. '       ObjectManager.NewVBOFListBoxWrapper ( _
  56. '           Collection:=pvtAddresses, _
  57. '           ListBox:=MyListBox)
  58. '
  59. ' the following line alters the state of the data
  60. ' in-effect at the time of the above binding
  61. '   Set pvtAddresses = pvtPerson.Addresses
  62. ' rebind the Wrapper
  63. '   MyListBoxWrapper.Rebind _
  64. '           Collection:=pvtAddresses
  65.     
  66. ' bullet-proofing
  67.     If Not IsMissing(Collection) Then
  68.         If TypeName(Collection) <> "VBOFCollection" Then
  69.             pvtErrorMessage TypeName(Me) & " cannot process the '.Rebind' method because the 'Collection:=' parameter is not a VBOFCollection."
  70.             Rebind = False
  71.             Exit Function
  72.         End If
  73.     End If
  74.     If Not IsMissing(ListBox) Then
  75.         If TypeName(ListBox) <> "ListBox" _
  76.         And TypeName(ListBox) <> "ComboBox" _
  77.         Then
  78.             pvtErrorMessage TypeName(Me) & " cannot process the '.Rebind' method because the 'ListBox:=' parameter is not a Visual Basic ListBox control.  Please use a VBOF Wrapper for the " & TypeName(ListBox) & " control (or request the development of one.)"
  79.             Rebind = False
  80.             Exit Function
  81.         End If
  82.     End If
  83.     If Not pvtIsFullyInitialized( _
  84.         Collection:=Collection, _
  85.         ListBox:=ListBox, _
  86.         Verbose:=False) _
  87.     Then
  88.         Exit Function
  89.     End If
  90.     
  91. ' bind to the ListBox and Collection
  92.     If Not IsMissing(Collection) Then
  93.         If Not Collection Is Nothing Then
  94.             Set Me.Collection = _
  95.                 Collection
  96.         End If
  97.     End If
  98.     
  99.     If Not IsMissing(ListBox) Then
  100.         If Not ListBox Is Nothing Then
  101.             Set Me.ListBox = _
  102.                 ListBox
  103.         End If
  104.     End If
  105.  
  106.     Rebind = True
  107. End Function
  108.  
  109.  
  110. Public Function AddItems(Optional ListBox As Variant) As Boolean
  111. Attribute AddItems.VB_Description = "Populates the ListBox with the contents of the underlying VBOFCollection"
  112. ' Populates the ListBox with one line of information
  113. '   for each object in this VBOFListBoxWrapper
  114. ' Note:  the referenced objects must contain the
  115. '   method 'ObjectListBoxValue', which must return
  116. '   a String which is the text which is to appear
  117. '   in the ListBox and is to represent the object
  118. '   for the purposes of the ListBox.
  119. ' Note:  this method should be coded as follows:
  120. '    MyVBFWListBoxWrapper.AddItems MyListBox
  121. '   (although 'MyListBox' is optional)
  122.     
  123.     On Local Error Resume Next
  124.     
  125. ' bullet-proofing
  126.     If Not pvtIsFullyInitialized _
  127.         (ListBox:=ListBox) _
  128.     Then
  129.         Exit Function
  130.     End If
  131.     
  132.     AddItems = _
  133.         pvtCollection. _
  134.             pvtListBoxAddItems _
  135.                 (ListBox:=pvtListBox)
  136.         
  137. End Function
  138.  
  139. Public Function Clear(Optional ListBox As Variant, Optional FreeObjects As Variant) As Boolean
  140. Attribute Clear.VB_Description = "Clears (empties) the ListBox and the underlying VBOFCollection"
  141. ' Empties the objects from the ListBox and removes
  142. '   the corresponding objects from the Collection
  143. ' Note:  this method should be coded as follows:
  144. '     MyVBFWListBoxWrapper.Clear _
  145. '               MyListBox
  146. '   (although 'MyListBox' is optional)
  147.     
  148.     On Local Error Resume Next
  149.  
  150. ' bullet-proofing
  151.     If Not pvtIsFullyInitialized _
  152.         (ListBox:=ListBox) _
  153.     Then
  154.         Exit Function
  155.     End If
  156.  
  157.     Clear = _
  158.         pvtCollection. _
  159.             pvtListBoxClear _
  160.                 (ListBox:=pvtListBox)
  161. End Function
  162.  
  163. Public Property Get ListBox() As Variant
  164. Attribute ListBox.VB_Description = "Sets the underlying ListBox"
  165.     Set ListBox = pvtListBox
  166. End Property
  167.  
  168. Public Function ListCount(Optional ListBox As Variant) As Long
  169. Attribute ListCount.VB_Description = "Returns the ListCount property of the underlying ListBox"
  170. ' Returns the ListBox's ListCount property
  171. ' Note:  this method should be used as follows:
  172. '       MyListCount = _
  173. '           MyVBFWListBoxWrapper.ListCount
  174. '                (MyListBox)
  175. '   (although 'MyListBox' is optional)
  176.     
  177.     On Local Error Resume Next
  178.  
  179. ' bullet-proofing
  180.     If Not pvtIsFullyInitialized _
  181.         (ListBox:=ListBox) _
  182.     Then
  183.         Exit Function
  184.     End If
  185.  
  186.     ListCount = _
  187.         pvtCollection. _
  188.             pvtListBoxListCount _
  189.                 (ListBox:=pvtListBox)
  190.  
  191. End Function
  192.  
  193. Public Property Get ListIndex() As Long
  194. Attribute ListIndex.VB_Description = "Sets the ListIndex property of the underlying ListBox"
  195. ' Returnss the ListBox's ListIndex
  196. ' Note:  this method should be used as follows:
  197. '   MyListIndex = _
  198. '       MyVBFWListBoxWrapper.ListIndex
  199.     
  200.     On Local Error Resume Next
  201.  
  202. ' bullet-proofing
  203.     If Not pvtIsFullyInitialized() _
  204.     Then
  205.         Exit Property
  206.     End If
  207.  
  208.     ListIndex = _
  209.         pvtCollection. _
  210.             pvtListBoxListIndex _
  211.                 (pvtListBox)
  212.  
  213. End Property
  214.  
  215. Public Property Let ListIndex(ListIndex As Long)
  216. ' Sets the ListBox's ListIndex
  217. ' Note:  this method should be used as follows:
  218. '   MyVBFWListBoxWrapper.ListIndex = _
  219. '       MyListIndex
  220.     
  221.     On Local Error Resume Next
  222.     
  223. ' bullet-proofing
  224.     If Not pvtIsFullyInitialized() _
  225.     Then
  226.         Exit Property
  227.     End If
  228.  
  229.     pvtCollection. _
  230.         pvtListBoxListIndex _
  231.             (pvtListBox) = _
  232.                 ListIndex
  233.  
  234. End Property
  235.  
  236. Public Property Get ListIndexObject() As Variant
  237. Attribute ListIndexObject.VB_Description = "Sets the ListIndex property of the underlying ListBox according to the object"
  238. ' Returns the object at the ListBox's ListIndex
  239. ' Note:  this method should be coded as follows:
  240. '   Dim MyObject as MyObject
  241. '   Set MyObject = _
  242. '       MyVBFWListBoxWrapper.ListIndexObject
  243.     
  244.     On Local Error Resume Next
  245.  
  246. ' bullet-proofing
  247.     If Not pvtIsFullyInitialized() _
  248.     Then
  249.         Exit Property
  250.     End If
  251.  
  252.     Set ListIndexObject = _
  253.         pvtCollection. _
  254.             pvtListBoxListIndexObject _
  255.                 (pvtListBox)
  256. End Property
  257.  
  258.  
  259. Public Property Set ListIndexObject(Object As Variant)
  260. ' Sets the ListBox's ListIndex to correspond to the
  261. '   Object and returns the selected Object
  262. ' Note:  this method should be coded as follows:
  263. '   Dim MyObject as MyObject
  264. '   MyVBFWListBoxWrapper.ListIndexObject = _
  265. '           MyObject
  266.     
  267.     On Local Error Resume Next
  268.  
  269. ' bullet-proofing
  270.     If Not pvtIsFullyInitialized() _
  271.     Then
  272.         Exit Property
  273.     End If
  274.  
  275.     Set pvtCollection. _
  276.         pvtListBoxListIndexObject _
  277.             (pvtListBox) = _
  278.                 Object
  279.  
  280. End Property
  281.  
  282. Public Function Refresh(Optional ListBox As Variant, Optional DisplayOnly As Variant) As Boolean
  283. Attribute Refresh.VB_Description = "Refreshes the VBOFCollection and ListBox"
  284. ' Refreshes the display of the ListBox
  285. ' Note:  this method should be coded as follows:
  286. '   MyVBFWListBoxWrapper.Refresh
  287.     
  288.     On Local Error Resume Next
  289.  
  290. ' bullet-proofing
  291.     If Not pvtIsFullyInitialized _
  292.         (ListBox:=ListBox) _
  293.     Then
  294.         Exit Function
  295.     End If
  296.  
  297.     Refresh = _
  298.         pvtCollection. _
  299.             pvtListBoxRefresh _
  300.                 (ListBox:=pvtListBox)
  301. End Function
  302.  
  303. Public Function RemoveItem(Optional ListBox As Variant, Optional ListIndex As Variant) As Boolean
  304. Attribute RemoveItem.VB_Description = "Removes the Item from the ListBox and the underlying VBOFCollection"
  305. ' Removes the Object at the specified ListIndex
  306. '   from the ListBox
  307. ' Note:  this method should be coded as follows:
  308. '   Dim MyUndesiredListIndex As Long
  309. '   MyVBFWListBoxWrapper.RemoveListIndex _
  310. '      ListIndex:=MyUndesiredListIndex
  311.     
  312.     On Local Error Resume Next
  313.  
  314. ' bullet-proofing
  315.     If Not pvtIsFullyInitialized _
  316.         (ListBox:=ListBox) _
  317.     Then
  318.         Exit Function
  319.     End If
  320.  
  321.     RemoveItem = _
  322.         pvtCollection. _
  323.             pvtListBoxRemoveItem( _
  324.                 ListBox:=pvtListBox, _
  325.                 ListIndex:=ListIndex)
  326.  
  327. End Function
  328.  
  329. Public Function RemoveObject(Optional ListBox As Variant, Optional Object As Variant) As Boolean
  330. Attribute RemoveObject.VB_Description = "Removes the Object from the ListBox and the underlying VBOFCollection"
  331. ' Removes the specified Object from the ListBox
  332. ' Note:  this method should be coded as follows:
  333. '   Dim MyUndesiredObject As MyClass
  334. '   MyVBFWListBoxWrapper.RemoveObject _
  335. '      Object:=MyUndesiredObject
  336.     
  337.     On Local Error Resume Next
  338.  
  339. ' bullet-proofing
  340.     If Not pvtIsFullyInitialized _
  341.         (ListBox:=ListBox) _
  342.     Then
  343.         Exit Function
  344.     End If
  345.  
  346.     RemoveObject = _
  347.         pvtCollection. _
  348.             pvtListBoxRemoveObject( _
  349.                 ListBox:=pvtListBox, _
  350.                 Object:=Object)
  351.  
  352. End Function
  353.  
  354. Public Property Get SelectedObjects() As Collection
  355. Attribute SelectedObjects.VB_Description = "Returns a VB Collection containing the objects equating to the items in the ListBox which are selected"
  356. ' Returns a collection of the selected objects
  357. '   of the specified ListBox
  358. ' Note:  this method should be coded as follows:
  359. '   Dim MyCollection As Collection
  360. '   Set MyCollection = _
  361. '       MyVBFWListBoxWrapper.SelectedObjects
  362.     
  363.     On Local Error Resume Next
  364.  
  365. ' bullet-proofing
  366.     If Not pvtIsFullyInitialized() _
  367.     Then
  368.         Exit Property
  369.     End If
  370.  
  371.     Set SelectedObjects = _
  372.         pvtCollection. _
  373.             pvtListBoxSelectedObjects _
  374.                 (pvtListBox)
  375.             
  376. End Property
  377.  
  378. Public Property Set SelectedObjects(Collection As Collection)
  379. ' Sets the selected objects of the specified
  380. '   ListBox to the contents of Collection
  381. ' Note:  this method should be coded as follows:
  382. '   Dim MyCollection As Collection
  383. '   Set MyVBFWListBoxWrapper.SelectedObjects = _
  384. '       MyCollection
  385.     
  386.     On Local Error Resume Next
  387.  
  388. ' bullet-proofing
  389.     If Not pvtIsFullyInitialized() _
  390.     Then
  391.         Exit Property
  392.     End If
  393.  
  394.     Set pvtCollection. _
  395.         pvtListBoxSelectedObjects _
  396.             (pvtListBox) = _
  397.                 Collection
  398.         
  399. End Property
  400.  
  401. Public Property Get SelectObject() As Variant
  402. Attribute SelectObject.VB_Description = "Returns the object which is currently selected in the ListBox"
  403. ' Returns the selected object from the ListBox
  404. ' Note:  this method should be coded as follows:
  405. '   Dim MyDesiredObject As MyClass
  406. '   Set MyDesiredObject = _
  407. '       MyVBFWListBoxWrapper.SelectObject
  408.     
  409.     On Local Error Resume Next
  410.  
  411. ' bullet-proofing
  412.     If Not pvtIsFullyInitialized() _
  413.     Then
  414.         Exit Property
  415.     End If
  416.  
  417.     Set SelectObject = _
  418.         pvtCollection. _
  419.             pvtListBoxSelectObject _
  420.                 (pvtListBox)
  421.             
  422. End Property
  423.  
  424. Public Property Set SelectObject(Object As Variant)
  425. ' Selects the specified Object from the ListBox
  426. ' Note:  this method should be coded as follows:
  427. '   Dim MyDesiredObject As MyClass
  428. '   Set MyVBFWListBoxWrapper.SelectObject = _
  429. '       MyDesiredObject
  430.     
  431.     On Local Error Resume Next
  432.  
  433. ' bullet-proofing
  434.     If Not pvtIsFullyInitialized() _
  435.     Then
  436.         Exit Property
  437.     End If
  438.  
  439.     Set pvtCollection. _
  440.         pvtListBoxSelectObject _
  441.             (pvtListBox) = _
  442.                 Object
  443.  
  444. End Property
  445.  
  446. Public Property Get TopIndex() As Long
  447. Attribute TopIndex.VB_Description = "Maps to the ListBox.TopIndex property"
  448. ' Returns the ListBox's TopIndex property
  449. ' Note:  this method should be used as follows:
  450. '   MyTopIndex = _
  451. '       MyVBFWListBoxWrapper.TopIndex
  452.     
  453.     On Local Error Resume Next
  454.  
  455. ' bullet-proofing
  456.     If Not pvtIsFullyInitialized() _
  457.     Then
  458.         Exit Property
  459.     End If
  460.  
  461.     TopIndex = _
  462.         pvtCollection. _
  463.             pvtListBoxTopIndex _
  464.                 (pvtListBox)
  465.  
  466. End Property
  467.  
  468. Public Property Get Text() As String
  469. Attribute Text.VB_Description = "Retuens the Text property of the ComboBox"
  470. ' Returns the ComboBox's Text property
  471. ' Note:  this method should be used as follows:
  472. '   MyString = _
  473. '       MyVBFWListBoxWrapper.Text
  474.     
  475.     On Local Error Resume Next
  476.  
  477. ' bullet-proofing
  478.     If Not pvtIsFullyInitialized() _
  479.     Then
  480.         Exit Property
  481.     End If
  482.  
  483.     Text = _
  484.         pvtCollection. _
  485.             pvtComboBoxText _
  486.                 (pvtListBox)
  487.  
  488. End Property
  489. Public Property Let Text(aString As String)
  490. ' Sets the ComboBox's Text property to aString
  491. ' Note:  this method should be used as follows:
  492. '    MyVBFWListBoxWrapper.Text = _
  493. '        MyString
  494.     
  495.     On Local Error Resume Next
  496.  
  497. ' bullet-proofing
  498.     If Not pvtIsFullyInitialized() _
  499.     Then
  500.         Exit Property
  501.     End If
  502.  
  503.     pvtCollection. _
  504.         pvtComboBoxText _
  505.             (pvtListBox) = _
  506.                 aString
  507. End Property
  508.  
  509.  
  510. Public Property Let TopIndex(aLong As Long)
  511. ' Sets the ListBox's TopIndex property to aLong
  512. ' Note:  this method should be used as follows:
  513. '    MyVBFWListBoxWrapper.TopIndex = _
  514. '        MyTopIndex
  515.     
  516.     On Local Error Resume Next
  517.  
  518. ' bullet-proofing
  519.     If Not pvtIsFullyInitialized() _
  520.     Then
  521.         Exit Property
  522.     End If
  523.  
  524.     pvtCollection. _
  525.         pvtListBoxTopIndex _
  526.             (pvtListBox) = _
  527.                 aLong
  528.  
  529. End Property
  530.  
  531. Public Property Get TopObject() As Variant
  532. Attribute TopObject.VB_Description = "Maps to the object which occupies the ListBox.TopIndex property"
  533. ' Returns the Object at the ListBox's TopIndex property
  534. ' Note:  this method should be used as follows:
  535. '   Set MyTopObject = _
  536. '       MyVBFWListBoxWrapper.pvtListBoxTopObject
  537.     
  538.     On Local Error Resume Next
  539.  
  540. ' bullet-proofing
  541.     If Not pvtIsFullyInitialized() _
  542.     Then
  543.         Exit Property
  544.     End If
  545.  
  546.     Set TopObject = _
  547.         pvtCollection. _
  548.             pvtListBoxTopObject _
  549.                 (ListBox:=pvtListBox)
  550.  
  551. End Property
  552.  
  553. Public Property Set TopObject(Object As Variant)
  554. ' Sets the ListBox's TopIndex property to the
  555. '   position of Object
  556. ' Note:  this method should be used as follows:
  557. '   Set MyVBFWListBoxWrapper.TopObject = _
  558. '       MyTopObject
  559.     
  560.     On Local Error Resume Next
  561.  
  562. ' bullet-proofing
  563.     If Not pvtIsFullyInitialized() _
  564.     Then
  565.         Exit Property
  566.     End If
  567.  
  568.     pvtCollection. _
  569.         pvtListBoxTopObject _
  570.             (pvtListBox) = _
  571.                 Object
  572. End Property
  573.  
  574.  
  575. Public Property Get ObjectManager() As VBOFObjectManager
  576. ' Return my reference to the VBOFObjectManager
  577.     
  578.     Set ObjectManager = pvtVBOFObjectManager
  579. End Property
  580.  
  581. Public Property Set ObjectManager(anObjectManager As VBOFObjectManager)
  582. ' Set my reference to the VBOFObjectManager
  583.     
  584.     Set pvtVBOFObjectManager = anObjectManager
  585. End Property
  586.  
  587. Public Property Set Collection(Collection As Variant)
  588. Attribute Collection.VB_Description = "Sets the underlying VBOFCollection"
  589.     
  590.     If Collection Is Nothing Then
  591.         Set pvtCollection = Nothing
  592.         Exit Property
  593.     End If
  594.     
  595.     pvtVerifyCollection _
  596.         Collection:=Collection, _
  597.         Verbose:=True
  598. End Property
  599.  
  600. Public Property Get Collection() As Variant
  601. ' Returns my VBOFCollection object
  602.  
  603.     Set Collection = pvtCollection
  604. End Property
  605.  
  606.  
  607. Public Property Set ListBox(ListBox As Variant)
  608.     pvtVerifyListBox _
  609.         ListBox:=ListBox
  610. End Property
  611.  
  612. Private Function pvtVerifyListBox(Optional ListBox As Variant, Optional Verbose As Variant) As Boolean
  613.     pvtVerifyListBox = _
  614.         ObjectManager. _
  615.             pvtWrapperVerifyControl( _
  616.                 Control:=ListBox, _
  617.                 pvtControl:=pvtListBox, _
  618.                 Verbose:=Verbose)
  619. End Function
  620.  
  621. Private Function pvtUseListBox(Optional ListBoxParm As Variant, Optional Verbose As Variant) As Variant
  622.     Set pvtUseListBox = _
  623.         ObjectManager. _
  624.             pvtWrapperUseControl( _
  625.                 ControlParm:=ListBoxParm, _
  626.                 pvtControl:=pvtListBox, _
  627.                 SupportedNames:=pvtSupportedTypeNames, _
  628.                 Verbose:=Verbose, _
  629.                 WrapperName:="ListBox")
  630. End Function
  631.  
  632. Private Function pvtErrorMessage(Optional ErrorMessage As Variant) As Long
  633.     pvtErrorMessage = _
  634.         pvtVBOFObjectManager.DisplayErrorMessage _
  635.             (ErrorMessage)
  636. End Function
  637.  
  638. Private Function pvtIsFullyInitialized(Optional Collection As Variant, Optional ListBox As Variant, Optional Verbose As Variant) As Boolean
  639.     
  640.     If Not pvtVerifyCollection( _
  641.         Collection:=Collection, _
  642.         Verbose:=Verbose) _
  643.     Then
  644.         pvtIsFullyInitialized = False
  645.         Exit Function
  646.     End If
  647.     
  648.     If Not pvtVerifyListBox( _
  649.         ListBox:=ListBox, _
  650.         Verbose:=Verbose) _
  651.     Then
  652.         pvtIsFullyInitialized = False
  653.         Exit Function
  654.     End If
  655.  
  656.     pvtIsFullyInitialized = True
  657. End Function
  658.  
  659. Private Function pvtUseCollection(Optional CollectionParm As Variant, Optional Verbose As Variant) As Variant
  660.     Set pvtUseCollection = _
  661.         ObjectManager. _
  662.             pvtWrapperUseCollection( _
  663.                 CollectionParm:=CollectionParm, _
  664.                 pvtCollection:=pvtCollection, _
  665.                 Verbose:=Verbose, _
  666.                 WrapperName:="ListBox")
  667. End Function
  668.  
  669.  
  670. Private Function pvtVerifyCollection(Optional Collection As Variant, Optional Verbose As Variant) As Boolean
  671.     pvtVerifyCollection = _
  672.         ObjectManager. _
  673.             pvtWrapperVerifyCollection( _
  674.                 Collection:=Collection, _
  675.                 pvtCollection:=pvtCollection, _
  676.                 Verbose:=Verbose, _
  677.                 WrapperName:="ListBox")
  678. End Function
  679.  
  680.  
  681. Private Sub Class_Initialize()
  682.     pvtSupportedTypeNames = "ListBox ComboBox"
  683. End Sub
  684.  
  685. Private Sub Class_Terminate()
  686.     If Not ObjectManager Is Nothing Then
  687.         ObjectManager.TerminateObject _
  688.             Object:=Me
  689.     End If
  690. End Sub
  691.  
  692.