我们都知道Delphi的很多控件有滚动条,可现在很流行浮动式滚动条。Delphi的控件并不具备这样的外观。现在流行FloatStyle套件。可是当我不具备该套又想拥有浮动式滚动条的控件该怎么办呢?
用commctrl单元中的InitializeFlatSB函数
下面看个例子很好玩的
unit Unit1;
interface
uses Windows, Messages, commctrl, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls;
type TForm1 = class(TForm) Button1: TButton; Memo1: TMemo; procedure Button1Click(Sender: TObject); private { Private declarations } public { Public declarations } end;
var Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject); begin InitializeFlatSB(Memo1.Handle); end;
end.
想取消就调用UninitializeFlatSB好了。
|