Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

I need a button!!

Posted on 2003-03-05
8
Medium Priority
?
199 Views
Last Modified: 2010-04-04
I need a button that will do the following:

1. Use Images for each of the following: Mouseover, MouseDown, and Normal State.

2. The button needs to handle keyboard events as well, Onclick, etc.

3. Can be a tab stop.

4. Transparent would be nice but not necessary.

Basically, it should be like a normal delphi button but able to be an image button with the above image states.

An existing control would be great but the ones I have tried are basically garbage.
0
Comment
Question by:mdlittle
8 Comments
 
LVL 22

Expert Comment

by:Mohammed Nasman
ID: 8074690
Hello

Look at 1st Class components, you can have much buttons with different shapes
http://www.woll2woll.com/1stclass/tour/

you can see more at torry
http://homepages.borland.com/torry/nsbuttons.htm
0
 
LVL 5

Expert Comment

by:Lukasz Lach
ID: 8075024
TExplorerButton
0
 
LVL 3

Expert Comment

by:ILE
ID: 8076450
u have a one bitbtn

one form


and u do the following


procedure TForm1.BitBtn1MouseDown(Sender: TObject; Button: TMouseButton;
  Shift: TShiftState; X, Y: Integer);
begin
if bitbtn1.tag<>2 then bitbtn1.Glyph.LoadFromFile('f:\brisi\arrow2d.bmp'); {first immage}
bitbtn1.tag:=2;
end;

procedure TForm1.BitBtn1MouseMove(Sender: TObject; Shift: TShiftState; X,
  Y: Integer);
begin
if bitbtn1.tag<>1 then bitbtn1.Glyph.LoadFromFile('f:\brisi\arrow1d.bmp');  {second immage}
bitbtn1.tag:=1;
end;

procedure TForm1.FormMouseMove(Sender: TObject; Shift: TShiftState; X,
  Y: Integer);
begin
if bitbtn1.tag<>0 then bitbtn1.Glyph.LoadFromFile('f:\brisi\arrow3d.bmp');   {third image  normal state}
bitbtn1.tag:=0;
end;



wery easy and elegant;

0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 1

Accepted Solution

by:
JayBinks earned 2000 total points
ID: 8078054
I currently use a componet called ImgBtn, by "Paul Krestol"

it says its for Delphi 3 & 4 but its worked great for me on D6 & D7 (I dont think I had to modify anything)

you can get it from here : http://www.delphi32.com/vcl/248/

also for the transparency you can use
TPNGImage (get it at http://pngdelphi.sourceforge.net)

this give you PNG Support in all TImage type object
(Including ImgBtn Component)

which not only gives you a transparent button, but a button that will do transparency with an alpha chanel !! WOW Cool.. (I only just figured that out and tested it)

if you need any help let me know... I can help you ( I Think)
0
 

Author Comment

by:mdlittle
ID: 8082051
JayBinks:

Do you have any sample code on using the two together??

0
 

Author Comment

by:mdlittle
ID: 8082056
JayBinks:

Do you have any sample code on using the two together??

0
 

Author Comment

by:mdlittle
ID: 8083685
JayBinks, please submit as a question so I can award you the points.

Thanks for your help. This works Great.
0
 
LVL 1

Expert Comment

by:JayBinks
ID: 8083921
how would I attach an example ?? I can do a little one up for you if you realy like, but I dont know how I would attach it to EE.

also as Im new to EE, I dont know why you want me to submit it as a question ?? how do I do that ?

Jay
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

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…
How can you see what you are working on when you want to see it while you to save a copy? Add a "Save As" icon to the Quick Access Toolbar, or QAT. That way, when you save a copy of a query, form, report, or other object you are modifying, you…
Enter Foreign and Special Characters Enter characters you can't find on a keyboard using its ASCII code ... and learn how to make a handy reference for yourself using Excel ~ Use these codes in any Windows application! ... whether it is a Micr…
Suggested Courses

564 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