Yes right and my 'update' failed as you replied:) It'd be :
bitor(TVS_CHECKBOXES,Curstyle)
Cetin
>Thanks Cetin, but what has me confused is this part of the command:"...CurStyle Or TVS_CHECKBOXES)", specifically the "or" word in there.
>
>
>>>Working with the Treeview, specifically with its Checkboxes property, I was encountering a problem trying to manipulate the state of a checkbox. After half a day of struggling and finally deciding that my code looked OK I went to Google.
>>>
>>>There I found KB# 192188, detailing what likely is the problem I am experiencing. So I want to implement the workaround described.
>>>
>>>Their workaround is to go into Form.Load but I assume that putting it into my Treeview.Init will be just as good. [it's also no fun to implement code that you don't understand WHY/HOW it fixes a problem]
>>>
>>>Below I show my adaptation of the code supplied with the original code shown as comments.
>>>What I need is the code needed where the "??????" is shown (last line, extreme right). Of course if there are other problems in my adaptation I'd like to hear about those too.
>>>
>>>*Private Declare Function GetWindowLong Lib "user32" Alias _
>>>* "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) _
>>>* As Long
>>>DECLARE long GetWindowLong IN "user32" as GetWindowLongA ;
>>> Long, Long
>>>
>>>*Private Declare Function SetWindowLong Lib "user32" Alias _
>>>* "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, _
>>>* ByVal dwNewLong As Long) As Long
>>>DECLARE long SetWindowLong IN "user32" as SetWindowLongA ;
>>> Long, Long, Long
>>>
>>>* Const TVS_CHECKBOXES = &H100
>>>* Const GWL_STYLE = (-16)
>>>
>>>*CurStyle = GetWindowLong(TreeView1.hwnd, GWL_STYLE)
>>>Curstyle = GetWindowLong(This.hWnd, -16)
>>>
>>>*Result = SetWindowLong(TreeView1.hwnd, GWL_STYLE, _
>>>* CurStyle Or TVS_CHECKBOXES)
>>>Result = SetWindowLong(This.hWnd, -16, ???????)
>>>
>>>
>>>Thanks
>>
>>#define TVS_CHECKBOXES 0x100
>>*..
>>Result = SetWindowLong(This.hWnd, -16, TVS_CHECKBOXES)
>>
>>or :
>>Result = SetWindowLong(This.hWnd, -16, 0x100)
>>
>>Cetin