简体   繁体   中英

How can i custom the scrollbar color in Delphi2009?

Sadly that Delphi2009 has applied the theme service and it always draw the scrollbar using the Windows System Theme. As a result, i cannot custom the scrollbar color.

Is it possible that i can custom the scrollbar color without changing the OS System Theme?

Addition: The Windows Theme is not my concern, i'm only trying to custom the scrollbar color of a given control, such as TMemo, or TStringGrid, etc.

Thank you.

Explict disabling the theming for the memo will work...

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls;

type
  TMemo=Class(StdCtrls.TMemo)
    Procedure CreateWnd;override;
  End;

  TForm1 = class(TForm)
    Memo1: TMemo;
    procedure Button1Click(Sender: TObject);
  private
    { Private-Deklarationen }
  public
    { Public-Deklarationen }
  end;

var
  Form1: TForm1;

implementation
uses uxTheme;

{$R *.dfm}



{ TMemo }

procedure TMemo.CreateWnd;
begin
  inherited;
   SetWindowTheme(Handle,'','');
end;

end.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM