Can you prevent TreeView to be collapsed/expanded??? 
Author Message
 Can you prevent TreeView to be collapsed/expanded???

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)



Mon, 16 Apr 2001 03:00:00 GMT  
 Can you prevent TreeView to be collapsed/expanded???
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

Quote:

>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)



Mon, 16 Apr 2001 03:00:00 GMT  
 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)



Tue, 17 Apr 2001 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Treeview - preventing collapse/expand

2. Preventing expand/collapse in TreeView

3. Can you prevent TreeView to be collapsed/expanded???

4. TreeView : Preventing expand/collapse

5. Can you prevent TreeView to be collapsed/expanded???

6. Can you prevent TreeView to be collapsed/expanded???

7. Determine if Treeview is expanded or collapsed

8. TreeView node expand/collapse

9. TreeView - defeating double-click node collapse/expand

10. TreeView Expanding and Collapsing.

11. TreeView Expanding and Collapsing.

12. TreeView doesn''t show Plus/Minus expand/collapse indicators

 

 
Powered by phpBB® Forum Software