Recent

Author Topic: TComboBox in csDropDownList mode  (Read 1201 times)

jamie

  • Hero Member
  • *****
  • Posts: 2068
Re: TComboBox in csDropDownList mode
« Reply #15 on: June 03, 2019, 07:54:50 pm »
Code: Pascal  [Select]
  1. procedure TForm1.ComboBox1CloseUp(Sender: TObject);
  2. begin
  3.   if GetKeyState(VK_RETURN) < 0 Then Caption := 'Closed by ENETER KEY';
  4.   If GetKeyState(VK_ESCAPE) < 0 THen Caption := 'Closed By ESCAPE KEY';
  5. end;                                            
  6.  

 The LCLintf I believe has the GetKeyState function so this should work across the board.

 The main issue with the Combobox Is that it's two controls, while the list is open you don't have direct access
to the list with out hooking into its window procedure.. All you have is notification messages sent to the parent .

 In this example, the user will still be holding down the key when this happens.
Number 1 at blue screen app creations!

piola

  • New Member
  • *
  • Posts: 37
Re: TComboBox in csDropDownList mode
« Reply #16 on: June 04, 2019, 12:00:23 pm »
This code is actually working! Thank you very much!