Skip to content

Commit

Permalink
Merge pull request #1839 from Krypton-Suite/1837-bug-kryptonmessagebo…
Browse files Browse the repository at this point in the history
…xdefaultbuttonbutton2-doesnt-work-v85

* Resolved #1837 - V85
  • Loading branch information
Smurf-IV authored Nov 9, 2024
2 parents 6356616 + 3408a25 commit 343d1b3
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 8 deletions.
6 changes: 5 additions & 1 deletion Documents/Help/Changelog.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
# <img src="https://github.com/Krypton-Suite/Standard-Toolkit/blob/master/Krypton.png?raw=true"> 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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -480,25 +480,23 @@ 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:
_button4.Select();
AcceptButton = _showHelpButton ? _button4 : _button1;
break;
case KryptonMessageBoxDefaultButton.Button5:
AcceptButton = _showActionButton ? _button5 : _button1;

break;
default:
_button1.Select();
AcceptButton = _showHelpButton ? _button4 : _button1;
break;
}
Expand Down
12 changes: 12 additions & 0 deletions Source/Krypton Components/TestForm/Form1.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions Source/Krypton Components/TestForm/Form1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
}

0 comments on commit 343d1b3

Please sign in to comment.