From 3de7f6860cab1888049d30b0d7ed1e3f9ebddf92 Mon Sep 17 00:00:00 2001 From: Peter Wagner Date: Thu, 7 Nov 2024 16:06:51 +0000 Subject: [PATCH 1/3] * Resolved #1837 - V85 --- Documents/Help/Changelog.md | 6 +++++- .../Krypton.Toolkit/Controls Toolkit/KryptonMessageBox.cs | 2 ++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Documents/Help/Changelog.md b/Documents/Help/Changelog.md index 961c0eff0..bf54ef8ac 100644 --- a/Documents/Help/Changelog.md +++ b/Documents/Help/Changelog.md @@ -1,8 +1,12 @@ # Standard Toolkit - ChangeLog ======= + # 2024-11-14 - Build 2411 (Patch 4) - November 2024 -* Resolved [#1820](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1820), When KryptonDataGridView.AutoGenerate is set Winforms columns are used. See the issue for full text. +* Resolved [#1837](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1837), `KryptonMessageBoxDefaultButton.Button2` doesn't work +* Resolved [#1820](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1820), When KryptonDataGridView.AutoGenerate is set WinForms columns are used. See the issue for full text. + +======= # 2024-10-14 - Build 2410 (Patch 3) - October 2024 * Implemented [#1813](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1813), LTS Configuration diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonMessageBox.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonMessageBox.cs index 7234f18b8..1e76b6052 100644 --- a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonMessageBox.cs +++ b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonMessageBox.cs @@ -367,6 +367,8 @@ private static DialogResult ShowCore(IWin32Window? owner, kmb.StartPosition = showOwner == null ? FormStartPosition.CenterScreen : FormStartPosition.CenterParent; + (kmb.AcceptButton as KryptonButton)?.Select(); + return kmb.ShowDialog(showOwner); } From 2f8dd91a29e5158d8a5782e20a4c88324ae25d48 Mon Sep 17 00:00:00 2001 From: Peter Wagner Date: Fri, 8 Nov 2024 17:42:17 +0000 Subject: [PATCH 2/3] * Fix #1837 verified as working --- .../Controls Visuals/KryptonMessageBoxForm.cs | 10 +++------- Source/Krypton Components/TestForm/Form1.Designer.cs | 12 ++++++++++++ Source/Krypton Components/TestForm/Form1.cs | 6 ++++++ 3 files changed, 21 insertions(+), 7 deletions(-) diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/KryptonMessageBoxForm.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/KryptonMessageBoxForm.cs index b4647157b..5b9f9af90 100644 --- a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/KryptonMessageBoxForm.cs +++ b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/KryptonMessageBoxForm.cs @@ -480,23 +480,19 @@ private void UpdateDefault() switch (_defaultButton) { case KryptonMessageBoxDefaultButton.Button1: - //_button1.Select(); + _button1.Select(); AcceptButton = _button1; break; case KryptonMessageBoxDefaultButton.Button2: - //_button2.Select(); + _button2.Select(); AcceptButton = _button2; break; case KryptonMessageBoxDefaultButton.Button3: - //_button3.Select(); + _button3.Select(); AcceptButton = _button3; break; case KryptonMessageBoxDefaultButton.Button4: AcceptButton = _showHelpButton ? _button4 : _button1; - break; - case KryptonMessageBoxDefaultButton.Button5: - AcceptButton = _showActionButton ? _button5 : _button1; - break; default: AcceptButton = _showHelpButton ? _button4 : _button1; diff --git a/Source/Krypton Components/TestForm/Form1.Designer.cs b/Source/Krypton Components/TestForm/Form1.Designer.cs index a0ec5cd99..8774a88e1 100644 --- a/Source/Krypton Components/TestForm/Form1.Designer.cs +++ b/Source/Krypton Components/TestForm/Form1.Designer.cs @@ -88,6 +88,7 @@ private void InitializeComponent() this.kryptonIntegratedToolbarPrintCommand1 = new Krypton.Toolkit.KryptonIntegratedToolbarPrintCommand(); this.kryptonManager1 = new Krypton.Toolkit.KryptonManager(this.components); this.kryptonCheckSet1 = new Krypton.Toolkit.KryptonCheckSet(this.components); + this.kryptonButton9 = new Krypton.Toolkit.KryptonButton(); ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).BeginInit(); this.kryptonPanel1.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.kryptonThemeComboBox1)).BeginInit(); @@ -96,6 +97,7 @@ private void InitializeComponent() // // kryptonPanel1 // + this.kryptonPanel1.Controls.Add(this.kryptonButton9); this.kryptonPanel1.Controls.Add(this.kcbtnFormBorderStyleSizableToolWindow); this.kryptonPanel1.Controls.Add(this.kcbtnFormBorderStyleFixedToolWindow); this.kryptonPanel1.Controls.Add(this.kcbtnFormBorderStyleSizable); @@ -517,6 +519,15 @@ private void InitializeComponent() this.kryptonCheckSet1.CheckButtons.Add(this.kcbtnFormBorderStyleSizableToolWindow); this.kryptonCheckSet1.CheckedButton = this.kcbtnFormBorderStyleNone; // + // kryptonButton9 + // + this.kryptonButton9.Location = new System.Drawing.Point(14, 415); + this.kryptonButton9.Name = "kryptonButton9"; + this.kryptonButton9.Size = new System.Drawing.Size(183, 25); + this.kryptonButton9.TabIndex = 26; + this.kryptonButton9.Values.Text = "Test #1837"; + this.kryptonButton9.Click += new System.EventHandler(this.kryptonButton9_Click); + // // Form1 // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); @@ -608,5 +619,6 @@ private void InitializeComponent() private Krypton.Toolkit.KryptonContextMenuImageSelect kryptonContextMenuImageSelect1; private Krypton.Toolkit.KryptonContextMenuMonthCalendar kryptonContextMenuMonthCalendar1; private Krypton.Toolkit.KryptonContextMenuCheckBox kryptonContextMenuCheckBox1; + private Krypton.Toolkit.KryptonButton kryptonButton9; } } \ No newline at end of file diff --git a/Source/Krypton Components/TestForm/Form1.cs b/Source/Krypton Components/TestForm/Form1.cs index 0dc9a6f95..06794d0a7 100644 --- a/Source/Krypton Components/TestForm/Form1.cs +++ b/Source/Krypton Components/TestForm/Form1.cs @@ -309,5 +309,11 @@ private void kcbtnFormBorderStyleSizableToolWindow_Click(object sender, EventArg { UpdateFormBorderStyle(FormBorderStyle.SizableToolWindow); } + + private void kryptonButton9_Click(object sender, EventArgs e) + { + KryptonMessageBox.Show("question?", "title", KryptonMessageBoxButtons.YesNo, + KryptonMessageBoxIcon.Warning, KryptonMessageBoxDefaultButton.Button2); + } } } \ No newline at end of file From aecfb6e7b8a6e326743af275bc70f1adeb0cb60c Mon Sep 17 00:00:00 2001 From: Peter Wagner Date: Fri, 8 Nov 2024 17:59:32 +0000 Subject: [PATCH 3/3] Update KryptonMessageBoxForm.cs --- .../Krypton.Toolkit/Controls Visuals/KryptonMessageBoxForm.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/KryptonMessageBoxForm.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/KryptonMessageBoxForm.cs index 5b9f9af90..4df00105f 100644 --- a/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/KryptonMessageBoxForm.cs +++ b/Source/Krypton Components/Krypton.Toolkit/Controls Visuals/KryptonMessageBoxForm.cs @@ -495,6 +495,7 @@ private void UpdateDefault() AcceptButton = _showHelpButton ? _button4 : _button1; break; default: + _button1.Select(); AcceptButton = _showHelpButton ? _button4 : _button1; break; }