views:

210

answers:

1

I am looking for a Delphi button designed to use with Aero Glass running Vista and Windows 7, with the following properties:

  1. completely self-drawn TCustomControl descendant.

  2. looks good [ renders in a way that looks to the user like a normal button, with no glitches ] over a Glass pane with Aero composition (DWM), no white or black ring around the button, and no problems with the caption getting messed up by Aero composition. (This will knock out any button that has not been written to be glass aware.)

  3. The usual features of a TButton/TBitButton, including link to TActions, support for a glyph (bitmap/picture), etc.

Optional, nice to have features:

  1. Transparency support (optional, it would be nice if it could be opaque but draw cleanly over glass).
+3  A: 

I can throw TRzButton from Raize Components into the ring. The form should have DoubleBuffered set to true to make the labels visible, but the button must have DoubleBuffered switched off to remove the unwanted frame.

Raize Button on Glass

You can also use TRzBitBtn if a glyph is required. As an alternative TPngBitBtn from PngComponents will also qualify.

Uwe Raabe
There is absolutely no reason to buy an expensive third-party component, when Cosmin Prund has shown how easy it is to make the standard `TButton` work flawlessly. See http://stackoverflow.com/questions/3357224/delphi-support-for-aero-glass-and-the-doublebuffered-property-what-is-going-on/3364941#3364941
Andreas Rejbrand
Andreas: True, but I did ask, because I wanted to know. And this is the only one that I have seen that works out of the box without the standard TButton glitch, or any workarounds. If the Jvcl meta-button component (JvdotNetButton) doesn't work, I'm a gonna' fix it shortly, as shown how by Cosmin.
Warren P
@Andreas: For one: PngComponents are free - and for Two: regarding the other stuff you get with Raize Components, TRzButton is anything but expensive.
Uwe Raabe
+1. I like all the Raize components and my code doesn't work :( The button does work flawlessley but the form does not.
Cosmin Prund
@Cosmin: Your code tries to mimic the TransparentColor property which is mutually exclusive with glassframe. That is why it is prohibited in the VCL code.
Uwe Raabe
@Uwe Raabe: Why are they mutually exclusive? In my opinion it's an bug of some sort in the Windows implementation because the documentation doesn't mention you're not supposed to use both at the same time and indeed if you try to use both it VISUALLY seems to work.
Cosmin Prund
@Cosmin: I don't know why they are - probably because it just doesn't work. This is from Forms.pas: "if FTransparentColor and FGlassFrame.Enabled then FGlassFrame.Enabled := False; // GlassFrame and TransparentColor are mutually exclusive"After all it is not the docs we have to cope with, it is the reality.
Uwe Raabe