7

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).
Warren P
  • 65,725
  • 40
  • 181
  • 316
  • Did you see this article, BTW? Apparently stuff drawing funny on glass is a broader Windows issue and not just a VCL problem. http://delphihaven.wordpress.com/2010/07/29/controls-and-glass/ – Mason Wheeler Jul 29 '10 at 16:36
  • Oh yeah, of course. I'm thinking about it a lot, thus this question. I asked the question that prompted that blog article. – Warren P Jul 29 '10 at 17:23
  • I gave you a solution as an answer to one of your other questions. I can't copy-paste the link because I am on an iPad right now. – Cosmin Prund Jul 29 '10 at 17:34
  • 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 Jul 29 '10 at 19:54
  • Elsewhere and in the Delphi QC area, it turns out that regular TButton can't work flawlessly because the Common Controls library itself and glass don't play nice. But TBitBtn with doublebuffered off works fine. – Warren P May 08 '12 at 12:04

1 Answers1

4

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.

Community
  • 1
  • 1
Uwe Raabe
  • 45,288
  • 3
  • 82
  • 130
  • 3
    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 Jul 29 '10 at 19:55
  • 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 Jul 29 '10 at 20:33
  • @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 Jul 29 '10 at 20:48
  • +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 Jul 30 '10 at 07:23
  • @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 Jul 30 '10 at 07:42
  • @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 Jul 30 '10 at 08:06
  • @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 Jul 30 '10 at 08:41