Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Object-Pascal / Delphi-Language (https://www.delphipraxis.net/32-object-pascal-delphi-language/)
-   -   Problem mit THotKey Komponente (https://www.delphipraxis.net/177481-problem-mit-thotkey-komponente.html)

hungrycoder 8. Nov 2013 14:12

Delphi-Version: 2007

Problem mit THotKey Komponente
 
Hallo zusammen,
ich würde gerne Werte in der HotKey Komponente anzeigen wie zum Beispiel: STRG+ALT+B
Nur weiß ich leider nicht, ob dies überhaupt möglich ist, da ich es einfach nicht hinkriege.
Dachte mir was einfaches wie das folgende würde klappen nur funktioniert es nicht.
Delphi-Quellcode:
var shortcuts : TShortCut;
begin
  if s = 'STRG' then
    shortcuts := MOD_CONTROL;
  if s = 'ALT' then
    shortcuts := shortcuts or MOD_ALT;
//usw.
  HotKey1.HotKey := shortcuts + Ord('A');
end;
Nun die Frage: Ist es überhaupt möglich eine Anzeige, ohne das selbständige eintragen in die Komponente, anzuzeigen?
Wenn ja würde mir eine Antwort das komplette Wochenende retten :)

hungrycoder

Volker Z. 8. Nov 2013 14:48

AW: Problem mit THotKey Komponente
 
Hallo,

Zitat:

ich würde gerne Werte in der HotKey Komponente anzeigen wie zum Beispiel: STRG+ALT+B
Nur weiß ich leider nicht, ob dies überhaupt möglich ist
Hilft Dir vielleicht
Delphi-Quellcode:
HotKey1.HotKey := ShortCut (Ord ('B'), [ssCtrl, ssAlt])
weiter (Du musst nur die Unit Menus einbinden und Key sowie ShiftState entsprechend füllen)?

Gruß

hungrycoder 8. Nov 2013 14:55

AW: Problem mit THotKey Komponente
 
@Volker,
du bist der Beste!!!

Vielen Dank, hat perfekt funktioniert.


Alle Zeitangaben in WEZ +1. Es ist jetzt 06:42 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