Board index » delphi » Disable auto hotkey for menuitems

Disable auto hotkey for menuitems

Is there any way to disable the auto hotkey for menuitems?   I just want
"File" to be shown, instead of "&File" Which Underscore-F is always auto
generated during run time.

Thanks

-Pick Chen

 

Re:Disable auto hotkey for menuitems


"Ong Pick Chen" <pickc...@ebooksys.com> wrote in message
news:3975625f@dnews...

Quote
> Is there any way to disable the auto hotkey for menuitems?   I just want
> "File" to be shown, instead of "&File" Which Underscore-F is always auto
> generated during run time.

The TMainMenu has a property AutoHotKeys - set it to maManual.

Ian

Re:Disable auto hotkey for menuitems


Quote
>Ong Pick Chen wrote:

>Is there any way to disable the auto hotkey for menuitems?   I just >want "File" to be shown, instead of "&File" Which Underscore-F is >always auto generated during run time.

There is a property called AutoHotkeys <g> which you can set.
________
Andreas
Delphi 5.01 Pro, NT4.0 Sp5
Direct replies mailto:p...@augsburg.netsurf.de

Re:Disable auto hotkey for menuitems


Quote
Ian Stuart <ian.stu...@chelloNOSPAM.at> wrote in message

news:8l4g3b$nph15@bornews.borland.com...

Quote
> "Ong Pick Chen" <pickc...@ebooksys.com> wrote in message
> news:3975625f@dnews...
> > Is there any way to disable the auto hotkey for menuitems?   I just want
> > "File" to be shown, instead of "&File" Which Underscore-F is always auto
> > generated during run time.

> The TMainMenu has a property AutoHotKeys - set it to maManual.

> Ian

Thanks, but this only work when menu is linked to Form, but not a toolbar.
I have put menu item on a toolbar so that it moves inside a control bar, but
I don't want the hotkey to be enabled which automatically assign no matter
what.

-Pick Chen

Re:Disable auto hotkey for menuitems


"Ong Pick Chen" <pickc...@ebooksys.com> wrote in message
news:39765f36@dnews...
Quote

> Thanks, but this only work when menu is linked to Form, but not a toolbar.
> I have put menu item on a toolbar so that it moves inside a control bar,
but
> I don't want the hotkey to be enabled which automatically assign no matter
> what.

Ah, but you didn't say that in the first place <g>. Nevertheless it appears
you have a point! I created a MainMenu (AutoHotKeys set to maManual),
populated it and then setup a toolbar to use the toplevel items. I did not
clear the Menu property of the form such that I could see the menu and the
toolbar menu items. Result - if you click top level items in the Menu then
items show correctly with no accelerator keys. If you click toolbar items -
the underscore shows and what's more, going back to the Menu shows that menu
items now have accelerator keys.

As far as I can see it appears to be a bug in either
comctrls.TToolbar.CheckMenuDropDown where FTempMenu is created without
getting the AutoHotKeys value from the button menuitem, or a problem with
TMenuItem.InternalRethinkHotKeys which doesn't seem to check the AutoHotKeys
state of submenu items - either way, there doesn't seem to be a way round it
as far as I can see. Perhaps one of the experts can help ....

Regards
Ian

Re:Disable auto hotkey for menuitems


Quote
> Ah, but you didn't say that in the first place <g>. Nevertheless it
appears
> you have a point! I created a MainMenu (AutoHotKeys set to maManual),
> populated it and then setup a toolbar to use the toplevel items. I did not
> clear the Menu property of the form such that I could see the menu and the
> toolbar menu items. Result - if you click top level items in the Menu then
> items show correctly with no accelerator keys. If you click toolbar
items -
> the underscore shows and what's more, going back to the Menu shows that
menu
> items now have accelerator keys.

> As far as I can see it appears to be a bug in either
> comctrls.TToolbar.CheckMenuDropDown where FTempMenu is created without
> getting the AutoHotKeys value from the button menuitem, or a problem with
> TMenuItem.InternalRethinkHotKeys which doesn't seem to check the
AutoHotKeys
> state of submenu items - either way, there doesn't seem to be a way round
it
> as far as I can see. Perhaps one of the experts can help ....

That is the exact way I tested it too and get disappointed.

Anyway, many thanks to U for helping.

Other Threads