By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
464,602 Members | 1,021 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 464,602 IT Pros & Developers. It's quick & easy.

Using function keys to change Tabs ... and F8 kills it all ... AAAAAAAAAARGH

P: n/a
Greeetings All ..

For my users convenience I have mapped function keys F2 .. F12 to change
the tabs on the Tabcontrol.

Works like a charm <ominous musicuntil one hits F8</ominous music>

That particular tabpage has a webbrowser object embedded in it .. and after
it flicks to that tabpage it no longer plays nice with the other Tabpages
.. click on another Tab using the mouse and all is wonderful again. (unless
you hit the dreaded F8)

below is my function for key trapping :

protected override bool ProcessDialogKey(Keys keyData)
{
switch (keyData)
{
case Keys.Control | Keys.M:
toggle_maintenance();
break;

case Keys.F2:
changeActiveTab(0, 0);
break;

case Keys.F3:
changeActiveTab(1, 0);
break;

case Keys.F4:
changeActiveTab(2, 0);
break;

case Keys.F5:
changeActiveTab(3, 0);
break;

case Keys.F6:
changeActiveTab(4, 0);
break;

case Keys.F7:
changeActiveTab(5, 0);
break;

case Keys.F8:
changeActiveTab(6, 0);
break;

case Keys.F10:
open_downtime_dialog();
break;

case Keys.F11:
new_job_screen();
break;

case Keys.F12:
open_shift_dialog();
break;

default:
/// nothing to do here ... move along
break;
}

return base.ProcessDialogKey(keyData);
}

Does the browser being active steal control of my function keys .. is there
a way around it? Do I have to sue some-one for mental anguish and never have
to write software again ????

---------------------------------------------
[Sam Samson] - There is no greater folly than fixed price quoting.
Sep 20 '07 #1
Share this Question
Share on Google+
1 Reply

P: n/a
Hi,

Does the browser being active steal control of my function keys .. is
there a way around it? Do I have to sue some-one for mental anguish and
never have to write software again ????
Most probably. What if you use the messagehook to try and override it?
Sep 20 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.