|
Get Memo current line
Use EM_LINEFROMCHAR message for Memo:
procedure TForm1.Memo1KeyUp(Sender: TObject; var Key: Word;
Shift: TShiftState);
var
LineNum: LongInt;
begin
if (Key=VK_UP)or(Key=VK_DOWN) then
begin
LineNum:=Memo1.Perform(EM_LINEFROMCHAR, Memo1.SelStart, 0);
Label1.Caption:='Line - '+IntToStr(LineNum+1);
end;
end;
- Related chapters
-
Fonts
- Related topics
-
Scroll a Memo
Open ComboBox from other control
Setting ListBox font
- For more
-
Win32 programmer's reference
- Download source
|