Try this.
Assume that your listbox has these items:
First line
Second line
Third line
Fourth line
If you want to know the number of lines in a listbox,
ListBox1.Items.Count; //returns 4.
If you want to get a string by line, use by index.
ListBox1.Items.Strings[0]; //returns string...
Add this event in your form.
procedure TForm1.FormKeyPress(Sender: TObject; var Key: Char);
begin
if Key = #27 then ShowMessage('Esc key is press.');
end;
or
procedure TForm1.FormKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
begin
if Key = VK_ESCAPE then...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.