Nodes have a .Expand() method, which executes whenever the node is expanded, either by clicking on plus sign or clicking on icon. You may use a custom method that expands and collapse nodes, called from both Node.Click and Node.Expand, after checking if the node is already expanded (otherwise Node.Click will call the method, then the Node.Expand event will occur, doing the things twice). You may also check if the node to be expanded is the selected node (Nodes(node.Key).Selected = .T.), otherwise expanding/collapsing nodes programatically will trigger the whole process over and over again.

I don't have a list of differences, but the most important one is SP4 version does not support themes. :(

----- Original Message ----- From: "Peter Hart" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, July 10, 2006 11:23 AM
Subject: RE: Automatically close Nodes in TreeView Control.


Hi Grigore

Must be the SP2 version as I cannot see a SingleSel property.

Your suggestion works if you click on the Icon but not if you click on
the plus sign.  This may work better as it gives the operator the choice
of either method. But it would be nice to know how to make it work
clicking on the plus sign

Incidentally do you know if there are any differences in the two
controls, would it be easy just to use the other control and transpose
the PEM's

Cheers

Peter


-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf Of Grigore Dolghin
Sent: 10 July 2006 08:30
To: [email protected]
Subject: Re: Automatically close Nodes in TreeView Control.

Hi, Peter

If you are using the SP2 one, you can scan the nodes and collapse each
one,
except the one clicked.

In NodeClick Event:

lParameters node
For lnI = 1 To This.Nodes.Count
   This.Nodes(lnI).Expanded = .F.
EndFor
This.Nodes(node.Key).Expanded = .T.


----- Original Message ----- From: "Peter Hart" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, July 10, 2006 10:09 AM
Subject: RE: Automatically close Nodes in TreeView Control.


Thanks Grigore

By the way congratulations on your MVP Status.

Still waiting to hear about Prague as to whether it will be worth
attending.  I would like to go as I enjoyed meeting you and the rest of
the Crowd.

Cheers

Peter


-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf Of Grigore Dolghin
Sent: 10 July 2006 06:15
To: [email protected]
Subject: Re: Automatically close Nodes in TreeView Control.

Hi.

Set the treeview.SingleSel property to .T. VFP comes with two treeviews:

Microsoft TreeView Control 6.0 (SP 4) and Microsoft TreeView Control,
version 5.0 (SP 2). Only the SP4 one has this property.


Hope this helps.
Grigore Dolghin.

----- Original Message ----- From: "Peter Hart" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, July 09, 2006 12:16 AM
Subject: RE: Automatically close Nodes in TreeView Control.


Hi All



You may have seen previous questions of mine about TreeView Controls.

Some of my applications use a the Microsoft TreeView Control as a Menu
at the side of the application Screen.

The Nodes expand fron the top of the tree to emulate a VFP Menu at the
first Left and then each node can be expanded to display the pads of the
menu.  When the application is closed the current state of the TreeView
is saved so that the Treeview opens when the Application is opened in
the same state it was.  This has worked fine but.  Some of the
applications have so many pads open that they extend below the bottom of
the screen.



I wonder if anyone has any idea how I could make each (First) node
Collapse as another is clicked to Expand it. I.E. I have Four Menu Pads
System, File, Windows, Help.  I click on File and it expands. I click on
Window and it expands and File collapses.



TIA



Peter

Peter Hart Computers





--- StripMime Report -- processed MIME parts ---
multipart/alternative
 text/plain (text body -- kept)
 text/html
---


[excessive quoting removed by server]

_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to