可悲的是,Delphi2009 已经应用了主题服务,它总是使用 Windows 系统主题来绘制滚动条。结果,我无法自定义滚动条颜色。
是否可以在不更改操作系统系统主题的情况下自定义滚动条颜色?
另外:Windows 主题不是我关心的问题,我只是想自定义给定控件的滚动条颜色,例如 TMemo 或 TStringGrid 等。
谢谢你。
明确禁用备忘录的主题将起作用......
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.