Use the Form's KeyPreview property to allow the Form "1st look" at the key
being pressed. Create an Event Handler for the KeyDownEvent, and have the
Form handle it. If it is the access key for the 2 buttons, use the
PerformClick method of the key that is in the currently-visible tab. Then
set the Handled property of the KeyEventArgs to true to prevent the event
from propogating to the child Controls.
--
HTH,
Kevin Spencer
Microsoft MVP
Professional Numbskull
If the truth hurts, wear it.
<ta*****@tlen.pl> wrote in message
news:11**********************@z34g2000cwc.googlegr oups.com...
I have 1 lil problem. I make simple Win Forms app and i put there a tab
control. There i make two pages. In each page i make 1 button. In
tabpage1 button1 and in tabpage2 button2. And i make access key for
both buttons. &button1 and &button2. They have same access key but they
are in diffrent pages. Access key works only in tabpage1 for button1
and access key for second button dont work. BUT! in diffrent comp it
works. Same exec run on mine comp dont work and in another comp it
works. Any1 know whats wrong?
I ll be greatfull for any advices.
Jarek