没用过editor,不过你可以试着双击这个页面,你回看到一个现象,应该是你要的功能吧?
解决方案 »
- delphi 用indy控件开发一个与GPRS 终端通讯的程序,请帮忙!
- 救命,fastreport 4.2 有些中文显示不出来.
- !!!重金悬赏!:客户机访问服务器数据的连接问题
- 200分请高手帮我看看Indy组件报出的异常。
- www.daliancomputer.com大量技术文章、二手市场、论坛,欢迎大连的朋友进入!
- sqlserver里面的数据库恢复问题
- char与sting怎么转换呢?
- 菜鸟求救:怎么把数据库存的含有日期和时间的值,分别显示在datetimepicker和 edit上
- 关于动态菜单的解决方法
- ShellExecute 怎么老是报错
- 关于用SQL上传数据的问题
- http://www.csdn.net/cnshare/soft/11/11096.shtm 一个可以让你出售的软件!!
begin
SendMessage(Memo1.Handle, { HWND of the Memo Control }
WM_VSCROLL, { Windows Message }
SB_PAGEDOWN, { Scroll Command }
0)
end;
SendMessage(Memo1.Handle, WM_VSCROLL, SB_DOWN.., 0);
其中的第三个参数我忘了,可以控制上下左右滚动,你查一下吧,前缀
都是SB_之类的,如果要自己控制滚动速度,我想最好自己家一个ScrollBar就好控制了,不然很麻烦
加个timer控件,发送消息,设置inteval可调节滚动快慢。procedure TForm1.Timer1Timer(Sender: TObject);
begin
SendMessage(Memo1.Handle, { HWND of the Memo Control }
WM_VSCROLL, { Windows Message }
SB_PAGEDOWN, { Scroll Command }
0)
end; 然后你再用一个Button
procedure TForm1.Button1Click(Sender: TObject);
begin
Timer1.Enabled := True;
end;如果要按某一键停止的话,再在按那个键的事件中写Timer1.Enabled:=False
应该是可以了。
Form1: TForm1;
iScroolSpeed : integer=1000; //滚动速度
bIfScrool :boolean=False; //是否滚动?implementation{$R *.DFM}procedure TForm1.Timer1Timer(Sender: TObject);
begin
SendMessage(Memo1.Handle, { HWND of the Memo Control }
WM_VSCROLL, { Windows Message }
SB_LINEDOWN, { Scroll Command 单行滚动}
0);end;procedure TForm1.Memo1KeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
begin if Key = vk_F1 then bIfScrool := Not bIfScrool; //按F1滚动开始或停止 if bIfScrool then
case Key of
vk_F2 : iScroolSpeed := iScroolSpeed - 50; //F2加速
vk_F3: iScroolSpeed := iScroolSpeed + 50; //F3减速
end; if iScroolSpeed < 0 then iScroolSpeed := 1;
if iScroolSpeed > 5000 then iScroolSpeed := 5000; Timer1.Interval := iScroolSpeed;
Timer1.Enabled := bIfScrool;
end;end.
再把Memo1KeyDown的程序移到RichEdit1KeyDown中就ok了SendMessage(RichEdit1.Handle, { HWND of the Memo Control }
WM_VSCROLL, { Windows Message }
SB_LINEDOWN, { Scroll Command }
0);
SendMessage(Memo1.Handle, { HWND of the Memo Control }
WM_VSCROLL, { Windows Message }
SB_PAGEDOWN, { Scroll Command }
0)
应该是:
SendMessage(Memo1.Handle, { HWND of the Memo Control }
WM_VSCROLL, { Windows Message }
SB_LINEDOWN, { Scroll Command 单行滚动}
0);是SB_LINEDOWN 不是 SB_PAGEDOWN 就好了!