ImageEn, unit iemview

TImageEnMView.SetModernStyling

TImageEnMView.SetModernStyling


Declaration

procedure SetModernStyling(bAutoGridWidth : Boolean = False; iThumbWidth : Integer = 0; iThumbHeight : Integer = 0; bSoftShadow: Boolean = True; DarkColors: Boolean = False);


Description

Call SetModernStyling in FormCreate to update the control with the settings which closely match the current Windows styling.

if bAutoGridWidth is enabled then GridWidth is set to -1. You can also optionally specify default values for GridWidth and GridWidth and add a SoftShadow.

The current implementation of SetModernStyling makes the following changes:

  Style                        := iemsFlat;
  Background                   := clWindow;
  ThumbnailsBackground         := clWindow;
  ThumbnailsBackgroundSelected := $00FCEADA;
  ThumbnailsBackgroundHover    := $00FFF3E5;
  SelectionColor               := $00CEA27D;
  TextMargin                   := 4;
  HorizBorder                  := 8;
  VertBorder                   := 8;
  UpperGap                     := 0; (or 4 if bSoftShadow = False)
  BottomGap                    := 0; (or 4 if bSoftShadow = False)
  LeftGap                      := 0; (or 4 if bSoftShadow = False)
  RightGap                     := -1; (which uses the same value as LeftGap)
  TextBackgroundStyle          := bsClear;
  SoftShadow.Radius            := 2;
  SoftShadow.OffsetX           := 1;
  SoftShadow.OffsetY           := 1;
  SoftShadow.Intensity           := 50;
  SoftShadow.Enabled           := bSoftShadow;


If DarkColors is enabled, a darker set of colors is applied.


Examples

procedure TForm1.FormCreate(Sender: TObject);
begin
  ImageEnMView1.SetModernStyling( True );
end;

// Apply modern styling with dark colors
ImageEnMView1.SetModernStyling( True, 0, 0, False, True );


See Also

Style
SetStyleEx
EnableTheming