如何跳到指定位置(RichEdit)? var i:integer;...i:=要跳转到的位置;richedit1.selstart:=i;richedit1.sellength:=0; 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 顶行设定:procedure TSRichEdit.SetTopLine(Value: integer);{Put selected line at top of memo}var tl: integer;begin tl := Value; if tl < 0 then tl := 0; if tl > Lines.Count - 1 then tl := Lines.Count - 1; SendMessage(Handle, EM_LINESCROLL, 0, tl - SendMessage(Handle, EM_GETFIRSTVISIBLELINE, 0, 0));end;光标定位到某一行:procedure TSRichEdit.SetCurrentLine(Value: integer);{Put caret on start of selected line}var cl: integer;begincl := Value;{Restrict range to available lines}if cl < 0 then cl := 0;if cl > Lines.Count - 1 then cl := Lines.Count - 1;SelLength := 0;SelStart := SendMessage(Handle, EM_LINEINDEX, cl, 0);end;光标定位到某一列:procedure TSRichEdit.SetCurrentPosition(Value: integer);var cl: integer; cp: integer;begincl := GetCurrentLine;cp := Value;if cp < 0 then cp := 0;if (cp > Length(Lines[cl])) then cp := Length(Lines[cl]);{Put caret in selected position}SelLength := 0;SelStart := SendMessage(Handle, EM_LINEINDEX, cl, 0) + cp;end;光标定位到指定的坐标点 richedit1.Perform(WM_LBUTTONDOWN, MK_LBUTTON, MakeLong(X, Y)); 帮我找找这段话的错误,错误提示S没有参数默认值 无聊散分,夜猫接分 全局变量赋值的问题 行政区图上色 帮帮忙,怎样用IWTreeView控件读取后台数据啊 高分求源码。怎么在Delphi中建立套帐。 delphi+adoquery,用SELECT查询没有满足条件的记录,如果再做其它查询时就会出错? 查询问题 关于PopMenu的问题,高分相送 我的Paradox数据库又出问题了,咋办? 在RichEdit里如何跳到指定行里指定字符的位置。 能否在panel上动态添加label,如何实现。感谢!
procedure TSRichEdit.SetTopLine(Value: integer);
{Put selected line at top of memo}
var
tl: integer;
begin
tl := Value;
if tl < 0 then tl := 0;
if tl > Lines.Count - 1 then tl := Lines.Count - 1;
SendMessage(Handle, EM_LINESCROLL, 0, tl - SendMessage(Handle, EM_GETFIRSTVISIBLELINE, 0, 0));
end;光标定位到某一行:
procedure TSRichEdit.SetCurrentLine(Value: integer);
{Put caret on start of selected line}
var
cl: integer;
begin
cl := Value;
{Restrict range to available lines}
if cl < 0 then cl := 0;
if cl > Lines.Count - 1 then cl := Lines.Count - 1;
SelLength := 0;
SelStart := SendMessage(Handle, EM_LINEINDEX, cl, 0);
end;光标定位到某一列:
procedure TSRichEdit.SetCurrentPosition(Value: integer);
var
cl: integer;
cp: integer;
begin
cl := GetCurrentLine;
cp := Value;
if cp < 0 then cp := 0;
if (cp > Length(Lines[cl])) then cp := Length(Lines[cl]);
{Put caret in selected position}
SelLength := 0;
SelStart := SendMessage(Handle, EM_LINEINDEX, cl, 0) + cp;
end;
光标定位到指定的坐标点 richedit1.Perform(WM_LBUTTONDOWN, MK_LBUTTON, MakeLong(X, Y));