public static void Show(string message, MessageboxType type) { using (MessageBoxExt messageBox = new MessageBoxExt(message)) { string title; switch (type) { case MessageboxType.Error: title = "错误"; break; case MessageboxType.Info: title = "提示"; break; default: throw new ArgumentNullException(); } messageBox.Text = title; messageBox.StartPosition = FormStartPosition.CenterParent; if (messageBox.ShowDialog() == DialogResult.OK) { return; } } }