?
Solved

I need a button!!

Posted on 2003-03-05
8
Medium Priority
?
197 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
[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
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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
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

Enroll in August's Course of the Month

August's CompTIA IT Fundamentals course includes 19 hours of basic computer principle modules and prepares you for the certification exam. It's free for Premium Members, Team Accounts, and Qualified Experts!

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…
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…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses

801 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