Ejemplo n.º 1
0
 // 快捷键
 protected override bool ProcessCmdKey(ref System.Windows.Forms.Message msg, System.Windows.Forms.Keys keyData)
 {
     if (keyData == Keys.F12)
     {
         string batFile = this.batPathTextBox.Text;
         this.runCmd(batFile);
     }
     else if (keyData == Keys.Space)
     {
         // 快捷打开excel
         var len = this.listViewData.SelectedItems.Count;
         if (len > 0)
         {
             this.ClickToolStripMenuItem_OpenExcelFile(null, null);
         }
         else
         {
             this.AddLog("[警告] listView 没有 item 被选择!");
         }
     }
     else if (keyData == Keys.F1)
     {
         if (DownLoadImg.isShow == false)
         {
             this.Top = 0;
             Form win = new DownLoadImg();
             win.Show();
         }
         else
         {
             if (DownLoadImg.instance != null)
             {
                 DownLoadImg.instance.Activate();
             }
         }
     }
     else if (keyData == Keys.F2)
     {
         if (CutImg.isShow == false)
         {
             this.Top = 0;
             Form win = new CutImg();
             win.Show();
         }
         else
         {
             if (CutImg.instance != null)
             {
                 CutImg.instance.Activate();
             }
         }
     }
     return(true);
 }
Ejemplo n.º 2
0
 public CutImg()
 {
     InitializeComponent();
     CutImg.instance = this;
     CutImg.isShow   = true;
 }