RichEdit1.SelStart := SendMessage(RichEdit1.Handle, EM_LINEINDEX, 19, 0);
RichEdit1.Perform(EM_SCROLLCARET, 0, 0);
这种用法在2000下还是能滚动的。
你在程序中只要将计算出的位置把19,0替换了就行了。
RichEdit1.Perform(EM_SCROLLCARET, 0, 0);
这种用法在2000下还是能滚动的。
你在程序中只要将计算出的位置把19,0替换了就行了。
解决方案 »
- 在Delphi中如何取ACCESS数据库中日期型字段的数值?
- paradox数值型小数位如何设置?
- IdTCPClient和IdTCPServer 发送字符的时候为什么不能超过 string[255] ??
- 很急! 100分!:做了一个组件 实现属性的下拉列表显示 可是安装之后没有效果 帮帮忙看一下代码哪里有毛病!!!!!
- treeview 显示图标
- 如何使用QuiickReport的NewPage手动分页
- 亲爱的delphifan们,累了,玩会儿cs
- 关于列出网络上所有SQL SERVER服务器的问题
- 怎样用delphi的 InstallShield
- rar
- stringgrid中,怎样设置每列的宽度?还有行高?
- 如何用Delphi通过Internet实现给手机发短消息
var
startpos, position, endpos: integer;
begin
startpos := 0;
with RichEdit do
begin
endpos := Length(RichEdit.Text);
Lines.BeginUpdate;
while FindText(SearchText, startpos, endpos, [stMatchCase])<>-1 do
begin
endpos := Length(RichEdit.Text) - startpos;
position := FindText(SearchText, startpos, endpos, [stMatchCase]);
Inc(startpos, Length(SearchText));
SetFocus;
SelStart := position;
SelLength := Length(SearchText);
end;
Lines.EndUpdate;
end;
end;
我没有装xp系统,无法测试。
RichEdit1.SelStart不就是要知道的要选定文字的开始处吗,那我怎么知道19,0的位置呢?
另外那个FindText方法的问题您知道是什么原因吗?