开发者

Transparent checkbox with theme-support?

开发者 https://www.devze.com 2022-12-28 18:33 出处:网络
I\'m looking for a simple, transparent checkbox component that properly supports XP/Vista/7 theming. It should also work with Delphi 7.

I'm looking for a simple, transparent checkbox component that properly supports XP/Vista/7 theming.

It should also work with Delphi 7.

I've found a component on Torry's that's not working properly, and I know that Raize componen开发者_开发百科ts has a transparent checkbox - but I'm obviously not going to pay $300 for the entire package just to get this single component.

I've also found many other solutions, but none of them support theming.

The main problem is that TCustomCheckBox is a TWinControl descendant, and in order to implement transparency, you need to make a new TGraphic descendant control from ground up.

Any ideas?


LMD-Tools SE is free, works great on Delphi 7 and has a checkbox component that has a transparency property. I've recently used TLMDCheckbox with its transparency property enabled with Delphi 7.

http://www.lmdinnovative.com/download/index.php#LMD

Download file: setupse10d7.zip. Sorry, I can't post the whole path (url) since I don't have enough juice yet.

This should fix you up :).

ShawnH.


Raize Components is overkill for just this component, but much more capable and supports transparency in a whole load more components. Once you have it, you'll appreciate the other items greatly. I'd say it is the solution you are looking for.


If you can accept an alternative control there is JvXPCheckCtrls.pas with its TJvXPCheckbox component in the JVCL library. http://jvcl.delphi-jedi.org I think (if I remember correct) it is transparent when themes are used.

It's quite a large package which will add to vcl with the installation of Jvcl. And it doesn't cost you a cent.

But remember, the TJvXPCheckbox component is part of their XP-controls package and you cannot simply lift out the component as a standalone. You will need the installation of Jedi and to get the core code and necessary theme handling to use it. - Its Mozilla Public Licence ("MPL") version 1.1.


I use AlphaControls for some of my programs - all of their components are skinnable and have reasonably powerful graphics handling options. A lot of the components also have more features than their corresponding Delphi standard components - some I just use for those functions alone. There's a free Lite version available at www.alphaskins.com - it may just be what you're after. It's not Vista/7 theme-aware, mind you. We use Delphi 2010 and vista/7 theme awareness is built into the standard VCL there, although that's probably not the solution you were hoping for.


Not sure if this will help, but I ran into what I think is the same problem when working with the TMSSmooth controls: the label of a checkbox place on a form looked terrible because it was not transparent.

Their demo/example programs had nice looking checkboxes so I took a look at their sample code.

Turns out they reduced the width of the checkbox component to 13 so that only the box itself and no caption shows. Then they added a TLabel for the caption.

Seemed like a clever workaround to me.

Hope this helps.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号