tags:

views:

369

answers:

3

hello all Friend...

How to create a transparent Non-rectangular button with delphi?

I Need Urgent Help.........

+4  A: 

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.

Lars Truijens
+3  A: 

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

Wouter van Nifterick
+1 - And you get so many other components which are very mature and come with fantastic support. A very well thought out library.
skamradt
+2  A: 

You could use SetWindowRgn only if you didn't mind it looking quite odd - the bits that fall outside the region will simply be gone. Your best bet is probably deriving from TCustomTransparentControl, but you'd then need to do custom painting. I suspect though, that custom painting was what you expected all along?

Cobus Kruger