Like the subject says ...
I have a PopupMenu on my form and I need to have +, -, * and ^ as the ShortCut properties, but Delphi won't allow it. I tried adding it at runtime using the ShortCut() and TextToShortCut() functions, but that doesn't work either.
And I know there has to be some way because I've seen programs that have those characters as shortcuts.
Thanks
Comments
:
: I have a PopupMenu on my form and I need to have +, -, * and ^ as the ShortCut properties, but Delphi won't allow it. I tried adding it at runtime using the ShortCut() and TextToShortCut() functions, but that doesn't work either.
: And I know there has to be some way because I've seen programs that have those characters as shortcuts.
:
: Thanks
:
It works fine in D5. Just type a & before the shortcut character. I tested it using a TMainMenu with '&-Test' as caption.
: :
: : I have a PopupMenu on my form and I need to have +, -, * and ^ as the ShortCut properties, but Delphi won't allow it. I tried adding it at runtime using the ShortCut() and TextToShortCut() functions, but that doesn't work either.
: : And I know there has to be some way because I've seen programs that have those characters as shortcuts.
: :
: : Thanks
: :
: It works fine in D5. Just type a & before the shortcut character. I tested it using a TMainMenu with '&-Test' as caption.
:
The & shortcut wasn't really what I meant, but I found a way to get it to work. I iterated through all 65526 possible values and used ShortCutToText to see where the * and + where (106 and 107).
The good news is that they work as shortcuts, the bad news is that it displays "num *" and "num +" instead of just "*" and "+"
Think I'll need to do some API work to get it the way I want ... if I only knew which api's :-(
[b][red]This message was edited by zibadian at 2002-10-15 2:15:32[/red][/b][hr]
: : : Like the subject says ...
: : :
: : : I have a PopupMenu on my form and I need to have +, -, * and ^ as the ShortCut properties, but Delphi won't allow it. I tried adding it at runtime using the ShortCut() and TextToShortCut() functions, but that doesn't work either.
: : : And I know there has to be some way because I've seen programs that have those characters as shortcuts.
: : :
: : : Thanks
: : :
: : It works fine in D5. Just type a & before the shortcut character. I tested it using a TMainMenu with '&-Test' as caption.
: :
: The & shortcut wasn't really what I meant, but I found a way to get it to work. I iterated through all 65526 possible values and used ShortCutToText to see where the * and + where (106 and 107).
: The good news is that they work as shortcuts, the bad news is that it displays "num *" and "num +" instead of just "*" and "+"
:
: Think I'll need to do some API work to get it the way I want ... if I only knew which api's :-(
:
The & character before another character makes the second character the shortcut. So my example shows '-Test' with the '-' as the shortcut.
Have you also tried this?
[code]
MenuItem.ShortCut := ShortCut(Ord('-'), []);
[/code]
: [b][red]This message was edited by zibadian at 2002-10-15 2:15:32[/red][/b][hr]
: : : : Like the subject says ...
: : : :
: : : : I have a PopupMenu on my form and I need to have +, -, * and ^ as the ShortCut properties, but Delphi won't allow it. I tried adding it at runtime using the ShortCut() and TextToShortCut() functions, but that doesn't work either.
: : : : And I know there has to be some way because I've seen programs that have those characters as shortcuts.
: : : :
: : : : Thanks
: : : :
: : : It works fine in D5. Just type a & before the shortcut character. I tested it using a TMainMenu with '&-Test' as caption.
: : :
: : The & shortcut wasn't really what I meant, but I found a way to get it to work. I iterated through all 65526 possible values and used ShortCutToText to see where the * and + where (106 and 107).
: : The good news is that they work as shortcuts, the bad news is that it displays "num *" and "num +" instead of just "*" and "+"
: :
: : Think I'll need to do some API work to get it the way I want ... if I only knew which api's :-(
: :
: The & character before another character makes the second character the shortcut. So my example shows '-Test' with the '-' as the shortcut.
: Have you also tried this?
: [code]
: MenuItem.ShortCut := ShortCut(Ord('-'), []);
: [/code]
:
:
Yes but that doesn't work like you would expect. There is no connection between the input for ShortCut() and the Ord() value of characters. ShortCut(Ord('-'), []); actually sets "Ins" (Insert-button) as the shortcut and nothing at all for *, + and ^.
Thanks anyway