Symbol Mc1000 快捷键 的 设置 事件 开发

 switch (e.KeyCode)
   {
     ///////////////////////////////////////////////////////////////////////////////////数据
    case Keys.F1://清除数据
    
     if(File.Exists("Storage Card/CG.sdf"))
     {
      Mc.gConn.Close();
      Mc.gConn.Dispose();
      File.Delete("Storage Card/CG.sdf");
         
     }
     MessageBox.Show("全部数据清除成功,请重新启动本程序!");
     this.Close();
     break;
        case Keys.F2://导入数据
                       ChangeTextToDb();
       this.RecNum.Text="0";
         this.lbGczs.Text=Mc.InallGc();
        this.lbGczs.Refresh();
      this.lbGcZzs.Text=Mc.InallGcZs();
     this.lbGcZzs.Refresh();
         break;
    case Keys.F3://导出数据
     ChangeDbToText();
     this.RecNum.Text="0";
     break;
    case Keys.F4://清除预定库
     SqlCeCommand DelYdk=Mc.gConn.CreateCommand();
     DelYdk.CommandText="Delete from Ydk";
     DelYdk.ExecuteNonQuery(); 
     this.lbYdzs.Text = Mc.InallYd();
     this.lbGcZzs.Text=Mc.InallYdZs();
     this.lbGcZzs.Refresh();
     this.lbYdzs.Refresh();
     MessageBox.Show("预定库清除成功");
     break;
     ///////////////////////////////////////////////////////////////////////////////////数据
    case Keys.Right:
     this.CaiGou.Visible = true;
     this.ShuShangSheZhi.Visible = false;
     this.TongJi.Visible = false;
     break;
    case Keys.Down:
     this.ShuShang.Focus();
     this.CaiGou.Visible = false;
     this.ShuShangSheZhi.Visible = true;
     this.TongJi.Visible = false;
     break;
    case Keys.Up:
     //     this.lbGczs.Text = Mc.InallGc();
     this.lbYdzs.Text = Mc.InallYd();
     this.lbGcZzs.Text=Mc.InallGcZs();
     this.lbYdZzs.Text=Mc.InallYdZs();

     this.CaiGou.Visible = false;
     this.ShuShangSheZhi.Visible = false;
     this.TongJi.Visible = true;
     break;
    case Keys.Left:
     if (this.CaiGou.Visible == false && this.ShuShangSheZhi.Visible == false && this.TongJi.Visible == false)
     {
      this.Close();
      this.Dispose();
     }
     else
     {
      this.CaiGou.Visible = false;
      this.ShuShangSheZhi.Visible = false;
      this.TongJi.Visible = false;
     }
     break;
   }

你可能感兴趣的:(delete)