你要在什么地方滚动?Memo的自动滚动可以参看一下程序片断:
procedure TForm1.Edit1KeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
begin
if Key = VK_F8 then
SendMessage(Memo1.Handle, { HWND of the Memo Control }
WM_VSCROLL, { Windows Message }
SB_PAGEDOWN, { Scroll Command }
0) { Not Used }
else if Key = VK_F7 then
SendMessage(Memo1.Handle, { HWND of the Memo Control }
WM_VSCROLL, { Windows Message }
SB_PAGEUP, { Scroll Command }
0); { Not Used }
end; 如果要实现电影字幕效果,到开发中心看看,很多这种控件,你可以参考它的源码.
procedure TForm1.Edit1KeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
begin
if Key = VK_F8 then
SendMessage(Memo1.Handle, { HWND of the Memo Control }
WM_VSCROLL, { Windows Message }
SB_PAGEDOWN, { Scroll Command }
0) { Not Used }
else if Key = VK_F7 then
SendMessage(Memo1.Handle, { HWND of the Memo Control }
WM_VSCROLL, { Windows Message }
SB_PAGEUP, { Scroll Command }
0); { Not Used }
end; 如果要实现电影字幕效果,到开发中心看看,很多这种控件,你可以参考它的源码.
procedure TForm1.Timer1Timer(Sender: TObject);
begin
if statictext1.top>xxx then
statictext1.Top:=statictext1.top-xx;
end;