public Form1()
{
this.KeyPreview = true;
this.KeyUp += new System.Windows.Forms.KeyEventHandler(KeyEvent);
}
private void KeyEvent(object sender, KeyEventArgs e) //Keyup Event
{
if (e.KeyValue == 106)//ปุ่ม *
{
clearData();
}
else if (e.KeyCode == Keys.F1)//ปุ่ม F1
{
//rmConfrimPW frm = new frmConfrimPW();
// frm.ShowDialog();
if (VXX.user_stat == 1)
formState.Restore(this);
}
else if (e.KeyCode == Keys.F12)//ปุ่ม HOME
{
//ตั้งค่าเปิดโปรแกรมพร้อมกับ Windows
// Add the value in the registry so that the application runs at startup
rkApp.SetValue("MyApp", Application.ExecutablePath.ToString());
}
else if (e.KeyCode == Keys.F8)//ปุ่ม HOME
{
//ยกเลิกการตั้งค่า
// Remove the value from the registry so that the application doesn't start
rkApp.DeleteValue("MyApp", false);
}
else
{
// MessageBox.Show("No Function");
}
}