public MessageBoxForm (IWin32Window owner, string text, string caption,
MessageBoxButtons buttons, MessageBoxIcon icon,
bool displayHelpButton)
{
show_help = displayHelpButton;
Icon = icon;
switch (icon) {
case MessageBoxIcon.None: {
icon_image = null;
alert_type = AlertType.Default;
break;
}
case MessageBoxIcon.Error: { // Same as MessageBoxIcon.Hand and MessageBoxIcon.Stop
icon_image = SystemIcons.Error;
alert_type = AlertType.Error;
break;
}
case MessageBoxIcon.Question: {
icon_image = SystemIcons.Question;
alert_type = AlertType.Question;
break;
}
case MessageBoxIcon.Asterisk: { // Same as MessageBoxIcon.Information
icon_image = SystemIcons.Information;
alert_type = AlertType.Information;
break;
}
case MessageBoxIcon.Warning: { // Same as MessageBoxIcon.Exclamation:
icon_image = SystemIcons.Warning;
alert_type = AlertType.Warning;
break;
}
}
msgbox_text = text;
msgbox_buttons = buttons;
msgbox_default = MessageBoxDefaultButton.Button1;
this.Text = caption;
}