Autor Beitrag
Tobias1
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 454

Win 98, XP Prof
D3 Prof, D2005 Prof
BeitragVerfasst: Di 04.01.05 21:41 
Wie weise ich ich einem MenuItem-Shortcut einen String zu?
Normalerweise schreibe ich folgendes
ausblenden Delphi-Quelltext
1:
Item1.shortcut:=Alt+A;					

Ich habe aber das Alt+A in einem String gespeichert.

Folgendes geht nicht:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
var
s1:string
.
.
s1:='Alt+A';
Item1.shortcut:=s1;


Vielen Dank!

_________________
Auch das schlechteste Buch hat seine gute Seite: die letzte. (John Osborne)
KidPaddle
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 351

WinXP,Linux
D7 Prof, XE7
BeitragVerfasst: Mi 05.01.05 08:06 
Es existiert eine entsprechende Delphi - Funktion, die einen String in einen ShortCut umwandelt.

ausblenden Quelltext
1:
  Menu.ShortCut := TextToShortCut('Alt+A');					

Gruß
KidPaddle
Tobias1 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 454

Win 98, XP Prof
D3 Prof, D2005 Prof
BeitragVerfasst: Mi 05.01.05 12:07 
Vielen Dank!

Das funktioniert!

_________________
Auch das schlechteste Buch hat seine gute Seite: die letzte. (John Osborne)