using System; using System.Collections.Generic; using System.ComponentModel; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; namespace Xylem.Common.Ui.CordonelPreadjustmentUi { public partial class MsgBox : Form { public event EventHandler ButtonClicked; public MsgBox( string Title,string Msg, string ButtonText = "Ok", Icon Icon = null) { InitializeComponent(); if (Icon == null) { Icon = SystemIcons.Information; } this.Icon = Icon; this.Text = Title; txt.Text = Msg; btn.Text = ButtonText; } private void btn_Click(object sender, EventArgs e) { ButtonClicked?.Invoke(sender, EventArgs.Empty); } } }