Solved

How to change the default glyph of TFileListBox component?

Posted on 2004-08-09
5
569 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
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
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…

911 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

21 Experts available now in Live!

Get 1:1 Help Now