private void DownLoadImg_FormClosed(object sender, FormClosedEventArgs e) { UnregisterHotKey(this.Handle, 123); UnregisterHotKey(this.Handle, 124); DownLoadImg.isShow = false; DownLoadImg.instance = null; }
// 快捷键 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); }
public DownLoadImg() { InitializeComponent(); DownLoadImg.isShow = true; DownLoadImg.instance = this; }