header Background structure
Sub-properties Panels with custom background
Return to Introduction  Previous page  Next page

Applies to

acHeader, acHeaderPanel, acPicturePanel and acSplitterPanel components.  

  TacBackground = class(TPersistent)  
    property Active: Boolean default False;  
    property GradientColor1: TColor default clBlue;  
    property GradientColor2: TColor default clBlack;  
    property GradientDirectionTacGradientDirection default gdHorizontal;  
    property Kind: TacBackgroundKind default bkGradient;  
    property Picture: TPicture;  
    property PictureStyle: TacBackgroundPictureStyle default bsTile;  

The Background structure used to specify custom background and its behaviors for the panel.  
If you're tired of single-tone color panels and want to show the picture as "wallpaper", or smooth gradient effect under the controls of panel — simply activate it by specifying True to Active property and choose the Kind of background (specify which background you want: picture or gradient effect).  
If you want to show the picture (wallpaper) — set Kind property to bkPicture, specify the image in Picture property and choose the style of wallpaper using PictureStyle property.  
If you want to show the gradient effect instead of usual background — set Kind property to bkGradient, choose the style of effect in GradientDirection property (it can be vertical, horizontal or central), then specify the colors in GradientColor1 and GradientColor2 properties.  
tip Alternatively, if you want to show your very own background / effect, you can use OnPaint event. Just write the OnPaint event handler and draw on the canvas of panel before all controls located on this panel will be displayed.  

See also
OnPaint event.  
acFormBackground component.