private void Button_RightTopExit_Click(object sender, EventArgs e) { DialogResult result = KxMsgBox.Show("Exit?", "Do you want to close?", KxMsgBoxIcon.QUESTION, KxMsgBoxButton.YESNO); if (result == DialogResult.Yes) { Application.Exit(); } }
public static DialogResult Show(string text) { MsgBox = new KxMsgBox(); MsgBox.pictureBox_TopIcon.Visible = false; MsgBox.label_TopCaption.Visible = false; MsgBox.label_CenterMessage.Text = text; MsgBox.label_CenterMessage.Focus(); MsgBox.TopMost = true; MsgBox.ShowDialog(); return(Result); }
public static DialogResult Show(string caption, string text, KxMsgBoxIcon Icon, KxMsgBoxButton Button) { MsgBox = new KxMsgBox(); MsgBox.SetIcon(Icon); MsgBox.SetButton(Button); MsgBox.pictureBox_TopIcon.Visible = true; MsgBox.label_TopCaption.Visible = true; MsgBox.label_TopCaption.Text = caption; MsgBox.label_CenterMessage.Text = text; MsgBox.label_CenterMessage.Focus(); MsgBox.TopMost = true; MsgBox.ShowDialog(); return(Result); }
private void Button_MenuLeftFileOpen_Click(object sender, EventArgs e) { if (Setting_CryptTable_comboBox.SelectedIndex == -1 || KxSharpLib.Security.Kal.Crypto.GUseCrypt == KxSharpLib.Security.Kal.Crypto.EUseCrypt.Unknown) { logger.Write("[Unknown CryptTable, Please set a valid table!]"); return; } if (DATList != null) { logger.Write("[There is already a file loaded!]"); DialogResult diaResult = KxMsgBox.Show("Already open!", "There is already a file loaded!\nClose without saving ?", KxMsgBoxIcon.WARNING, KxMsgBoxButton.YESNO); switch (diaResult) { case DialogResult.Yes: { Center_EditorTextBox.Clear(); LoadedPK = new KxSharpLib.Kal.PK(); DATList.Clear(); DATList = null; treeView_PKiew.Nodes.Clear(); Setting_CryptTable_comboBox.Enabled = true; KxSharpLib.FormHelper.SetLabelText(label_CurrentFileTopCenter, "Current File: [None]"); break; } case DialogResult.No: return; default: return; } } using (OpenFileDialog filedia = new OpenFileDialog()) { filedia.Title = "Open PK File"; filedia.Filter = "PK files|*.pk"; filedia.CheckFileExists = true; filedia.CheckPathExists = true; switch (filedia.ShowDialog(this)) { case DialogResult.OK: { _ = new PackageHandler(filedia.FileName); Setting_CryptTable_comboBox.Enabled = false; textBox_FileInfo_Name.Text = Path.GetFileName(filedia.FileName); textBox_FileInfo_Path.Text = filedia.FileName; using (var md5 = MD5.Create()) { textBox_FileInfo_MD5.Text = BitConverter.ToString(md5.ComputeHash(File.ReadAllBytes(filedia.FileName))).Replace("-", "").ToLower(); } break; } default: break; } } }