我们都知道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);beginInitializeFlatSB(Memo1.Handle);end;
end.
想取消就调用UninitializeFlatSB好了。
Copyright @ 2007-2012 敏韬网(敏而好学,文韬武略--MinTao.Net)(学习笔记) Inc All Rights Reserved. 闵涛 E_mail:admin@mintao.net(欢迎提供学习资源)
鄂公网安备 42011102001154号
站长:MinTao ICP备案号:鄂ICP备11006601号-18