Using toolbutton's shortcuts

I have a ToolBar with ToolButtons associated with a menu on a first form.
Calling that menu items creates new forms:

 Form2 := TForm2.Create(Self);
 Form2.ShowModal;
 Form2.Free;

Everything works great when I click the toolbutton using the mouse. But when
I use shortcut keys the keyboard on the new form seems not to work at all,
namely DBControls behave like disabled, although shortcut keys on buttons
work properly.
shrlduAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

mhervaisCommented:
listening
0
Phoenix_sCommented:
can you provide a touch more info perhaps as I do not fully understand the situation here
0
CalvinDayCommented:
If you use the mouse, second form works correctly.
If you use the keyboard, second form does not work correctly.
Is this what you are saying?
0
Become a Certified Penetration Testing Engineer

This CPTE Certified Penetration Testing Engineer course covers everything you need to know about becoming a Certified Penetration Testing Engineer. Career Path: Professional roles include Ethical Hackers, Security Consultants, System Administrators, and Chief Security Officers.

shrlduAuthor Commented:
I have a menu and all menu item's OnClick events create new forms. I have a ToolBar also. The ToolButtons on it are connected to menu items. Menu items have shortcuts. Newly created forms have DBControls on them like grids, and also buttons with shortcuts etc.
When I start new forms with the mouse, the new forms work correctly. When I start the new forms with the ToolButton shortcuts I cannot for instance move the pointer in the grid or edit a DBEdit control using the keyboard - but I can use the mouse. And I can push the buttons on the new forms - with the mouse or with the shortcuts.
I use Delphi 4, Windows 98 English Edition with Polish settings (Polish programmer keyboard).
0
shrlduAuthor Commented:
The problem should be in principle easy to reproduce... I must add that I have changed the registry to disable the Ctrl+Alt hot keys in the IDE setting the registry string:
 
HKEY_CURRENT_USER\Software\Borland\Delphi\4.0\Editor\Options\NoCtrlAltKeys

to "1"
 
Thanks to it I can use right Alt to produce Polish letters.

Thank you
0
StefaanCommented:
Hi,

Just a little thought here.  Why don't you use a TActionList component and react on a specific action instead of reacting on a menu item and on a Toolbar button.

Consider the TActionList and you will see that it will save you time and maybe solve your problem (Since you can link one Action to both a Menu Item and a Toolbar Button).

Best regards,


Stefaan
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
shrlduAuthor Commented:
Hi Stefaan,

I'm going to accept your comment as answer. When I resigned from linking the ToolButton with the menu action through MenuItem property, it started to work correctly. The ActionList works OK, and calling the action directly through ToolButton OnClick event also.

Thank you
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Delphi

From novice to tech pro — start learning today.