Solved

How to change the default glyph of TFileListBox component?

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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
how do you get these � Marks in your text? 9 114
Reconfigure Delphi Install? 2 77
Delphi android app hide keyboard 3 82
Delphi Firemonkey send email on Android 1 81
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…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
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…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

734 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