
Can you prevent TreeView to be collapsed/expanded???
Hi Chris,
(Re: Can you prevent TreeView to be collapsed/expanded???)
I have downloaded and tried it.
may be i am wrong but this sample code doesn't work
properly. After setting some of the 3 check buttons
you can still force the TreeView to be expanded/collapsed.
Just set e.g. the 'Prevent to Expand' toggle box on and try to
expand the selected node by pressing Enter button and left
mouse button (a few times with Keyboard and a few times
with mouse). Then you see that the TreeView is still expanded
but an in a very strange/buggy way.
You can see that the selected item/node can be sometimes
expanded (by changing - to + and some borders which are drawn)
but you are not still to see all childeren.
I think this piece of code is not fully tested.
Cheers,
Nasser
Chris Eastwood heeft geschreven in bericht
Quote:
>Hi
>Brad Martinez has an excellent example of how to do this using the WinAPI -
>take a look at
>http://members.aol.com/btmtz/vb/treeview/index.htm
>Regards
>Chris Eastwood
>Software Engineer
>ACNielsen Ltd
>>Hi,
>>(((Again a question about TreeView/ListView/.....!!!!!!!!)))
>>Any way, I am using a MDI application containing a child frame
>>which looks like Microsoft Explorer.
>>In My Parent MDI form I type some value in a TextBox and then
>>press the Enter button. If TreeVewer in my Child form has the focus
>>then the selected node is collapsed/expanded each time I press
>>the Enter button in my parent form.
>>I have tried to prevent this by putting some piece of codes in my
>>child form. The problem is that the source code for Collapse and
>>Expand event for TreeView are executed after my TreeView has
>>been expanded/collapsed!!!
>>How can I prevent/overrule such a thing in VB5.0?
>>Thanks in advance,
>> N. Silakhori (Zoetermeer, The netherlands)