Solved

How to change the default glyph of TFileListBox component?

Posted on 2004-08-09
5
562 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
  • 2
  • 2
5 Comments
 
LVL 7

Accepted Solution

by:
LRHGuy earned 125 total points
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

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…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

771 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

10 Experts available now in Live!

Get 1:1 Help Now