private void toolStripMenuItemSoftInfo_Click(object sender, EventArgs e) { FrmSoftInfo formInstance = new FrmSoftInfo(); formInstance.StartPosition = FormStartPosition.CenterParent; formInstance.ShowDialog(this); }
/// <summary> /// 快捷键 /// </summary> private void ContainerForm_KeyDown(object sender, KeyEventArgs e) { if (Session.SOFT_VERSION_TYPE == SoftVersionType.Client) { // 注册机器码 if (e.Modifiers == (Keys.Control | Keys.Shift | Keys.Alt) && e.KeyCode == Keys.F8) //Ctrl+Shift+Alt+F8 { if (Session.CURRENT_SOFT == null) return; if (!string.IsNullOrEmpty(Session.CURRENT_SOFT.RegCode)) return; FrmUserRegister formRegCode = new FrmUserRegister(); formRegCode.StartPosition = FormStartPosition.CenterParent; DialogResult dresult = formRegCode.ShowDialog(this); if (dresult == System.Windows.Forms.DialogResult.Yes) { UserUtils.ShowInfo("注册成功!"); InitClientUI(); Session.CURRENT_SOFT.RegCode = CommonTool.GetRegCode(Session.CURRENT_SOFT.MachineCode); } if (dresult == System.Windows.Forms.DialogResult.No) { UserUtils.ShowError("注册失败!"); } } // 查看机器码 if (e.Modifiers == (Keys.Control | Keys.Shift | Keys.Alt) && e.KeyCode == Keys.F9) //Ctrl+Shift+Alt+F9 { FrmSoftInfo formInstance = new FrmSoftInfo(); formInstance.StartPosition = FormStartPosition.CenterParent; formInstance.ShowDialog(this); } } }