I want to combine a ComboBox's value and a MessageBoxIcon. I want it (basically) to do this:
MessageBox.Show("Text", "Text", MessageBoxButtons.OK, MessageBoxIcon.ComboBox.Value.ToString());
Is this possible? It doesn't have to be done in one line. The text will be either "Warning" or "Error".
Use the Enum.Parse method:
MessageBox.Show("Text", "Text", MessageBoxButtons.OK,
(MessageBoxIcon)Enum.Parse(typeof(MessageBoxIcon), ComboBox.Text.ToString());