Link to home
Start Free TrialLog in
Avatar of bengore
bengore

asked on

TreeView like explorer with title and X button

I want to look a TreeView like the Treeview of the Windows Explorer in Win2000 (Win98,WinME?):
A treeview with a title "Folder" and a black x sign to hide the treeview.
Is there a way to extend my Delphi Treeview element? I would prefer a solution without writing a new component - perhaps I can set the style with:
Ā  SetWindowLong(Treeview.Handle, GWL_STYLE, NewStyle );
I use Delphi 4.0.
ASKER CERTIFIED SOLUTION
Avatar of TheNeil
TheNeil

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of bengore
bengore

ASKER

Hi TheNeil, thank you for your answer. Your solution is of cource the most simple solution - but it looks not so good (see the 3D edges, or see in other screen solutions).
Have a look at VirtualTreeView (http://delphi-jedi.org/Jedi:VCLCOMPONENTS)
It is a bit complicated, but can do strange tricks.
You will still have to do the close box yourself.
Anyway, in Explorer the close box is a management element of the docked window parts. You should do that the same way.
Simple solution I know, but if you play around with the Bevel properties then you can get it looking exactly how you want. All depends on what you're looking to do and how much work you want to put into it. Unless there's a component to do it then this might be the way you have to go

The Neil =:)
I meant not adding a close box to a TreeView descendant.
Avatar of bengore

ASKER

Ok, I found there is no treeview style for "title with close button". See:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/shellcc/commctls/TreeView/Styles.asp

That means there is no API solution like SetWindowLong() (for what I was looking for).
Whom shall I give the points now?

TheNeil of course. He answered first and directly to the problem.
Thanks Robert (very generous of you). Hopefully I can do the same for you one day.

The Neil =:)