home *** CD-ROM | disk | FTP | other *** search
/ Planet Source Code Jumbo …e CD Visual Basic 1 to 7 / 1_2002.ISO / Data / Zips / CODE_UPLOAD8554832000.psc / LstViewModEnh.bas < prev    next >
Encoding:
BASIC Source File  |  2000-08-03  |  75.1 KB  |  1,830 lines

  1. Attribute VB_Name = "LstViewModEnh"
  2.     
  3. 'Respect to: John Allan Lee for the enhancements to the ListView control used here
  4. ' Email Address: zero42@quik.com
  5.  
  6. ' Includes: EnhListView_ResizeColumns(lstListViewName As ListView, Optional bolShowErrors As Boolean) As Boolean
  7. ' Type: Public Function
  8. ' Description: Resizes all Columns in a ListView to fit the text in the rows
  9. '
  10. ' Includes: EnhListView_SortColumns(lstListViewName As ListView, usdColIndex, Optional bolShowErrors As Boolean) As Boolean
  11. ' Type: Public Function
  12. ' Description: Use on ColumnClick to sort by that Column  Toggles between Ascending and Descending Sorts
  13. '
  14. ' Includes: EnhListView_ResizeColumnCaptions(lstListViewName As ListView, Optional bolShowErrors As Boolean) As Boolean
  15. ' Type: Public Function
  16. ' Description: Resizes all Columns in a ListView to the Text in the Column Caption
  17. '
  18. ' Includes: EnhListView_ResizeColumnHeaders(lstListViewName As ListView, Optional bolShowErrors As Boolean) As Boolean
  19. ' Type: Public Function
  20. ' Description: Resizes the ColumnHeaders in a ListView to the Width  of the ListView
  21. '
  22. ' Includes: EnhListView_Add_FullRowSelect( lstListViewName As ListView, Optional bolShowErrors As Boolean) As Boolean
  23. ' Type: Public Function
  24. ' Description: Enables Full Row Select in a ListView
  25. '
  26. ' Includes: EnhListView_Rem_FullRowSelect( lstListViewName As ListView, Optional bolShowErrors As Boolean) As Boolean
  27. ' Type: Public Function
  28. ' Description: Disables Full Row Select in a ListView
  29. '
  30. ' Includes: EnhListView_Add_GridLines( lstListViewName As ListView, Optional bolShowErrors As Boolean) As Boolean
  31. ' Type: Public Function
  32. ' Description: Enables GridLines in a ListView
  33. '
  34. ' Includes: EnhListView_Rem_GridLines( lstListViewName As ListView, Optional bolShowErrors As Boolean) As Boolean
  35. ' Type: Public Function
  36. ' Description: Disables GridLines in a ListView
  37. '
  38. ' Includes: EnhListView_Add_CheckBoxes( lstListViewName As ListView, Optional bolShowErrors As Boolean) As Boolean
  39. ' Type: Public Function
  40. ' Description: Enables CheckBoxes in a ListView
  41. '
  42. ' Includes: EnhListView_Rem_CheckBoxes( lstListViewName As ListView, Optional bolShowErrors As Boolean) As Boolean
  43. ' Type: Public Function
  44. ' Description: Disables CheckBoxes in a ListView
  45. '
  46. ' Includes: EnhListView_Add_AllowRepositioning( lstListViewName As ListView, Optional bolShowErrors As Boolean) As Boolean
  47. ' Type: Public Function
  48. ' Description: Enables Repositioning of ColumnHeaders in a ListView
  49. '
  50. ' Includes: EnhListView_Rem_AllowRepositioning( lstListViewName As ListView, Optional bolShowErrors As Boolean) As Boolean
  51. ' Type: Public Function
  52. ' Description: Disables Repositioning of ColumnHeaders in a ListView
  53. '
  54. ' Includes: EnhListView_Add_TrackSelected( lstListViewName As ListView, Optional bolShowErrors As Boolean) As Boolean
  55. ' Type: Public Function
  56. ' Description: Enables TrackSelected in a ListView
  57. '
  58. ' Includes: EnhListView_Rem_TrackSelected( lstListViewName As ListView, Optional bolShowErrors As Boolean) As Boolean
  59. ' Type: Public Function
  60. ' Description: Disables TrackSelected in a ListView
  61. '
  62. ' Includes: EnhListView_Add_OneClickActivate( lstListViewName As ListView, Optional bolShowErrors As Boolean) As Boolean
  63. ' Type: Public Function
  64. ' Description: Enables One Click Activate in a ListView
  65. '
  66. ' Includes: EnhListView_Rem_OneClickActivate( lstListViewName As ListView, Optional bolShowErrors As Boolean) As Boolean
  67. ' Type: Public Function
  68. ' Description: Disables One Click Activate in a ListView
  69. '
  70. ' Includes: EnhListView_Add_TwoClickActivate( lstListViewName As ListView, Optional bolShowErrors As Boolean) As Boolean
  71. ' Type: Public Function
  72. ' Description: Enables Two Click Activate in a ListView
  73. '
  74. ' Includes: EnhListView_Rem_TwoClickActivate( lstListViewName As ListView, Optional bolShowErrors As Boolean) As Boolean
  75. ' Type: Public Function
  76. ' Description: Enables Full Row Select in a ListView
  77. '
  78. ' Includes: EnhListView_Add_SubitemImages( lstListViewName As ListView, Optional bolShowErrors As Boolean) As Boolean
  79. ' Type: Public Function
  80. ' Description: Enables SubItem Images in a ListView
  81. '
  82. ' Includes: EnhListView_Rem_SubitemImages( lstListViewName As ListView, Optional bolShowErrors As Boolean) As Boolean
  83. ' Type: Public Function
  84. ' Description: Disables SubItem Images in a ListView
  85. '
  86. ' Includes: EnhLitView_CheckAllItems( lstListViewName As ListView, Optional bolShowErrors As Boolean) As Boolean
  87. ' Type: Public Function
  88. ' Description: Checks all Items in the ListView
  89. '
  90. ' Includes: EnhLitView_UnCheckAllItems( lstListViewName As ListView, Optional bolShowErrors As Boolean) As Boolean
  91. ' Type: Public Function
  92. ' Description: Unchecks all items in a ListView
  93. '
  94. ' Includes: EnhListView_InvertAllChecks( lstListViewName As ListView, Optional bolShowErrors As Boolean) As Boolean
  95. ' Type: Public Function
  96. ' Description: Inverts all checked items in a ListView
  97. '
  98. ' Includes: EnhListView_Toggle_FlatColumnHeaders( frmFormName As Form, lstListViewName As ListView, Optional bolShowErrors As Boolean) As Boolean
  99. ' Type: Public Function
  100. ' Description: Toggles FlatColumnHeaders in a ListView
  101. '
  102. ' Variable Name: LengthPerCharacter
  103. ' Type: Long
  104. ' Description: Used to set the length in twips per character for column spacing  Defaults to 80 if not specified
  105.  
  106. Option Explicit
  107.  
  108. '=======================================================================
  109. ' needed for Enhancements
  110. Private Const LVIS_STATEIMAGEMASK As Long = &HF000
  111.  
  112. Private Type LVITEM
  113.     mask         As Long
  114.     iItem        As Long
  115.     iSubItem     As Long
  116.     state        As Long
  117.     stateMask    As Long
  118.     pszText      As String
  119.     cchTextMax   As Long
  120.     iImage       As Long
  121.     lParam       As Long
  122.     iIndent      As Long
  123. End Type
  124.  
  125. Const SWP_DRAWFRAME = &H20
  126. Const SWP_NOMOVE = &H2
  127. Const SWP_NOSIZE = &H1
  128. Const SWP_NOZORDER = &H4
  129.  
  130. Private Const LVS_EX_FULLROWSELECT = &H20
  131. Private Const LVS_EX_GRIDLINES = &H1
  132. Private Const LVS_EX_CHECKBOXES As Long = &H4
  133. Private Const LVS_EX_HEADERDRAGDROP = &H10
  134. Private Const LVS_EX_TRACKSELECT = &H8
  135. Private Const LVS_EX_ONECLICKACTIVATE = &H40
  136. Private Const LVS_EX_TWOCLICKACTIVATE = &H80
  137. Private Const LVS_EX_SUBITEMIMAGES = &H2
  138.  
  139. Private Const LVM_FIRST = &H1000
  140. Private Const LVM_SETEXTENDEDLISTVIEWSTYLE = LVM_FIRST + 54
  141. Private Const LVM_GETEXTENDEDLISTVIEWSTYLE = LVM_FIRST + 55
  142. Private Const LVM_GETHEADER = (LVM_FIRST + 31)
  143.  
  144. Public Const LVIF_STATE = &H8
  145. Public Const LVM_SETITEMSTATE = (LVM_FIRST + 43)
  146. Public Const LVM_GETITEMSTATE As Long = (LVM_FIRST + 44)
  147.  
  148. Private Const HDS_BUTTONS = &H2
  149. Private Const GWL_STYLE = (-16)
  150.  
  151. Private Const SWP_FLAGS = SWP_NOZORDER Or SWP_NOSIZE Or SWP_NOMOVE Or SWP_DRAWFRAME
  152.  
  153. Public Declare Function SendMessageAny _
  154.                         Lib "user32" _
  155.                         Alias "SendMessageA" _
  156.                         (ByVal hWnd As Long, _
  157.                         ByVal Msg As Long, _
  158.                         ByVal wParam As Long, _
  159.                         lParam As Any) _
  160.                         As Long
  161.  
  162. Private Declare Function SendMessageLong Lib _
  163.                         "user32" Alias _
  164.                         "SendMessageA" _
  165.                         (ByVal hWnd As Long, _
  166.                         ByVal Msg As Long, _
  167.                         ByVal wParam As Long, _
  168.                         ByVal lParam As Long) _
  169.                         As Long
  170.                         
  171. Private Declare Function GetWindowLong _
  172.                         Lib "user32" _
  173.                         Alias "GetWindowLongA" _
  174.                         (ByVal hWnd As Long, _
  175.                         ByVal nIndex As Long) _
  176.                         As Long
  177.                         
  178. Private Declare Function SetWindowLong _
  179.                         Lib "user32" _
  180.                         Alias "SetWindowLongA" _
  181.                         (ByVal hWnd As Long, _
  182.                         ByVal nIndex As Long, _
  183.                         ByVal dwNewLong As Long) _
  184.                         As Long
  185.                         
  186. Private Declare Function SetWindowPos _
  187.                         Lib "user32" _
  188.                         (ByVal hWnd As Long, _
  189.                         ByVal hWndInsertAfter As Long, _
  190.                         ByVal x As Long, _
  191.                         ByVal Y As Long, _
  192.                         ByVal cx As Long, _
  193.                         ByVal cy As Long, _
  194.                         ByVal wFlags As Long) _
  195.                         As Long
  196.  
  197. Public LengthPerCharacter As Long
  198.  
  199. Public Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hWnd As Long, ByVal lpOperation As _
  200.                     String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
  201.  
  202. '=======================================================================
  203. ' Description: Resizes all Columns in a ListView to fit the text in
  204. '              the rows
  205. '=======================================================================
  206. Public Function EnhListView_ResizeColumns( _
  207.                 lstListViewName As ListView, _
  208.                 Optional bolShowErrors As Boolean) _
  209.                 As Boolean
  210.     '_______________________________________________________________________
  211.     ' initiate error handler
  212.     On Error GoTo err_EnhListView_ResizeColumns
  213.     
  214.     '_______________________________________________________________________
  215.     ' set function return to true
  216.     EnhListView_ResizeColumns = True
  217.     
  218.     '_______________________________________________________________________
  219.     ' if the user has not set LengthPerCharacter use 80
  220.     If LengthPerCharacter = 0 Then LengthPerCharacter = "80"
  221.     
  222.     '_______________________________________________________________________
  223.     ' if there are columns to go through...
  224.     If lstListViewName.ListItems.Count > 0 Then
  225.         ' setup variables
  226.         Dim lngIndexCounter As Long
  227.         Dim lngColumnCounter As Long
  228.         ' move through each column
  229.         For lngColumnCounter = 1 To lstListViewName.ColumnHeaders.Count
  230.             ' move though each entry
  231.             For lngIndexCounter = 1 To lstListViewName.ListItems.Count
  232.                 ' if it is not the first column
  233.                 If lngColumnCounter > 1 Then
  234.                     ' size the column 85 twips per letter
  235.                     If Len(lstListViewName.ListItems.Item(lngIndexCounter).SubItems(lngColumnCounter - 1)) * LengthPerCharacter > _
  236.                     lstListViewName.ColumnHeaders.Item(lngColumnCounter).Width Then
  237.                         lstListViewName.ColumnHeaders.Item(lngColumnCounter).Width = _
  238.                         Len(lstListViewName.ListItems.Item(lngIndexCounter).SubItems(lngColumnCounter - 1)) * LengthPerCharacter
  239.                     End If
  240.                 ' if it is the first column
  241.                 Else
  242.                     ' size the column 85 twips per letter
  243.                     If Len(lstListViewName.ListItems.Item(lngIndexCounter).Text) * LengthPerCharacter > _
  244.                     lstListViewName.ColumnHeaders.Item(lngColumnCounter).Width Then
  245.                         lstListViewName.ColumnHeaders.Item(lngColumnCounter).Width = _
  246.                         Len(lstListViewName.ListItems.Item(lngIndexCounter).Text) * LengthPerCharacter
  247.                     End If
  248.                 End If
  249.             Next lngIndexCounter
  250.         Next lngColumnCounter
  251.     End If
  252.     
  253.     '_______________________________________________________________________
  254.     ' exit before error handler
  255.     Exit Function
  256.     
  257. '_______________________________________________________________________
  258. ' deal with errors
  259. err_EnhListView_ResizeColumns:
  260.     
  261.     '_______________________________________________________________________
  262.     ' set function return to false
  263.     EnhListView_ResizeColumns = False
  264.     '_______________________________________________________________________
  265.     ' if you want notification on an error
  266.     If bolShowErrors = True Then
  267.         MsgBox "Error" & Err.Number & vbTab & Err.Description, _
  268.                vbOKOnly + vbInformation, _
  269.                "Error in Function : EnhListView_ResizeColumns"
  270.     End If
  271.     
  272.     '_______________________________________________________________________
  273.     ' initiate debug
  274.     Debug.Print Now & vbTab & "Error in function: EnhListView_ResizeColumns" _
  275.                 & vbCrLf & _
  276.                 Err.Number & vbTab & Err.Description
  277.     Debug.Assert False
  278.     
  279.     '_______________________________________________________________________
  280.     ' exit
  281.     Exit Function
  282.     
  283. End Function
  284. '=======================================================================
  285.  
  286. '=======================================================================
  287. ' Description: Use on ColumnClick to sort by that Column
  288. '              Toggles between Ascending and Descending Sorts
  289. '=======================================================================
  290. Public Function EnhListView_SortColumns( _
  291.                 lstListViewName As ListView, _
  292.                 usdColIndex, _
  293.                 Optional bolShowErrors As Boolean) _
  294.                 As Boolean
  295.     
  296.     '_______________________________________________________________________
  297.     ' initiate error handler
  298.     On Error GoTo err_EnhListView_SortColumns
  299.     
  300.     '_______________________________________________________________________
  301.     ' set function return to true
  302.     EnhListView_SortColumns = True
  303.     
  304.     '_______________________________________________________________________
  305.     ' if there are columns to go through...
  306.     If lstListViewName.ListItems.Count > 0 Then
  307.         ' if the sort property is turned off turn it on
  308.         If lstListViewName.Sorted = False Then lstListViewName.Sorted = True
  309.         ' set the sortby column
  310.         lstListViewName.SortKey = _
  311.             lstListViewName.ColumnHeaders.Item(usdColIndex).Index - 1
  312.         ' if it's sorted ascending
  313.         If lstListViewName.SortOrder = lvwAscending Then
  314.             ' sort it descending
  315.             lstListViewName.SortOrder = lvwDescending
  316.         ' if it's sorted descending
  317.         Else
  318.             ' sort it ascending
  319.             lstListViewName.SortOrder = lvwAscending
  320.         End If
  321.     End If
  322.     
  323.     '_______________________________________________________________________
  324.     ' exit before error handler
  325.     Exit Function
  326.     
  327. '_______________________________________________________________________
  328. ' deal with errors
  329. err_EnhListView_SortColumns:
  330.     
  331.     '_______________________________________________________________________
  332.     ' set function return to false
  333.     EnhListView_SortColumns = False
  334.     '_______________________________________________________________________
  335.     ' if you want notification on an error
  336.     If bolShowErrors = True Then
  337.         MsgBox "Error" & Err.Number & vbTab & Err.Description, _
  338.                vbOKOnly + vbInformation, _
  339.                "Error in Function : EnhListView_SortColumns"
  340.     End If
  341.     
  342.     '_______________________________________________________________________
  343.     ' initiate debug
  344.     Debug.Print Now & vbTab & "Error in function: EnhListView_SortColumns" _
  345.                 & vbCrLf & _
  346.                 Err.Number & vbTab & Err.Description
  347.     Debug.Assert False
  348.     
  349.     '_______________________________________________________________________
  350.     ' exit
  351.     Exit Function
  352.     
  353. End Function
  354. '=======================================================================
  355.  
  356. '=======================================================================
  357. ' Description: Resizes all Columns in a ListView to the Text in the
  358. '              Column Caption
  359. '=======================================================================
  360. Public Function EnhListView_ResizeColumnCaptions( _
  361.                 lstListViewName As ListView, _
  362.                 Optional bolShowErrors As Boolean) _
  363.                 As Boolean
  364.     
  365.     '_______________________________________________________________________
  366.     ' initiate error handler
  367.     On Error GoTo err_EnhListView_ResizeColumnCaptions
  368.     
  369.     '_______________________________________________________________________
  370.     ' set function return to true
  371.     EnhListView_ResizeColumnCaptions = True
  372.     
  373.     '_______________________________________________________________________
  374.     ' if the user has not set LengthPerCharacter use 80
  375.     If LengthPerCharacter = 0 Then LengthPerCharacter = "80"
  376.     
  377.     '_______________________________________________________________________
  378.     ' if there are columns to go through...
  379.     If lstListViewName.ListItems.Count > 0 Then
  380.         ' setup variables
  381.         Dim lngColumnCounter As Long
  382.         ' move through each column
  383.         For lngColumnCounter = 1 To lstListViewName.ColumnHeaders.Count
  384.             ' make the size of the column equal to 85 twips per character
  385.             lstListViewName.ColumnHeaders.Item(lngColumnCounter).Width = _
  386.             Len(lstListViewName.ColumnHeaders.Item(lngColumnCounter).Text) * LengthPerCharacter
  387.         Next lngColumnCounter
  388.     End If
  389.     
  390.     '_______________________________________________________________________
  391.     ' exit before error handler
  392.     Exit Function
  393.     
  394. '_______________________________________________________________________
  395. ' deal with errors
  396. err_EnhListView_ResizeColumnCaptions:
  397.     
  398.     '_______________________________________________________________________
  399.     ' set function return to false
  400.     EnhListView_ResizeColumnCaptions = False
  401.     '_______________________________________________________________________
  402.     ' if you want notification on an error
  403.     If bolShowErrors = True Then
  404.         MsgBox "Error" & Err.Number & vbTab & Err.Description, _
  405.                vbOKOnly + vbInformation, _
  406.                "Error in Function : EnhListView_ResizeColumnCaptions"
  407.     End If
  408.     
  409.     '_______________________________________________________________________
  410.     ' initiate debug
  411.     Debug.Print Now & vbTab & "Error in function: EnhListView_ResizeColumnCaptions" _
  412.                 & vbCrLf & _
  413.                 Err.Number & vbTab & Err.Description
  414.     Debug.Assert False
  415.     
  416.     '_______________________________________________________________________
  417.     ' exit
  418.     Exit Function
  419.     
  420. End Function
  421. '=======================================================================
  422.  
  423. '=======================================================================
  424. ' Description: Resizes the ColumnHeaders in a ListView to the Width
  425. '              of the ListView
  426. '=======================================================================
  427. Public Function EnhListView_ResizeColumnHeaders( _
  428.                 lstListViewName As ListView, _
  429.                 Optional bolShowErrors As Boolean) _
  430.                 As Boolean
  431.     
  432.     '________________________________________________________________________
  433.     ' initiate error handler
  434.     On Error GoTo err_EnhListView_ResizeColumnHeaders
  435.     
  436.     '________________________________________________________________________
  437.     ' set function return to true
  438.     EnhListView_ResizeColumnHeaders = True
  439.     
  440.     '________________________________________________________________________
  441.     ' setup variables
  442.     Dim lngColCounter As Long
  443.     Dim lngListViewDiv As Long
  444.     
  445.     '________________________________________________________________________
  446.     ' fill variables
  447.     lngListViewDiv = lstListViewName.Width / lstListViewName.ColumnHeaders.Count - 300
  448.     
  449.     '________________________________________________________________________
  450.     For lngColCounter = 1 To lstListViewName.ColumnHeaders.Count
  451.         lstListViewName.ColumnHeaders(lngColCounter).Width = lngListViewDiv
  452.     Next lngColCounter
  453.     
  454.     '________________________________________________________________________
  455.     ' exit before error handler
  456.     Exit Function
  457.     
  458. '________________________________________________________________________
  459. ' deal with errors
  460. err_EnhListView_ResizeColumnHeaders:
  461.     
  462.     '________________________________________________________________________
  463.     ' set function return to false
  464.     EnhListView_ResizeColumnHeaders = False
  465.     '________________________________________________________________________
  466.     ' if you want notification on an error
  467.     If bolShowErrors = True Then
  468.         MsgBox "Error" & Err.Number & vbTab & Err.Description, _
  469.                vbOKOnly + vbInformation, _
  470.                "Error in Function : EnhListView_ResizeColumnHeaders"
  471.     End If
  472.     
  473.     '________________________________________________________________________
  474.     ' initiate debug
  475.     Debug.Print Now & vbTab & "Error in function: EnhListView_ResizeColumnHeaders" _
  476.                 & vbCrLf & _
  477.                 Err.Number & vbTab & Err.Description
  478.     Debug.Assert False
  479.     
  480.     '________________________________________________________________________
  481.     ' exit
  482.     Exit Function
  483.     
  484. End Function
  485. '=======================================================================
  486.  
  487. '=======================================================================
  488. ' Description: Enables Full Row Select in a ListView
  489. '=======================================================================
  490. Public Function EnhListView_Add_FullRowSelect( _
  491.                 lstListViewName As ListView, _
  492.                 Optional bolShowErrors As Boolean) _
  493.                 As Boolean
  494.     
  495.     '________________________________________________________________________
  496.     ' initiate error handler
  497.     On Error GoTo err_EnhListView_Add_FullRowSelect
  498.     
  499.     '________________________________________________________________________
  500.     ' set function return to true
  501.     EnhListView_Add_FullRowSelect = True
  502.     
  503.     '________________________________________________________________________
  504.     ' setup variables
  505.     Dim rStyle  As Long
  506.     Dim r       As Long
  507.     
  508.     '________________________________________________________________________
  509.     ' get the current styles
  510.     rStyle = SendMessageLong(lstListViewName.hWnd, LVM_GETEXTENDEDLISTVIEWSTYLE, 0&, 0&)
  511.     
  512.     '________________________________________________________________________
  513.     ' add the selected style to the current styles
  514.     rStyle = rStyle Or LVS_EX_FULLROWSELECT
  515.     
  516.     '________________________________________________________________________
  517.     ' update the listview styles
  518.     SendMessageLong lstListViewName.hWnd, LVM_SETEXTENDEDLISTVIEWSTYLE, 0&, rStyle
  519.     
  520.     '________________________________________________________________________
  521.     ' exit before error handler
  522.     Exit Function
  523.     
  524. '________________________________________________________________________
  525. ' deal with errors
  526. err_EnhListView_Add_FullRowSelect:
  527.     
  528.     '________________________________________________________________________
  529.     ' set function return to false
  530.     EnhListView_Add_FullRowSelect = False
  531.     '________________________________________________________________________
  532.     ' if you want notification on an error
  533.     If bolShowErrors = True Then
  534.         MsgBox "Error" & Err.Number & vbTab & Err.Description, _
  535.                vbOKOnly + vbInformation, _
  536.                "Error in Function : EnhListView_Add_FullRowSelect"
  537.     End If
  538.     
  539.     '________________________________________________________________________
  540.     ' initiate debug
  541.     Debug.Print Now & vbTab & "Error in function: EnhListView_Add_FullRowSelect" _
  542.                 & vbCrLf & _
  543.                 Err.Number & vbTab & Err.Description
  544.     Debug.Assert False
  545.     
  546.     '________________________________________________________________________
  547.     ' exit
  548.     Exit Function
  549.     
  550. End Function
  551. '=======================================================================
  552.  
  553. '=======================================================================
  554. ' Description: Disables Full Row Select in a ListView
  555. '=======================================================================
  556. Public Function EnhListView_Rem_FullRowSelect( _
  557.                 lstListViewName As ListView, _
  558.                 Optional bolShowErrors As Boolean) _
  559.                 As Boolean
  560.     
  561.     '________________________________________________________________________
  562.     ' initiate error handler
  563.     On Error GoTo err_EnhListView_Rem_FullRowSelect
  564.     
  565.     '________________________________________________________________________
  566.     ' set function return to true
  567.     EnhListView_Rem_FullRowSelect = True
  568.     
  569.     '________________________________________________________________________
  570.     ' setup variables
  571.     Dim rStyle  As Long
  572.     Dim r       As Long
  573.     
  574.     '________________________________________________________________________
  575.     ' get the current styles
  576.     rStyle = SendMessageLong(lstListViewName.hWnd, LVM_GETEXTENDEDLISTVIEWSTYLE, 0&, 0&)
  577.     
  578.     '________________________________________________________________________
  579.     ' remove the selected style from the current styles
  580.     rStyle = rStyle Xor LVS_EX_FULLROWSELECT
  581.     
  582.     '________________________________________________________________________
  583.     ' update the listview styles
  584.     SendMessageLong lstListViewName.hWnd, LVM_SETEXTENDEDLISTVIEWSTYLE, 0&, rStyle
  585.     
  586.     '________________________________________________________________________
  587.     ' exit before error handler
  588.     Exit Function
  589.     
  590. '________________________________________________________________________
  591. ' deal with errors
  592. err_EnhListView_Rem_FullRowSelect:
  593.     
  594.     '________________________________________________________________________
  595.     ' set function return to false
  596.     EnhListView_Rem_FullRowSelect = False
  597.     '________________________________________________________________________
  598.     ' if you want notification on an error
  599.     If bolShowErrors = True Then
  600.         MsgBox "Error" & Err.Number & vbTab & Err.Description, _
  601.                vbOKOnly + vbInformation, _
  602.                "Error in Function : EnhListView_Rem_FullRowSelect"
  603.     End If
  604.     
  605.     '________________________________________________________________________
  606.     ' initiate debug
  607.     Debug.Print Now & vbTab & "Error in function: EnhListView_Rem_FullRowSelect" _
  608.                 & vbCrLf & _
  609.                 Err.Number & vbTab & Err.Description
  610.     Debug.Assert False
  611.     
  612.     '________________________________________________________________________
  613.     ' exit
  614.     Exit Function
  615.     
  616. End Function
  617. '=======================================================================
  618.  
  619. '=======================================================================
  620. ' Description: Enables GridLines in a ListView
  621. '=======================================================================
  622. Public Function EnhListView_Add_GridLines( _
  623.                 lstListViewName As ListView, _
  624.                 Optional bolShowErrors As Boolean) _
  625.                 As Boolean
  626.     
  627.     '________________________________________________________________________
  628.     ' initiate error handler
  629.     On Error GoTo err_EnhListView_Add_GridLines
  630.     
  631.     '________________________________________________________________________
  632.     ' set function return to true
  633.     EnhListView_Add_GridLines = True
  634.     
  635.     '________________________________________________________________________
  636.     ' setup variables
  637.     Dim rStyle  As Long
  638.     Dim r       As Long
  639.     
  640.     '________________________________________________________________________
  641.     ' get the current styles
  642.     rStyle = SendMessageLong(lstListViewName.hWnd, LVM_GETEXTENDEDLISTVIEWSTYLE, 0&, 0&)
  643.     
  644.     '________________________________________________________________________
  645.     ' add the selected style to the current styles
  646.     rStyle = rStyle Or LVS_EX_GRIDLINES
  647.     
  648.     '________________________________________________________________________
  649.     ' update the listview styles
  650.     SendMessageLong lstListViewName.hWnd, LVM_SETEXTENDEDLISTVIEWSTYLE, 0&, rStyle
  651.     
  652.     '________________________________________________________________________
  653.     ' exit before error handler
  654.     Exit Function
  655.     
  656. '________________________________________________________________________
  657. ' deal with errors
  658. err_EnhListView_Add_GridLines:
  659.     
  660.     '________________________________________________________________________
  661.     ' set function return to false
  662.     EnhListView_Add_GridLines = False
  663.     '________________________________________________________________________
  664.     ' if you want notification on an error
  665.     If bolShowErrors = True Then
  666.         MsgBox "Error" & Err.Number & vbTab & Err.Description, _
  667.                vbOKOnly + vbInformation, _
  668.                "Error in Function : EnhListView_Add_GridLines"
  669.     End If
  670.     
  671.     '________________________________________________________________________
  672.     ' initiate debug
  673.     Debug.Print Now & vbTab & "Error in function: EnhListView_Add_GridLines" _
  674.                 & vbCrLf & _
  675.                 Err.Number & vbTab & Err.Description
  676.     Debug.Assert False
  677.     
  678.     '________________________________________________________________________
  679.     ' exit
  680.     Exit Function
  681.     
  682. End Function
  683. '=======================================================================
  684.  
  685. '=======================================================================
  686. ' Description: Disables GridLines in a ListView
  687. '=======================================================================
  688. Public Function EnhListView_Rem_GridLines( _
  689.                 lstListViewName As ListView, _
  690.                 Optional bolShowErrors As Boolean) _
  691.                 As Boolean
  692.     
  693.     '________________________________________________________________________
  694.     ' initiate error handler
  695.     On Error GoTo err_EnhListView_Rem_GridLines
  696.     
  697.     '________________________________________________________________________
  698.     ' set function return to true
  699.     EnhListView_Rem_GridLines = True
  700.     
  701.     '________________________________________________________________________
  702.     ' setup variables
  703.     Dim rStyle  As Long
  704.     Dim r       As Long
  705.     
  706.     '________________________________________________________________________
  707.     ' get the current styles
  708.     rStyle = SendMessageLong(lstListViewName.hWnd, LVM_GETEXTENDEDLISTVIEWSTYLE, 0&, 0&)
  709.     
  710.     '________________________________________________________________________
  711.     ' remove the selected style from the current styles
  712.     rStyle = rStyle Xor LVS_EX_GRIDLINES
  713.     
  714.     '________________________________________________________________________
  715.     ' update the listview styles
  716.     SendMessageLong lstListViewName.hWnd, LVM_SETEXTENDEDLISTVIEWSTYLE, 0&, rStyle
  717.     
  718.     '________________________________________________________________________
  719.     ' exit before error handler
  720.     Exit Function
  721.     
  722. '________________________________________________________________________
  723. ' deal with errors
  724. err_EnhListView_Rem_GridLines:
  725.     
  726.     '________________________________________________________________________
  727.     ' set function return to false
  728.     EnhListView_Rem_GridLines = False
  729.     '________________________________________________________________________
  730.     ' if you want notification on an error
  731.     If bolShowErrors = True Then
  732.         MsgBox "Error" & Err.Number & vbTab & Err.Description, _
  733.                vbOKOnly + vbInformation, _
  734.                "Error in Function : EnhListView_Rem_GridLines"
  735.     End If
  736.     
  737.     '________________________________________________________________________
  738.     ' initiate debug
  739.     Debug.Print Now & vbTab & "Error in function: EnhListView_Rem_GridLines" _
  740.                 & vbCrLf & _
  741.                 Err.Number & vbTab & Err.Description
  742.     Debug.Assert False
  743.     
  744.     '________________________________________________________________________
  745.     ' exit
  746.     Exit Function
  747.     
  748. End Function
  749. '=======================================================================
  750.  
  751. '=======================================================================
  752. ' Description: Enables CheckBoxes in a ListView
  753. '=======================================================================
  754. Public Function EnhListView_Add_CheckBoxes( _
  755.                 lstListViewName As ListView, _
  756.                 Optional bolShowErrors As Boolean) _
  757.                 As Boolean
  758.     
  759.     '________________________________________________________________________
  760.     ' initiate error handler
  761.     On Error GoTo err_EnhListView_Add_CheckBoxes
  762.     
  763.     '________________________________________________________________________
  764.     ' set function return to true
  765.     EnhListView_Add_CheckBoxes = True
  766.     
  767.     '________________________________________________________________________
  768.     ' setup variables
  769.     Dim rStyle  As Long
  770.     Dim r       As Long
  771.     
  772.     '________________________________________________________________________
  773.     ' get the current styles
  774.     rStyle = SendMessageLong(lstListViewName.hWnd, LVM_GETEXTENDEDLISTVIEWSTYLE, 0&, 0&)
  775.     
  776.     '________________________________________________________________________
  777.     ' add the selected style to the current styles
  778.     rStyle = rStyle Or LVS_EX_CHECKBOXES
  779.     
  780.     '________________________________________________________________________
  781.     ' update the listview styles
  782.     SendMessageLong lstListViewName.hWnd, LVM_SETEXTENDEDLISTVIEWSTYLE, 0&, rStyle
  783.     
  784.     '________________________________________________________________________
  785.     ' exit before error handler
  786.     Exit Function
  787.     
  788. '________________________________________________________________________
  789. ' deal with errors
  790. err_EnhListView_Add_CheckBoxes:
  791.     
  792.     '________________________________________________________________________
  793.     ' set function return to false
  794.     EnhListView_Add_CheckBoxes = False
  795.     '________________________________________________________________________
  796.     ' if you want notification on an error
  797.     If bolShowErrors = True Then
  798.         MsgBox "Error" & Err.Number & vbTab & Err.Description, _
  799.                vbOKOnly + vbInformation, _
  800.                "Error in Function : EnhListView_Add_CheckBoxes"
  801.     End If
  802.     
  803.     '________________________________________________________________________
  804.     ' initiate debug
  805.     Debug.Print Now & vbTab & "Error in function: EnhListView_Add_CheckBoxes" _
  806.                 & vbCrLf & _
  807.                 Err.Number & vbTab & Err.Description
  808.     Debug.Assert False
  809.     
  810.     '________________________________________________________________________
  811.     ' exit
  812.     Exit Function
  813.     
  814. End Function
  815. '=======================================================================
  816.  
  817. '=======================================================================
  818. ' Description: Disables CheckBoxes in a ListView
  819. '=======================================================================
  820. Public Function EnhListView_Rem_CheckBoxes( _
  821.                 lstListViewName As ListView, _
  822.                 Optional bolShowErrors As Boolean) _
  823.                 As Boolean
  824.     
  825.     '________________________________________________________________________
  826.     ' initiate error handler
  827.     On Error GoTo err_EnhListView_Rem_CheckBoxes
  828.     
  829.     '________________________________________________________________________
  830.     ' set function return to true
  831.     EnhListView_Rem_CheckBoxes = True
  832.     
  833.     '________________________________________________________________________
  834.     ' setup variables
  835.     Dim rStyle  As Long
  836.     Dim r       As Long
  837.     
  838.     '________________________________________________________________________
  839.     ' get the current styles
  840.     rStyle = SendMessageLong(lstListViewName.hWnd, LVM_GETEXTENDEDLISTVIEWSTYLE, 0&, 0&)
  841.     
  842.     '________________________________________________________________________
  843.     ' add the selected style to the current styles
  844.     rStyle = rStyle Xor LVS_EX_CHECKBOXES
  845.     
  846.     '________________________________________________________________________
  847.     ' update the listview styles
  848.     SendMessageLong lstListViewName.hWnd, LVM_SETEXTENDEDLISTVIEWSTYLE, 0&, rStyle
  849.     
  850.     '________________________________________________________________________
  851.     ' exit before error handler
  852.     Exit Function
  853.     
  854. '________________________________________________________________________
  855. ' deal with errors
  856. err_EnhListView_Rem_CheckBoxes:
  857.     
  858.     '________________________________________________________________________
  859.     ' set function return to false
  860.     EnhListView_Rem_CheckBoxes = False
  861.     '________________________________________________________________________
  862.     ' if you want notification on an error
  863.     If bolShowErrors = True Then
  864.         MsgBox "Error" & Err.Number & vbTab & Err.Description, _
  865.                vbOKOnly + vbInformation, _
  866.                "Error in Function : EnhListView_Rem_CheckBoxes"
  867.     End If
  868.     
  869.     '________________________________________________________________________
  870.     ' initiate debug
  871.     Debug.Print Now & vbTab & "Error in function: EnhListView_Rem_CheckBoxes" _
  872.                 & vbCrLf & _
  873.                 Err.Number & vbTab & Err.Description
  874.     Debug.Assert False
  875.     
  876.     '________________________________________________________________________
  877.     ' exit
  878.     Exit Function
  879.     
  880. End Function
  881. '=======================================================================
  882.  
  883. '=======================================================================
  884. ' Description: Enables Repositioning of ColumnHeaders in a ListView
  885. '=======================================================================
  886. Public Function EnhListView_Add_AllowRepositioning( _
  887.                 lstListViewName As ListView, _
  888.                 Optional bolShowErrors As Boolean) _
  889.                 As Boolean
  890.     
  891.     '________________________________________________________________________
  892.     ' initiate error handler
  893.     On Error GoTo err_EnhListView_Add_AllowRepositioning
  894.     
  895.     '________________________________________________________________________
  896.     ' set function return to true
  897.     EnhListView_Add_AllowRepositioning = True
  898.     
  899.     '________________________________________________________________________
  900.     ' setup variables
  901.     Dim rStyle  As Long
  902.     Dim r       As Long
  903.     
  904.     '________________________________________________________________________
  905.     ' get the current styles
  906.     rStyle = SendMessageLong(lstListViewName.hWnd, LVM_GETEXTENDEDLISTVIEWSTYLE, 0&, 0&)
  907.     
  908.     '________________________________________________________________________
  909.     ' add the selected style to the current styles
  910.     rStyle = rStyle Or LVS_EX_HEADERDRAGDROP
  911.     
  912.     '________________________________________________________________________
  913.     ' update the listview styles
  914.     SendMessageLong lstListViewName.hWnd, LVM_SETEXTENDEDLISTVIEWSTYLE, 0&, rStyle
  915.     
  916.     '________________________________________________________________________
  917.     ' exit before error handler
  918.     Exit Function
  919.     
  920. '________________________________________________________________________
  921. ' deal with errors
  922. err_EnhListView_Add_AllowRepositioning:
  923.     
  924.     '________________________________________________________________________
  925.     ' set function return to false
  926.     EnhListView_Add_AllowRepositioning = False
  927.     '________________________________________________________________________
  928.     ' if you want notification on an error
  929.     If bolShowErrors = True Then
  930.         MsgBox "Error" & Err.Number & vbTab & Err.Description, _
  931.                vbOKOnly + vbInformation, _
  932.                "Error in Function : EnhListView_Add_AllowRepositioning"
  933.     End If
  934.     
  935.     '________________________________________________________________________
  936.     ' initiate debug
  937.     Debug.Print Now & vbTab & "Error in function: EnhListView_Add_AllowRepositioning" _
  938.                 & vbCrLf & _
  939.                 Err.Number & vbTab & Err.Description
  940.     Debug.Assert False
  941.     
  942.     '________________________________________________________________________
  943.     ' exit
  944.     Exit Function
  945.     
  946. End Function
  947. '=======================================================================
  948.  
  949. '=======================================================================
  950. ' Description: Disables Repositioning of ColumnHeaders in a ListView
  951. '=======================================================================
  952. Public Function EnhListView_Rem_AllowRepositioning( _
  953.                 lstListViewName As ListView, _
  954.                 Optional bolShowErrors As Boolean) _
  955.                 As Boolean
  956.     
  957.     '________________________________________________________________________
  958.     ' initiate error handler
  959.     On Error GoTo err_EnhListView_Rem_AllowRepositioning
  960.     
  961.     '________________________________________________________________________
  962.     ' set function return to true
  963.     EnhListView_Rem_AllowRepositioning = True
  964.     
  965.     '________________________________________________________________________
  966.     ' setup variables
  967.     Dim rStyle  As Long
  968.     Dim r       As Long
  969.     
  970.     '________________________________________________________________________
  971.     ' get the current styles
  972.     rStyle = SendMessageLong(lstListViewName.hWnd, LVM_GETEXTENDEDLISTVIEWSTYLE, 0&, 0&)
  973.     
  974.     '________________________________________________________________________
  975.     ' add the selected style to the current styles
  976.     rStyle = rStyle Xor LVS_EX_HEADERDRAGDROP
  977.     
  978.     '________________________________________________________________________
  979.     ' update the listview styles
  980.     SendMessageLong lstListViewName.hWnd, LVM_SETEXTENDEDLISTVIEWSTYLE, 0&, rStyle
  981.     
  982.     '________________________________________________________________________
  983.     ' exit before error handler
  984.     Exit Function
  985.     
  986. '________________________________________________________________________
  987. ' deal with errors
  988. err_EnhListView_Rem_AllowRepositioning:
  989.     
  990.     '________________________________________________________________________
  991.     ' set function return to false
  992.     EnhListView_Rem_AllowRepositioning = False
  993.     '________________________________________________________________________
  994.     ' if you want notification on an error
  995.     If bolShowErrors = True Then
  996.         MsgBox "Error" & Err.Number & vbTab & Err.Description, _
  997.                vbOKOnly + vbInformation, _
  998.                "Error in Function : EnhListView_Rem_AllowRepositioning"
  999.     End If
  1000.     
  1001.     '________________________________________________________________________
  1002.     ' initiate debug
  1003.     Debug.Print Now & vbTab & "Error in function: EnhListView_Rem_AllowRepositioning" _
  1004.                 & vbCrLf & _
  1005.                 Err.Number & vbTab & Err.Description
  1006.     Debug.Assert False
  1007.     
  1008.     '________________________________________________________________________
  1009.     ' exit
  1010.     Exit Function
  1011.     
  1012. End Function
  1013. '=======================================================================
  1014.  
  1015. '=======================================================================
  1016. ' Description: Enables TrackSelected in a ListView
  1017. '=======================================================================
  1018. Public Function EnhListView_Add_TrackSelected( _
  1019.                 lstListViewName As ListView, _
  1020.                 Optional bolShowErrors As Boolean) _
  1021.                 As Boolean
  1022.     
  1023.     '________________________________________________________________________
  1024.     ' initiate error handler
  1025.     On Error GoTo err_EnhListView_Add_TrackSelected
  1026.     
  1027.     '________________________________________________________________________
  1028.     ' set function return to true
  1029.     EnhListView_Add_TrackSelected = True
  1030.     
  1031.     '________________________________________________________________________
  1032.     ' setup variables
  1033.     Dim rStyle  As Long
  1034.     Dim r       As Long
  1035.     
  1036.     '________________________________________________________________________
  1037.     ' get the current styles
  1038.     rStyle = SendMessageLong(lstListViewName.hWnd, LVM_GETEXTENDEDLISTVIEWSTYLE, 0&, 0&)
  1039.     
  1040.     '________________________________________________________________________
  1041.     ' add the selected style to the current styles
  1042.     rStyle = rStyle Or LVS_EX_TRACKSELECT
  1043.     
  1044.     '________________________________________________________________________
  1045.     ' update the listview styles
  1046.     SendMessageLong lstListViewName.hWnd, LVM_SETEXTENDEDLISTVIEWSTYLE, 0&, rStyle
  1047.     
  1048.     '________________________________________________________________________
  1049.     ' exit before error handler
  1050.     Exit Function
  1051.     
  1052. '________________________________________________________________________
  1053. ' deal with errors
  1054. err_EnhListView_Add_TrackSelected:
  1055.     
  1056.     '________________________________________________________________________
  1057.     ' set function return to false
  1058.     EnhListView_Add_TrackSelected = False
  1059.     '________________________________________________________________________
  1060.     ' if you want notification on an error
  1061.     If bolShowErrors = True Then
  1062.         MsgBox "Error" & Err.Number & vbTab & Err.Description, _
  1063.                vbOKOnly + vbInformation, _
  1064.                "Error in Function : EnhListView_Add_TrackSelected"
  1065.     End If
  1066.     
  1067.     '________________________________________________________________________
  1068.     ' initiate debug
  1069.     Debug.Print Now & vbTab & "Error in function: EnhListView_Add_TrackSelected" _
  1070.                 & vbCrLf & _
  1071.                 Err.Number & vbTab & Err.Description
  1072.     Debug.Assert False
  1073.     
  1074.     '________________________________________________________________________
  1075.     ' exit
  1076.     Exit Function
  1077.     
  1078. End Function
  1079. '=======================================================================
  1080.  
  1081. '=======================================================================
  1082. ' Description: Disables TrackSelected in a ListView
  1083. '=======================================================================
  1084. Public Function EnhListView_Rem_TrackSelected( _
  1085.                 lstListViewName As ListView, _
  1086.                 Optional bolShowErrors As Boolean) _
  1087.                 As Boolean
  1088.     
  1089.     '________________________________________________________________________
  1090.     ' initiate error handler
  1091.     On Error GoTo err_EnhListView_Rem_TrackSelected
  1092.     
  1093.     '________________________________________________________________________
  1094.     ' set function return to true
  1095.     EnhListView_Rem_TrackSelected = True
  1096.     
  1097.     '________________________________________________________________________
  1098.     ' setup variables
  1099.     Dim rStyle  As Long
  1100.     Dim r       As Long
  1101.     
  1102.     '________________________________________________________________________
  1103.     ' get the current styles
  1104.     rStyle = SendMessageLong(lstListViewName.hWnd, LVM_GETEXTENDEDLISTVIEWSTYLE, 0&, 0&)
  1105.     
  1106.     '________________________________________________________________________
  1107.     ' add the selected style to the current styles
  1108.     rStyle = rStyle Xor LVS_EX_TRACKSELECT
  1109.     
  1110.     '________________________________________________________________________
  1111.     ' update the listview styles
  1112.     SendMessageLong lstListViewName.hWnd, LVM_SETEXTENDEDLISTVIEWSTYLE, 0&, rStyle
  1113.     
  1114.     
  1115.     '________________________________________________________________________
  1116.     ' exit before error handler
  1117.     Exit Function
  1118.     
  1119. '________________________________________________________________________
  1120. ' deal with errors
  1121. err_EnhListView_Rem_TrackSelected:
  1122.     
  1123.     '________________________________________________________________________
  1124.     ' set function return to false
  1125.     EnhListView_Rem_TrackSelected = False
  1126.     '________________________________________________________________________
  1127.     ' if you want notification on an error
  1128.     If bolShowErrors = True Then
  1129.         MsgBox "Error" & Err.Number & vbTab & Err.Description, _
  1130.                vbOKOnly + vbInformation, _
  1131.                "Error in Function : EnhListView_Rem_TrackSelected"
  1132.     End If
  1133.     
  1134.     '________________________________________________________________________
  1135.     ' initiate debug
  1136.     Debug.Print Now & vbTab & "Error in function: EnhListView_Rem_TrackSelected" _
  1137.                 & vbCrLf & _
  1138.                 Err.Number & vbTab & Err.Description
  1139.     Debug.Assert False
  1140.     
  1141.     '________________________________________________________________________
  1142.     ' exit
  1143.     Exit Function
  1144.     
  1145. End Function
  1146. '=======================================================================
  1147.  
  1148. '=======================================================================
  1149. ' Description: Enables One Click Activate in a ListView
  1150. '=======================================================================
  1151. Public Function EnhListView_Add_OneClickActivate( _
  1152.                 lstListViewName As ListView, _
  1153.                 Optional bolShowErrors As Boolean) _
  1154.                 As Boolean
  1155.     
  1156.     '________________________________________________________________________
  1157.     ' initiate error handler
  1158.     On Error GoTo err_EnhListView_Add_OneClickActivate
  1159.     
  1160.     '________________________________________________________________________
  1161.     ' set function return to true
  1162.     EnhListView_Add_OneClickActivate = True
  1163.     
  1164.     '________________________________________________________________________
  1165.     ' setup variables
  1166.     Dim rStyle  As Long
  1167.     Dim r       As Long
  1168.     
  1169.     '________________________________________________________________________
  1170.     ' get the current styles
  1171.     rStyle = SendMessageLong(lstListViewName.hWnd, LVM_GETEXTENDEDLISTVIEWSTYLE, 0&, 0&)
  1172.     
  1173.     '________________________________________________________________________
  1174.     ' add the selected style to the current styles
  1175.     rStyle = rStyle Or LVS_EX_ONECLICKACTIVATE
  1176.     
  1177.     '________________________________________________________________________
  1178.     ' update the listview styles
  1179.     SendMessageLong lstListViewName.hWnd, LVM_SETEXTENDEDLISTVIEWSTYLE, 0&, rStyle
  1180.     
  1181.     '________________________________________________________________________
  1182.     ' exit before error handler
  1183.     Exit Function
  1184.     
  1185. '________________________________________________________________________
  1186. ' deal with errors
  1187. err_EnhListView_Add_OneClickActivate:
  1188.     
  1189.     '________________________________________________________________________
  1190.     ' set function return to false
  1191.     EnhListView_Add_OneClickActivate = False
  1192.     '________________________________________________________________________
  1193.     ' if you want notification on an error
  1194.     If bolShowErrors = True Then
  1195.         MsgBox "Error" & Err.Number & vbTab & Err.Description, _
  1196.                vbOKOnly + vbInformation, _
  1197.                "Error in Function : EnhListView_Add_OneClickActivate"
  1198.     End If
  1199.     
  1200.     '________________________________________________________________________
  1201.     ' initiate debug
  1202.     Debug.Print Now & vbTab & "Error in function: EnhListView_Add_OneClickActivate" _
  1203.                 & vbCrLf & _
  1204.                 Err.Number & vbTab & Err.Description
  1205.     Debug.Assert False
  1206.     
  1207.     '________________________________________________________________________
  1208.     ' exit
  1209.     Exit Function
  1210.     
  1211. End Function
  1212. '=======================================================================
  1213.  
  1214. '=======================================================================
  1215. ' Description: Disables One Click Activate in a ListView
  1216. '=======================================================================
  1217. Public Function EnhListView_Rem_OneClickActivate( _
  1218.                 lstListViewName As ListView, _
  1219.                 Optional bolShowErrors As Boolean) _
  1220.                 As Boolean
  1221.     
  1222.     '________________________________________________________________________
  1223.     ' initiate error handler
  1224.     On Error GoTo err_EnhListView_Rem_OneClickActivate
  1225.     
  1226.     '________________________________________________________________________
  1227.     ' set function return to true
  1228.     EnhListView_Rem_OneClickActivate = True
  1229.     
  1230.     '________________________________________________________________________
  1231.     ' setup variables
  1232.     Dim rStyle  As Long
  1233.     Dim r       As Long
  1234.     
  1235.     '________________________________________________________________________
  1236.     ' get the current styles
  1237.     rStyle = SendMessageLong(lstListViewName.hWnd, LVM_GETEXTENDEDLISTVIEWSTYLE, 0&, 0&)
  1238.     
  1239.     '________________________________________________________________________
  1240.     ' add the selected style to the current styles
  1241.     rStyle = rStyle Xor LVS_EX_ONECLICKACTIVATE
  1242.     
  1243.     '________________________________________________________________________
  1244.     ' update the listview styles
  1245.     SendMessageLong lstListViewName.hWnd, LVM_SETEXTENDEDLISTVIEWSTYLE, 0&, rStyle
  1246.     
  1247.     '________________________________________________________________________
  1248.     ' exit before error handler
  1249.     Exit Function
  1250.     
  1251. '________________________________________________________________________
  1252. ' deal with errors
  1253. err_EnhListView_Rem_OneClickActivate:
  1254.     
  1255.     '________________________________________________________________________
  1256.     ' set function return to false
  1257.     EnhListView_Rem_OneClickActivate = False
  1258.     '________________________________________________________________________
  1259.     ' if you want notification on an error
  1260.     If bolShowErrors = True Then
  1261.         MsgBox "Error" & Err.Number & vbTab & Err.Description, _
  1262.                vbOKOnly + vbInformation, _
  1263.                "Error in Function : EnhListView_Rem_OneClickActivate"
  1264.     End If
  1265.     
  1266.     '________________________________________________________________________
  1267.     ' initiate debug
  1268.     Debug.Print Now & vbTab & "Error in function: EnhListView_Rem_OneClickActivate" _
  1269.                 & vbCrLf & _
  1270.                 Err.Number & vbTab & Err.Description
  1271.     Debug.Assert False
  1272.     
  1273.     '________________________________________________________________________
  1274.     ' exit
  1275.     Exit Function
  1276.     
  1277. End Function
  1278. '=======================================================================
  1279.  
  1280. '=======================================================================
  1281. ' Description: Enables Two Click Activate in a ListView
  1282. '=======================================================================
  1283. Public Function EnhListView_Add_TwoClickActivate( _
  1284.                 lstListViewName As ListView, _
  1285.                 Optional bolShowErrors As Boolean) _
  1286.                 As Boolean
  1287.     
  1288.     '________________________________________________________________________
  1289.     ' initiate error handler
  1290.     On Error GoTo err_EnhListView_Add_TwoClickActivate
  1291.     
  1292.     '________________________________________________________________________
  1293.     ' set function return to true
  1294.     EnhListView_Add_TwoClickActivate = True
  1295.     
  1296.     '________________________________________________________________________
  1297.     ' setup variables
  1298.     Dim rStyle  As Long
  1299.     Dim r       As Long
  1300.     
  1301.     '________________________________________________________________________
  1302.     ' get the current styles
  1303.     rStyle = SendMessageLong(lstListViewName.hWnd, LVM_GETEXTENDEDLISTVIEWSTYLE, 0&, 0&)
  1304.     
  1305.     '________________________________________________________________________
  1306.     ' add the selected style to the current styles
  1307.     rStyle = rStyle Or LVS_EX_TWOCLICKACTIVATE
  1308.     
  1309.     '________________________________________________________________________
  1310.     ' update the listview styles
  1311.     SendMessageLong lstListViewName.hWnd, LVM_SETEXTENDEDLISTVIEWSTYLE, 0&, rStyle
  1312.     
  1313.     '________________________________________________________________________
  1314.     ' exit before error handler
  1315.     Exit Function
  1316.     
  1317. '________________________________________________________________________
  1318. ' deal with errors
  1319. err_EnhListView_Add_TwoClickActivate:
  1320.     
  1321.     '________________________________________________________________________
  1322.     ' set function return to false
  1323.     EnhListView_Add_TwoClickActivate = False
  1324.     '________________________________________________________________________
  1325.     ' if you want notification on an error
  1326.     If bolShowErrors = True Then
  1327.         MsgBox "Error" & Err.Number & vbTab & Err.Description, _
  1328.                vbOKOnly + vbInformation, _
  1329.                "Error in Function : EnhListView_Add_TwoClickActivate"
  1330.     End If
  1331.     
  1332.     '________________________________________________________________________
  1333.     ' initiate debug
  1334.     Debug.Print Now & vbTab & "Error in function: EnhListView_Add_TwoClickActivate" _
  1335.                 & vbCrLf & _
  1336.                 Err.Number & vbTab & Err.Description
  1337.     Debug.Assert False
  1338.     
  1339.     '________________________________________________________________________
  1340.     ' exit
  1341.     Exit Function
  1342.     
  1343. End Function
  1344. '=======================================================================
  1345.  
  1346. '=======================================================================
  1347. ' Description: Enables Full Row Select in a ListView
  1348. '=======================================================================
  1349. Public Function EnhListView_Rem_TwoClickActivate( _
  1350.                 lstListViewName As ListView, _
  1351.                 Optional bolShowErrors As Boolean) _
  1352.                 As Boolean
  1353.     
  1354.     '________________________________________________________________________
  1355.     ' initiate error handler
  1356.     On Error GoTo err_EnhListView_Rem_TwoClickActivate
  1357.     
  1358.     '________________________________________________________________________
  1359.     ' set function return to true
  1360.     EnhListView_Rem_TwoClickActivate = True
  1361.     
  1362.     '________________________________________________________________________
  1363.     ' setup variables
  1364.     Dim rStyle  As Long
  1365.     Dim r       As Long
  1366.     
  1367.     '________________________________________________________________________
  1368.     ' get the current styles
  1369.     rStyle = SendMessageLong(lstListViewName.hWnd, LVM_GETEXTENDEDLISTVIEWSTYLE, 0&, 0&)
  1370.     
  1371.     '________________________________________________________________________
  1372.     ' add the selected style to the current styles
  1373.     rStyle = rStyle Xor LVS_EX_TWOCLICKACTIVATE
  1374.     
  1375.     '________________________________________________________________________
  1376.     ' update the listview styles
  1377.     SendMessageLong lstListViewName.hWnd, LVM_SETEXTENDEDLISTVIEWSTYLE, 0&, rStyle
  1378.     
  1379.     '________________________________________________________________________
  1380.     ' exit before error handler
  1381.     Exit Function
  1382.     
  1383. '________________________________________________________________________
  1384. ' deal with errors
  1385. err_EnhListView_Rem_TwoClickActivate:
  1386.     
  1387.     '________________________________________________________________________
  1388.     ' set function return to false
  1389.     EnhListView_Rem_TwoClickActivate = False
  1390.     '________________________________________________________________________
  1391.     ' if you want notification on an error
  1392.     If bolShowErrors = True Then
  1393.         MsgBox "Error" & Err.Number & vbTab & Err.Description, _
  1394.                vbOKOnly + vbInformation, _
  1395.                "Error in Function : EnhListView_Rem_TwoClickActivate"
  1396.     End If
  1397.     
  1398.     '________________________________________________________________________
  1399.     ' initiate debug
  1400.     Debug.Print Now & vbTab & "Error in function: EnhListView_Rem_TwoClickActivate" _
  1401.                 & vbCrLf & _
  1402.                 Err.Number & vbTab & Err.Description
  1403.     Debug.Assert False
  1404.     
  1405.     '________________________________________________________________________
  1406.     ' exit
  1407.     Exit Function
  1408.     
  1409. End Function
  1410. '=======================================================================
  1411.  
  1412. '=======================================================================
  1413. ' Description: Enables SubItem Images in a ListView
  1414. '=======================================================================
  1415. Public Function EnhListView_Add_SubitemImages( _
  1416.                 lstListViewName As ListView, _
  1417.                 Optional bolShowErrors As Boolean) _
  1418.                 As Boolean
  1419.     
  1420.     '________________________________________________________________________
  1421.     ' initiate error handler
  1422.     On Error GoTo err_EnhListView_Add_SubitemImages
  1423.     
  1424.     '________________________________________________________________________
  1425.     ' set function return to true
  1426.     EnhListView_Add_SubitemImages = True
  1427.     
  1428.     '________________________________________________________________________
  1429.     ' setup variables
  1430.     Dim rStyle  As Long
  1431.     Dim r       As Long
  1432.     
  1433.     '________________________________________________________________________
  1434.     ' get the current styles
  1435.     rStyle = SendMessageLong(lstListViewName.hWnd, LVM_GETEXTENDEDLISTVIEWSTYLE, 0&, 0&)
  1436.     
  1437.     '________________________________________________________________________
  1438.     ' add the selected style to the current styles
  1439.     rStyle = rStyle Or LVS_EX_SUBITEMIMAGES
  1440.     
  1441.     '________________________________________________________________________
  1442.     ' update the listview styles
  1443.     SendMessageLong lstListViewName.hWnd, LVM_SETEXTENDEDLISTVIEWSTYLE, 0&, rStyle
  1444.     
  1445.     '________________________________________________________________________
  1446.     ' exit before error handler
  1447.     Exit Function
  1448.     
  1449. '________________________________________________________________________
  1450. ' deal with errors
  1451. err_EnhListView_Add_SubitemImages:
  1452.     
  1453.     '________________________________________________________________________
  1454.     ' set function return to false
  1455.     EnhListView_Add_SubitemImages = False
  1456.     '________________________________________________________________________
  1457.     ' if you want notification on an error
  1458.     If bolShowErrors = True Then
  1459.         MsgBox "Error" & Err.Number & vbTab & Err.Description, _
  1460.                vbOKOnly + vbInformation, _
  1461.                "Error in Function : EnhListView_Add_SubitemImages"
  1462.     End If
  1463.     
  1464.     '________________________________________________________________________
  1465.     ' initiate debug
  1466.     Debug.Print Now & vbTab & "Error in function: EnhListView_Add_SubitemImages" _
  1467.                 & vbCrLf & _
  1468.                 Err.Number & vbTab & Err.Description
  1469.     Debug.Assert False
  1470.     
  1471.     '________________________________________________________________________
  1472.     ' exit
  1473.     Exit Function
  1474.     
  1475. End Function
  1476. '=======================================================================
  1477.  
  1478. '=======================================================================
  1479. ' Description: Disables SubItem Images in a ListView
  1480. '=======================================================================
  1481. Public Function EnhListView_Rem_SubitemImages( _
  1482.                 lstListViewName As ListView, _
  1483.                 Optional bolShowErrors As Boolean) _
  1484.                 As Boolean
  1485.     
  1486.     '________________________________________________________________________
  1487.     ' initiate error handler
  1488.     On Error GoTo err_EnhListView_Rem_SubitemImages
  1489.     
  1490.     '________________________________________________________________________
  1491.     ' set function return to true
  1492.     EnhListView_Rem_SubitemImages = True
  1493.     
  1494.     '________________________________________________________________________
  1495.     ' setup variables
  1496.     Dim rStyle  As Long
  1497.     Dim r       As Long
  1498.     
  1499.     '________________________________________________________________________
  1500.     ' get the current styles
  1501.     rStyle = SendMessageLong(lstListViewName.hWnd, LVM_GETEXTENDEDLISTVIEWSTYLE, 0&, 0&)
  1502.     
  1503.     '________________________________________________________________________
  1504.     ' remove the selected style from the current styles
  1505.     rStyle = rStyle Xor LVS_EX_SUBITEMIMAGES
  1506.     
  1507.     '________________________________________________________________________
  1508.     ' update the listview styles
  1509.     SendMessageLong lstListViewName.hWnd, LVM_SETEXTENDEDLISTVIEWSTYLE, 0&, rStyle
  1510.     
  1511.     '________________________________________________________________________
  1512.     ' exit before error handler
  1513.     Exit Function
  1514.     
  1515. '________________________________________________________________________
  1516. ' deal with errors
  1517. err_EnhListView_Rem_SubitemImages:
  1518.     
  1519.     '________________________________________________________________________
  1520.     ' set function return to false
  1521.     EnhListView_Rem_SubitemImages = False
  1522.     '________________________________________________________________________
  1523.     ' if you want notification on an error
  1524.     If bolShowErrors = True Then
  1525.         MsgBox "Error" & Err.Number & vbTab & Err.Description, _
  1526.                vbOKOnly + vbInformation, _
  1527.                "Error in Function : EnhListView_Rem_SubitemImages"
  1528.     End If
  1529.     
  1530.     '________________________________________________________________________
  1531.     ' initiate debug
  1532.     Debug.Print Now & vbTab & "Error in function: EnhListView_Rem_SubitemImages" _
  1533.                 & vbCrLf & _
  1534.                 Err.Number & vbTab & Err.Description
  1535.     Debug.Assert False
  1536.     
  1537.     '________________________________________________________________________
  1538.     ' exit
  1539.     Exit Function
  1540.     
  1541. End Function
  1542. '=======================================================================
  1543.  
  1544. '=======================================================================
  1545. ' Description: Checks all Items in the ListView
  1546. '=======================================================================
  1547. Public Function EnhLitView_CheckAllItems( _
  1548.                 lstListViewName As ListView, _
  1549.                 Optional bolShowErrors As Boolean) _
  1550.                 As Boolean
  1551.     
  1552.     '________________________________________________________________________
  1553.     ' initiate error handler
  1554.     On Error GoTo err_EnhLitView_CheckAllItems
  1555.     
  1556.     '________________________________________________________________________
  1557.     ' set function return to true
  1558.     EnhLitView_CheckAllItems = True
  1559.     
  1560.     '________________________________________________________________________
  1561.     ' setup variables
  1562.     Dim LV          As LVITEM
  1563.     Dim lvCount     As Long
  1564.     Dim lvIndex     As Long
  1565.     Dim lvState     As Long
  1566.     Dim r           As Long
  1567.     
  1568.     '________________________________________________________________________
  1569.     lvState = IIf(True, &H2000, &H1000)
  1570.     lvCount = lstListViewName.ListItems.Count - 1
  1571.     Do
  1572.         With LV
  1573.             .mask = LVIF_STATE
  1574.             .state = lvState
  1575.             .stateMask = LVIS_STATEIMAGEMASK
  1576.         End With
  1577.         r = SendMessageAny(lstListViewName.hWnd, LVM_SETITEMSTATE, lvIndex, LV)
  1578.         lvIndex = lvIndex + 1
  1579.     Loop Until lvIndex > lvCount
  1580.     
  1581.     '________________________________________________________________________
  1582.     ' exit before error handler
  1583.     Exit Function
  1584.     
  1585. '________________________________________________________________________
  1586. ' deal with errors
  1587. err_EnhLitView_CheckAllItems:
  1588.     
  1589.     '________________________________________________________________________
  1590.     ' set function return to false
  1591.     EnhLitView_CheckAllItems = False
  1592.     '________________________________________________________________________
  1593.     ' if you want notification on an error
  1594.     If bolShowErrors = True Then
  1595.         MsgBox "Error" & Err.Number & vbTab & Err.Description, _
  1596.                vbOKOnly + vbInformation, _
  1597.                "Error in Function : EnhLitView_CheckAllItems"
  1598.     End If
  1599.     
  1600.     '________________________________________________________________________
  1601.     ' initiate debug
  1602.     Debug.Print Now & vbTab & "Error in function: EnhLitView_CheckAllItems" _
  1603.                 & vbCrLf & _
  1604.                 Err.Number & vbTab & Err.Description
  1605.     Debug.Assert False
  1606.     
  1607.     '________________________________________________________________________
  1608.     ' exit
  1609.     Exit Function
  1610.     
  1611. End Function
  1612. '=======================================================================
  1613.  
  1614. '=======================================================================
  1615. ' Description: Unchecks all items in a ListView
  1616. '=======================================================================
  1617. Public Function EnhLitView_UnCheckAllItems( _
  1618.                 lstListViewName As ListView, _
  1619.                 Optional bolShowErrors As Boolean) _
  1620.                 As Boolean
  1621.     
  1622.     '________________________________________________________________________
  1623.     ' initiate error handler
  1624.     On Error GoTo err_EnhLitView_UnCheckAllItems
  1625.     
  1626.     '________________________________________________________________________
  1627.     ' set function return to true
  1628.     EnhLitView_UnCheckAllItems = True
  1629.     
  1630.     '________________________________________________________________________
  1631.     ' setup variables
  1632.     Dim LV          As LVITEM
  1633.     Dim lvCount     As Long
  1634.     Dim lvIndex     As Long
  1635.     Dim lvState     As Long
  1636.     Dim r           As Long
  1637.     
  1638.     '________________________________________________________________________
  1639.     lvState = IIf(True, &H2000, &H1000)
  1640.     lvCount = lstListViewName.ListItems.Count - 1
  1641.     Do
  1642.         With LV
  1643.             .mask = LVIF_STATE
  1644.             .state = lvState
  1645.             .stateMask = LVIS_STATEIMAGEMASK
  1646.         End With
  1647.         r = SendMessageAny(lstListViewName.hWnd, LVM_SETITEMSTATE, lvIndex, LV)
  1648.         lvIndex = lvIndex + 1
  1649.     Loop Until lvIndex > lvCount
  1650.     
  1651.     '________________________________________________________________________
  1652.     ' exit before error handler
  1653.     Exit Function
  1654.     
  1655. '________________________________________________________________________
  1656. ' deal with errors
  1657. err_EnhLitView_UnCheckAllItems:
  1658.     
  1659.     '________________________________________________________________________
  1660.     ' set function return to false
  1661.     EnhLitView_UnCheckAllItems = False
  1662.     '________________________________________________________________________
  1663.     ' if you want notification on an error
  1664.     If bolShowErrors = True Then
  1665.         MsgBox "Error" & Err.Number & vbTab & Err.Description, _
  1666.                vbOKOnly + vbInformation, _
  1667.                "Error in Function : EnhLitView_UnCheckAllItems"
  1668.     End If
  1669.     
  1670.     '________________________________________________________________________
  1671.     ' initiate debug
  1672.     Debug.Print Now & vbTab & "Error in function: EnhLitView_UnCheckAllItems" _
  1673.                 & vbCrLf & _
  1674.                 Err.Number & vbTab & Err.Description
  1675.     Debug.Assert False
  1676.     
  1677.     '________________________________________________________________________
  1678.     ' exit
  1679.     Exit Function
  1680.     
  1681. End Function
  1682. '=======================================================================
  1683.  
  1684.  
  1685. '=======================================================================
  1686. ' Description: Inverts all checked items in a ListView
  1687. '=======================================================================
  1688. Public Function EnhListView_InvertAllChecks( _
  1689.                 lstListViewName As ListView, _
  1690.                 Optional bolShowErrors As Boolean) _
  1691.                 As Boolean
  1692.     
  1693.     '________________________________________________________________________
  1694.     ' initiate error handler
  1695.     On Error GoTo err_EnhListView_InvertAllChecks
  1696.     
  1697.     '________________________________________________________________________
  1698.     ' set function return to true
  1699.     EnhListView_InvertAllChecks = True
  1700.     
  1701.     '________________________________________________________________________
  1702.     ' setup variables
  1703.     Dim LV          As LVITEM
  1704.     Dim r           As Long
  1705.     Dim lvCount     As Long
  1706.     Dim lvIndex     As Long
  1707.     
  1708.     '________________________________________________________________________
  1709.     lvCount = lstListViewName.ListItems.Count - 1
  1710.     Do
  1711.         r = SendMessageLong(lstListViewName.hWnd, LVM_GETITEMSTATE, lvIndex, LVIS_STATEIMAGEMASK)
  1712.         With LV
  1713.             .mask = LVIF_STATE
  1714.             .stateMask = LVIS_STATEIMAGEMASK
  1715.             If r And &H2000& Then
  1716.                 .state = &H1000
  1717.             Else
  1718.                 .state = &H2000
  1719.             End If
  1720.         End With
  1721.         r = SendMessageAny(lstListViewName.hWnd, LVM_SETITEMSTATE, lvIndex, LV)
  1722.         lvIndex = lvIndex + 1
  1723.     Loop Until lvIndex > lvCount
  1724.     
  1725.     '________________________________________________________________________
  1726.     ' exit before error handler
  1727.     Exit Function
  1728.     
  1729. '________________________________________________________________________
  1730. ' deal with errors
  1731. err_EnhListView_InvertAllChecks:
  1732.     
  1733.     '________________________________________________________________________
  1734.     ' set function return to false
  1735.     EnhListView_InvertAllChecks = False
  1736.     '________________________________________________________________________
  1737.     ' if you want notification on an error
  1738.     If bolShowErrors = True Then
  1739.         MsgBox "Error" & Err.Number & vbTab & Err.Description, _
  1740.                vbOKOnly + vbInformation, _
  1741.                "Error in Function : EnhListView_InvertAllChecks"
  1742.     End If
  1743.     
  1744.     '________________________________________________________________________
  1745.     ' initiate debug
  1746.     Debug.Print Now & vbTab & "Error in function: EnhListView_InvertAllChecks" _
  1747.                 & vbCrLf & _
  1748.                 Err.Number & vbTab & Err.Description
  1749.     Debug.Assert False
  1750.     
  1751.     '________________________________________________________________________
  1752.     ' exit
  1753.     Exit Function
  1754.     
  1755. End Function
  1756. '=======================================================================
  1757.  
  1758. '=======================================================================
  1759. ' Description: Toggles FlatColumnHeaders in a ListView
  1760. '=======================================================================
  1761. Public Function EnhListView_Toggle_FlatColumnHeaders( _
  1762.                 frmFormName As Form, _
  1763.                 lstListViewName As ListView, _
  1764.                 Optional bolShowErrors As Boolean) _
  1765.                 As Boolean
  1766.     
  1767.     '________________________________________________________________________
  1768.     ' initiate error handler
  1769.     On Error GoTo err_EnhListView_Toggle_FlatColumnHeaders
  1770.     
  1771.     '________________________________________________________________________
  1772.     ' set function return to true
  1773.     EnhListView_Toggle_FlatColumnHeaders = True
  1774.     
  1775.     '________________________________________________________________________
  1776.     SetWindowLong SendMessageLong(lstListViewName.hWnd, _
  1777.                                  LVM_GETHEADER, _
  1778.                                  0, _
  1779.                                  ByVal 0&), _
  1780.                                  GWL_STYLE, _
  1781.                                  GetWindowLong(SendMessageLong(lstListViewName.hWnd, _
  1782.                                                                LVM_GETHEADER, _
  1783.                                                                0, _
  1784.                                                                ByVal _
  1785.                                                                0&), _
  1786.                                                                GWL_STYLE) _
  1787.                                                                Xor HDS_BUTTONS
  1788.     SetWindowPos lstListViewName.hWnd, _
  1789.                  frmFormName.hWnd, _
  1790.                  0, _
  1791.                  0, _
  1792.                  0, _
  1793.                  0, _
  1794.                  SWP_FLAGS
  1795.     
  1796.     '________________________________________________________________________
  1797.     ' exit before error handler
  1798.     Exit Function
  1799.     
  1800. '________________________________________________________________________
  1801. ' deal with errors
  1802. err_EnhListView_Toggle_FlatColumnHeaders:
  1803.     
  1804.     '________________________________________________________________________
  1805.     ' set function return to false
  1806.     EnhListView_Toggle_FlatColumnHeaders = False
  1807.     '________________________________________________________________________
  1808.     ' if you want notification on an error
  1809.     If bolShowErrors = True Then
  1810.         MsgBox "Error" & Err.Number & vbTab & Err.Description, _
  1811.                vbOKOnly + vbInformation, _
  1812.                "Error in Function : EnhListView_Toggle_FlatColumnHeaders"
  1813.     End If
  1814.     
  1815.     '________________________________________________________________________
  1816.     ' initiate debug
  1817.     Debug.Print Now & vbTab & "Error in function: EnhListView_Toggle_FlatColumnHeaders" _
  1818.                 & vbCrLf & _
  1819.                 Err.Number & vbTab & Err.Description
  1820.     Debug.Assert False
  1821.     
  1822.     '________________________________________________________________________
  1823.     ' exit
  1824.     Exit Function
  1825.     
  1826. End Function
  1827. '=======================================================================
  1828.  
  1829.  
  1830.