Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   GUI-Design mit VCL / FireMonkey / Common Controls (https://www.delphipraxis.net/18-gui-design-mit-vcl-firemonkey-common-controls/)
-   -   Delphi Doppelklick auf TListBox ohne Items (https://www.delphipraxis.net/75055-doppelklick-auf-tlistbox-ohne-items.html)

PeterPanino 13. Aug 2006 15:34


Doppelklick auf TListBox ohne Items
 
TListBox reagiert nur dann auf einen Doppelklick (OnDblClick), wenn die ListBox mindestens ein Item enthält. Was könnte man tun, damit die ListBox auch dann auf Doppelklick reagiert, wenn kein Item enthalten ist?

Hawkeye219 13. Aug 2006 15:43

Re: Doppelklick auf TListBox ohne Items
 
Hallo Peter,

du könntest das MouseDown-Ereignis auswerten:

Delphi-Quellcode:
procedure TForm1.ListBox1MouseDown(Sender: TObject; Button: TMouseButton;
  Shift: TShiftState; X, Y: Integer);
begin
  IF (ssDouble in Shift) THEN
    ShowMessage ('Hallo Peter!');
end;
Es wird allerdings zusätzlich zum DblClick-Ereignis ausgelöst.

Gruß Hawkeye

PeterPanino 13. Aug 2006 16:46

Re: Doppelklick auf TListBox ohne Items
 
Funktioniert wunderbar, vielen Dank und noch einen schönen Sonntag!


Alle Zeitangaben in WEZ +1. Es ist jetzt 16:27 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz