cancel
Showing results for 
Search instead for 
Did you mean: 

Toggle button for both click and mouse over events

Former Member
0 Kudos

Hi!

My goal is to implement (emulate) my custom button behaviour. So, I have 3 images for my button: when button is disabled, when it is enabled, when it is focused (mouse over). My first attempt was to use toggle button. The problem is that I should catch both mouse over (and show image with focused button) and mouse click (click on the enabled button should to some action) events, and toggle button can't hook both. I tried 2 toggle buttons (the same size, the same place) but mouse events are blocked by upper button.

Any suggestions?

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Yury,

The basic technique to do this is to

1. create a click-event button

2. Behind it, put a (much larger) mouseover-event button, which is invisible.

It order to move your mouse on the click-event button, you will need to go through the edge of the larger mouseover-event button, thus triggering its action.

Former Member
0 Kudos

Thank you,

I thought about it. The problem is whenever mouse goes to click-event button, toggle button looses focus and this triggers opposite action on toggle button. So, my image for "mouse on" will be shown for the moment and will disappear when I'll focus click-event button.

Former Member
0 Kudos

Thank you,

I thought about it. The problem is whenever mouse goes to click-event button, toggle button looses focus and this triggers opposite action on toggle button. So, my image for "mouse on" will be shown for the moment and will disappear when I'll focus click-event button.

Answers (0)