Jump to content
Xtreme .Net Talk

Recommended Posts

Posted (edited)

Hey,

 

I have a bunch of buttons and i have some hot keys (keyboard shortcuts) to them. when the form loads, they work perfectly fine. but during run time, when the user clicks on a text box or some other control, they cease to work. Now aerwarnick posted soemthing about focus a while back and i tried it but it didn't work...maybe its not a focus problem but does anyone have any suggestions for me? thanks this is what i have so far...

 

private void OnKeyDownEvent(object sender, System.Windows.Forms.KeyEventArgs e)
		{
			Point posit = new Point (HideBar.Location.X, HideBar.Location.Y);
switch (e.KeyCode)
{
case Keys.F1:
HideMenu.Show(HideBar, posit);
break;
case Keys.F2:
break;
case Keys.F3:
break;
case Keys.F4:
AdminMenu.Show(Admin, posit );
break;
case Keys.F5:			
PaymentMenu.Show(Payment, posit );
break;
case Keys.F6:
break;
case Keys.F7:
AdItmMenu.Show(AdjustItm,posit );
break;
case Keys.F8:
CashMgmtMenu.Show(CashMgmt, posit );
break;
case Keys.F9:
AdjTransMenu.Show(AdjustTrans, posit );
break;
case Keys.F10:
break;
			
			}	
		}

Edited by divil
Posted

Hrm.. I'm probably off base here, but have you tried setting the forms keypreview property to true?

 

EDIT:

Doh, Mutant beat me to it. *shakes fist* :cool:

Gamer extraordinaire. Programmer wannabe.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...