如题

解决方案 »

  1.   

    procedure TForm1.Button1Click(Sender: TObject);
    var
      iLine: Integer;
    begin
      iLine := SendMessage(RichEdit1.Handle, EM_LINEFROMCHAR, RichEdit1.SelStart, 0);
      Self.Caption := '当前行:' + IntToStr(iLine + 1);
      RichEdit1.Lines[iLine] := '添加内容' + RichEdit1.Lines[iLine]; //往行首插入内容
    end;
      

  2.   

    http://search.csdn.net/Expert/topic/1965/1965621.xml?temp=.7884638