How to create a non-rectangular button with Delphi?

button, delphi, vcl

Solution

Basically you use SetWindowRgn to define the shape of your button/control/window. See here for an example.

Or if you don't mind that your button can't be selected by the keyboard you could also use a TImage and use the OnMouseUp event.

Or find a 3rd party button that already does what you want on Torry.

Problem

How to create a transparent non-rectangular button with Delphi?

Original source