gorilla Posted June 12, 2003 Posted June 12, 2003 (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 June 13, 2003 by divil Quote
*Experts* mutant Posted June 12, 2003 *Experts* Posted June 12, 2003 Did you try setting KeyPreview property of the form to true? Quote
wyrd Posted June 12, 2003 Posted June 12, 2003 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: Quote Gamer extraordinaire. Programmer wannabe.
gorilla Posted June 12, 2003 Author Posted June 12, 2003 doh, what do you knwo...i feel so stupid now haha thanks guys!! Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.