memo有这样方法可以实现,例如:Memo1.SelStart:=j;Memo1.SelLength:=j;Memo1.SetFocus;其中,j表示光标移动的位置。
Memo1.Lines.Add(ADODataSet_fat.FieldByName( 'Name ').AsString); //增加下面这两句语句 Memo1.SelStart := 0; Memo1.SelLength := 0;
memo2.SetFocus; memo2.SelStart:=0; memo2.SelLength:=0;
begin Memo1.SelStart := 0; // or Memo1.CaretPos := Point(0, 0); SendMessage(Memo1.Handle, EM_SCROLLCARET, 0, 0); // 滚动到光标位置 end;
使用SelStart即可。这句代码使光标移动到第一个字符处。 Memo1.SelStart := 1; 如果要从这里选中n个字符,则使用: Memo1.SelLength := n;
采用消息,sendmessage即可以
----------------------------------------------------------------------------------------------
以上都是我收集的 目前我用的是:
memo2.SelStart:=0;
memo2.SelLength:=0;
本文来自博客园,作者:del88,转载请注明原文链接:https://www.cnblogs.com/del88/archive/2012/07/17/2594702.html
浙公网安备 33010602011771号