Solved

How to change the default glyph of TFileListBox component?

Posted on 2004-08-09
5
594 Views
Last Modified: 2013-12-02
Hi!
I want to use 3D file images, and FileListBox has old images of folder and files... How to change the default glyph of TFileListBox component?

If it's not possible.. is there any better way to do this?



Thanks in advance...
0
Comment
Question by:goaman
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 7

Accepted Solution

by:
LRHGuy earned 125 total points
ID: 11759401
Here's one (tricky) way...

type
  tLB=class(tFileListBox);
procedure TForm2.FormCreate(Sender: TObject);
begin
  tLB(lb).ExeBMP.LoadFromFile('test.bmp');
  tLB(lb).DirBMP.LoadFromFile('test2.bmp');
  tLB(lb).UnknownBMP.LoadFromFile('test3.bmp');
end;

Once you have the handle to the bitmap, you can load from file, resource, whetever.
0
 
LVL 12

Expert Comment

by:esoftbg
ID: 11759410
TFileListBox is declared into:
:\Program Files\Borland\Delphi7\Source\Vcl\FileCtrl.pas
and gets the bitmaps from:
:\Program Files\Borland\Delphi7\Lib\filectrl.res

May be you need to inherit a new component from TFileListBox which will get the bitmaps from your resource file ....
0
 

Author Comment

by:goaman
ID: 11760844
Hi  LRHGuy,
I'm getting (Access Violation)error while compiling.... :( pls help me...


Hi esoftbg,
Thanx for the tip, how can I change it programmically without changing it's res file?...  like loading bmps from hard drive or something...
I wish LRHGuy's example works...
0
 
LVL 7

Expert Comment

by:LRHGuy
ID: 11761509
Hmmm...an (Access Violation) while compiling...interesting. Make sure you've copied the example exactly, with your own file names, then restart Delphi. I tried the example in D7 before I posted and it worked perfectly with no errors, so right now I don't know why you'd get a access violatin error while compiling.
0
 

Author Comment

by:goaman
ID: 11761568
Hi  LRHGuy,
Sorry... I made a little mistake thatswhy error came... It's working exactly how I want.... :)

thankyou, I appreciate your help....
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

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…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

756 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