Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

How to change the default glyph of TFileListBox component?

Posted on 2004-08-09
5
Medium Priority
?
628 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 500 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

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
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…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
Suggested Courses

705 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