Link to home
Start Free TrialLog in
Avatar of computerprogramer
computerprogramer

asked on

Invisible Button

Hey,

I have a bitmap as a background and I dont want to put seperate images as a button. So I have included the button as a bitmap.
To make it when I click on one of the buttons (included with the bitmap) I put a button over each image and set its visible option to FALSE. But when I click on the image it doesnt do anything even though the Click function is set so it goes to another form. I tried doing it with the Visible Option to TRUE and it works but I need it to be seen through.

How would I make a button invisible but you can still click it ?
So I can put a invisible button over a background image.

Cheers,

Computer Programer
ASKER CERTIFIED SOLUTION
Avatar of Ferruccio Accalai
Ferruccio Accalai
Flag of Italy image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Try something like this

On the image click procedure:

formx.buttonx.onclick(sender); //this references the buttons onclick procedure

Regards,

Hypoviax
Avatar of gangsterboss
gangsterboss

u could even try it as a image map
split the image up into sections and set the onclick procedure
The above suggestions represent your only viable approaches; an invisible control cannot receive input focus so you'll never be able to click it.

FrankTheRat
use a TShape

- set brush.style to bsClear
- set pen.style to psClear

shape is now invisible on your background

for clicking use
the onMouseDown and/or onMouseUp-event of the TShape

meikl ;-)

Franktherat,

You can set the focus of a control and thus it can get the focus to click it. Besides my code would work as their is no actual clicking but references to click procedures. Therefore the click is simulated.

Regards,

Hypoviax
If it isnt necessary to focuse on this button you can use SpeedButton component.
It can be transparent inseted of invisible.
Also have a FLAT property to fully transparent.

When you use this component it is like a button without any caption.
If Transparent propert be true just button border will be shown and
if Flat propert set to True Nothing will be shown.
But when mouse is over button , border of button will be highlight.

Best Regard.