Delphi Tips&Tricks News   Tips   .NET Software   VCL Software   Search   Contacts
Ultimate Pack - special offer!

Ultimate Pack  hot!
Image Editor  new!
Runtime Fusion
Form Designer
Object Inspector
Print Suite Pro
Commented Image
Delphi Toys
WinDowse
Delphi Bonus
TMS Scripter Studio
Form Designer VB
Form Designer .NET

...get more...
for Delphi.NET, C#, VB.NET
for Delphi VCL, BCB 3-6

WinAPI Online
Unix Manual Pages
MegaDetailed.NET
in3steps.com
cdtrrracks.com new!

Blogspot  greatis.blogspot.com

Get Memo current line - Components - Tips & Tricks - Greatis Delphi Pages

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