How can I create a non-rectangular button with Delphi?

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

+2


source to share


3 answers


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 cannot be selected by the key, you can also use TImage and use the OnMouseUp event.



Or find a third-party button that already does what you want on Torry .

+4


source


Raize Components has a component called TRzShapeButton, but there are probably free alternatives.



+3


source


You can only use SetWindowRgn if you don't mind that it looks pretty weird - bits that go outside the region will just disappear. Your best bet probably comes from TCustomTransparentControl, but then you will need to do some regular painting. I suspect this ordinary painting was what you were expecting all along?

+2


source







All Articles