Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Creating my own button on a form

Status
Not open for further replies.

kev747

Technical User
Jan 30, 2003
68
AU
Hi all,
I've trolled though the archives to find an answer for this, but gave up after two days. Maybe I'm looking in the wrong spot.

I have a small bitmap on my form that I want to act like a button. In other words, when I depress the mouse button, it will look sunken, and when the mouse button is released, it look raised. I know that the sunken look is linked to the OnMouseDown event, but I can't figure out the code to acheive this look.

Many thanks,

Kev.
 
Kev,

The quick and dirty way I would tell you to do this is to have your two button images one for the raised button and one for the sunken.

Next create a transparent button an lay the button images and the transparent button on top of each other. The sunken image should be set to so its visible property is false.

On the Click event of the transparent button which will toggle the visible properties of the sunken and raised images and do whatever actions you wish the click of the button to do.

Hope this helps you.

Steve
 
Steve,
Yeah, I considered doing it that way, but I thought there must be a better, less 'bulky' way than this.

Thanks anyway,

Kev.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top