Главная страница | назад





Article #17000: Forcing edit mode in a TListView via a keypress

 Question and Answer Database

FAQ2000D.txt   Forcing edit mode in a TListView via a keypress
Category   :VCL
Platform    :All
Product    :All 32 bit  

Question:
When the user clicks on a caption in the listview, it goes into
edit mode. How can I force the edit mode by pressing F2 or a similar
key?

Answer:
The following example demonstrates trapping the F2 key in a
Listview control and forcing the caption into edit mode.

Example:

procedure TForm1.ListView1KeyDown(Sender: TObject; var Key: Word;
  Shift: TShiftState);
begin
  if Ord(Key) = VK_F2 then
    ListView1.Selected.EditCaption;
end;


7/16/98 4:31:28 PM
 

Last Modified: 01-SEP-99