Recent

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

jamie

  • Hero Member
  • *****
  • Posts: 6130
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.
The only true wisdom is knowing you know nothing

piola

  • Full Member
  • ***
  • Posts: 124
  • Lazarus 2.2, 64bit on Windows 8.1 x64
Re: TComboBox in csDropDownList mode
« Reply #16 on: June 04, 2019, 12:00:23 pm »
This code is actually working! Thank you very much!

 

TinyPortal © 2005-2018