你看这样行不行??混了点,不过也还勘用。
uses
commctrl;
type
TMyMemo = class(TMemo)
private
procedure WMHScroll(var msg:TWMHScroll);message WM_HScroll;
procedure WMVScroll(var msg:TWMVScroll);message WM_VScroll;
procedure WMMousemove(var msg:TWMMousemove);message WM_MouseMove;
public
end;
var
Form1: TForm1;
memo:TMyMemo;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
begin
memo:=TMyMemo.Create(self);
memo.Parent:=self;
memo.Lines:=memo1.Lines;
memo.Align:=alLeft;
memo.ScrollBars:=ssBoth;
memo.Ctl3D:=false;
InitializeFlatSB(memo.Handle);
end;
{ TMyMemo }
procedure TMyMemo.WMHScroll(var msg: TWMHScroll);
begin
InitializeFlatSB(memo.handle);
inherited;
end;
procedure TMyMemo.WMMousemove(var msg: TWMMousemove);
begin
cursor:=crHandpoint;
end;
procedure TMyMemo.WMVScroll(var msg: TWMVScroll);
begin
InitializeFlatSB(memo.Handle);
inherited;
end;