Solved

TreeView like explorer with title and X button

Posted on 2001-07-02
8
319 Views
Last Modified: 2012-05-04
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.
0
Comment
Question by:bengore
  • 3
  • 3
  • 2
8 Comments
 
LVL 5

Accepted Solution

by:
TheNeil earned 50 total points
ID: 6244038
You could just drop a TPanel onto your form and then add a second TPanel inside that, align it to the top, and then add a TTreeView and align that as client. You'd need to add the button yourself and code the logic but it would save the need for coding a new component and wouldn't take too much time

The Neil =:)
0
 

Author Comment

by:bengore
ID: 6244129
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).
0
 
LVL 11

Expert Comment

by:robert_marquardt
ID: 6244187
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.
0
 
LVL 5

Expert Comment

by:TheNeil
ID: 6244242
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 =:)
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 11

Expert Comment

by:robert_marquardt
ID: 6244305
I meant not adding a close box to a TreeView descendant.
0
 

Author Comment

by:bengore
ID: 6244396
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?

0
 
LVL 11

Expert Comment

by:robert_marquardt
ID: 6244474
TheNeil of course. He answered first and directly to the problem.
0
 
LVL 5

Expert Comment

by:TheNeil
ID: 6244548
Thanks Robert (very generous of you). Hopefully I can do the same for you one day.

The Neil =:)
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now