hellswraith, be advised that MS acknowledges a bug in the TV control when checkboxes are used. They advise setting the Checkbox style of the TreeView by using API calls, rather than simply setting the "Checkboxes" property to True.
In a module, you would need:
In your form (probably in the Load event), you would need:Code:Public Const TVS_CHECKBOXES As Long = &H100 Public Const GWL_STYLE As Long = (-16) Public Declare Function GetWindowLong _ Lib "user32" Alias "GetWindowLongA" _ (ByVal hwnd As Long, _ ByVal nIndex As Long) As Long Public Declare Function SetWindowLong _ Lib "user32" Alias "SetWindowLongA" _ (ByVal hwnd As Long, _ ByVal nIndex As Long, _ ByVal dwNewLong As Long) As Long
Here's a link to the MS article:Code:Dim lngCurStyle As Long Dim lngResult As Long ' === Set the Checkbox style of the TreeView === ' As advised by Microsoft, due to a bug in the TreeView control, ' set the Checkbox style of the TreeView by using the following ' API calls, rather than simply setting the "Checkboxes" property ' to True ... lngCurStyle = GetWindowLong(tvwGlobalUpdate.hwnd, GWL_STYLE) lngResult = SetWindowLong(tvwGlobalUpdate.hwnd, GWL_STYLE, _ lngCurStyle Or TVS_CHECKBOXES)
http://support.microsoft.com/support.../Q192/1/88.asp




Reply With Quote