Board index » delphi » GroupBox Disabled - make its caption appear disabled ?

GroupBox Disabled - make its caption appear disabled ?

Is there a way to make the caption of a  GroupBox take on the
appearance of grayed-out when the GroupBox is disabled in the same way
other controls look when disabled ?

If not, is there a font.color that can be used to accomplish this ?

Is there a way to make all controls within a groupbox appear disabled
(also grayed-out) when the GroupBox itself is disabled (other than
programmatically setting each control individually disabled) ?

 

Re:GroupBox Disabled - make its caption appear disabled ?


You will have to make your own TGroupBox descendant to accomplish this.

You can draw a grayed-out text by:
- Drawing the text in clBtnHighlight offset by 1 pixel horizontal and 1
vertical.
- Drawing the text again in clBtnShadow at the original location.

"Steve Parus" <spa...@umich.edu> schreef in bericht
news:39183fda.1354128@news.itd.umich.edu...

Quote
> Is there a way to make the caption of a  GroupBox take on the
> appearance of grayed-out when the GroupBox is disabled in the same way
> other controls look when disabled ?

> If not, is there a font.color that can be used to accomplish this ?

> Is there a way to make all controls within a groupbox appear disabled
> (also grayed-out) when the GroupBox itself is disabled (other than
> programmatically setting each control individually disabled) ?

Re:GroupBox Disabled - make its caption appear disabled ?


In article <39183fda.1354...@news.itd.umich.edu>, spa...@umich.edu (Steve

Quote
Parus) writes:
>Is there a way to make the caption of a  GroupBox take on the
>appearance of grayed-out when the GroupBox is disabled in the same way
>other controls look when disabled ?

The easiest way is to place a TLabel over the group-box caption and set that's
Enabled when you set the group box's Enabled.

Quote
>Is there a way to make all controls within a groupbox appear disabled
>(also grayed-out) when the GroupBox itself is disabled (other than
>programmatically setting each control individually disabled) ?

Not easily but its only a few lines of code to disable all controls in the
groupbox :-

with GroupBox1 do
  for i := 0 to Controls.Count - 1 do
    Controls[i].Enabled := false;

Alan Lloyd
alangll...@aol.com

Other Threads