/// <summary> /// Arranges the apperance of the message box overlay. /// </summary> public void ArrangeApperance(InforType type) { lblText.Text = _properties.Message; switch (type) { case InforType.Default: BackColor = _defaultColor; break; case InforType.Error: BackColor = _errorColor; break; case InforType.Success: BackColor = _success; break; case InforType.Warning: BackColor = _warningColor; break; default: break; } }
public static void Show(IWin32Window owner, string message, int height, InforType type, int showTime) { if (owner != null) { Form _owner = (owner as Form == null) ? ((UserControl)owner).ParentForm : (Form)owner; _control = new MsgInforBoxControl(); _control.Properties.Message = message; _control.Padding = new Padding(0, 0, 0, 0); _control.ControlBox = false; _control.ShowInTaskbar = false; _control.TopMost = true; _control.Size = new Size(_owner.Size.Width, height); _control.Location = new Point(_owner.Location.X, _owner.Location.Y + (_owner.Height - _control.Height) / 2); _control.ArrangeApperance(type); _control.ArrangeVisible(showTime); _control.ShowDialog(); _control.BringToFront(); } }
public static void Show(IWin32Window owner, string message, InforType type, int showTime) { Show(owner, message, defaultHeight, type, showTime); }