Form Focus

gorilla

Member
Joined
Jun 12, 2003
Messages
12
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 didnt work...maybe its not a focus problem but does anyone have any suggestions for me? thanks this is what i have so far...

C#:
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;
				
				}	
			}
 
Last edited by a moderator:
Hrm.. Im 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:
 
Back
Top