After rereading the informationbox code, I figured out how to get the state of my checkbox.
I had to create a new MsgBoxResult without the new keyword, and add the out parameter to that show.
So I ended up with this:
internal MsgBoxResult Show(out CheckState state)
{
Result = Show();
state = chkDoNotShowAgain.CheckState;
return Result;
}
And in the caller:
public static MsgBoxResult Show(string message, string caption, MsgBoxButtons msgBoxButtons, MsgBoxIcon icon, MsgBoxDefaultButton defaultButton,
MsgBoxCheckBox doNotShowAgain, out System.Windows.Forms.CheckState checkBoxState)
{
return new MsgBoxForm(message, caption, msgBoxButtons, icon, defaultButton, doNotShowAgain).Show(out checkBoxState);
}
Then I can call my MsgBox like this:
CheckState doNotShowAgain = CheckState.Indeterminate;
MsgBoxResult result = MsgBox.Show("Message", "Caption", MsgBoxButtons.OK, MsgBoxIcon.None, MsgBoxDefaultButton.Button1, MsgBoxCheckBox.Show, out doNotShowAgain);