mercredi 16 octobre 2002

Comment avoir la ligne courante dans un memo?

Comment avoir la ligne courante dans un memo?
procedure TForm1.MemExpKeyUp(Sender: TObject; var Key: Word;
  Shift: TShiftState);
var
  LigneNum: LongInt;
begin
  if (Key=VK_UP)or(Key=VK_DOWN) then
  begin
    LigneNum:=MemExp.Perform(EM_LINEFROMCHAR, MemExp.SelStart, 0);
    Label1.Caption:='Line - '+IntToStr(LigneNum+1);
  end;
end;

Aucun commentaire:

Enregistrer un commentaire