delphi~~richedit.lines.add 后,如何让光标还在插入的那行??
procedureTForm1.SpeedButton4Click(Sender:TObject);beginifspeedbutton4.Downthenrichedi...
procedure TForm1.SpeedButton4Click(Sender: TObject);
begin
if speedbutton4.Down then richedit1.lines.Add('0.')
else richedit1.Lines.clear;
end; 展开
begin
if speedbutton4.Down then richedit1.lines.Add('0.')
else richedit1.Lines.clear;
end; 展开
1个回答
2013-09-22
展开全部
procedure TForm1.SpeedButton4Click(Sender: TObject);var Index: Integer;
begin Index := RichEdit1.SelStart; // 记录当前行
if speedbutton4.Down then richedit1.lines.Add('0.')
else richedit1.Lines.clear; RichEdit1.SelStart := Index; // 插入以后重置当前行标
RichEdit1.SetFocus; // 设置焦点
end;
begin Index := RichEdit1.SelStart; // 记录当前行
if speedbutton4.Down then richedit1.lines.Add('0.')
else richedit1.Lines.clear; RichEdit1.SelStart := Index; // 插入以后重置当前行标
RichEdit1.SetFocus; // 设置焦点
end;
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询