Custom pushbutton

I would like to make a completely different looking pushbutton for my app.
I’ve been using the bevelbutton class for this, because it supports to use icons, but on windows I can’t get rid of the bevel. So the bevel button is not an option.

My second thought was to use the pushbutton class, but as far as I know it doesn’t support icons or background images.
So I tried using a canvas for this, but canvases only has doubleclick events and I need a single click event.

I hardly can imaging that xojo doesn’t support custom looking buttons, but I am out of options at the moment.

Can anyone help me, please.

Thanks.

Andre

Canvas has a MouseDown event, which is the single click event you are looking for.

…and a mouseUp event which is where you should put your action code after returning True fron the MouseDown because that’s the behavior users expect from a button. I have most of my buttons as custom canvas-based buttons. It works well. Make yourself a subclass of canvas to handle the mundane things you will need from a button

Will try again.

Thanks guys.

That’s true, this is the usual expectation of a standard button. I mentioned MouseDown because he will probably want to at least change the appearance of his custom button, on MouseDown.

Absolutely :slight_smile:

Btw the I hit the ‘answer’ button accidentally, but it seems I can’t rollback.

[quote=33787:@Andre VB]Absolutely :slight_smile:

Btw the I hit the ‘answer’ button accidentally, but it seems I can’t rollback.[/quote]
You can, just click the answer button again. It should clear it.

No, unfortunately it doesn’t.

I think there’s gotta be 500 of these, as each of us has his/her own :slight_smile:

I remember when I did mine with hover, mouseclick and mousedown and disabled as all different states. When I did I realized I had been adding these a custom code each time for years.