/// <summary> /// Creates a new popup window. OnClick it hides. Close and grip are disabled. Options are enabled. /// Padding is set to 10 for title and picture. Content has no padding. /// </summary> /// <returns></returns> public static PopupNotifier PopupFactory() { var popup = new PopupNotifier(); popup.Click += (o, e) => { ((PopupNotifier)o).Hide(); }; popup.ShowCloseButton = false; popup.ShowOptionsButton = true; popup.ShowGrip = false; popup.Image = Properties.Resources.fire; popup.ImagePadding = new Padding(10); popup.TitlePadding = new Padding(10); popup.ContentPadding = new Padding(0); return popup; }
/// <summary> /// Create a new instance. /// </summary> /// <param name="parent">PopupNotifier</param> public PopupNotifierForm(PopupNotifier parent) { Parent = parent; this.SetStyle(ControlStyles.OptimizedDoubleBuffer, true); this.SetStyle(ControlStyles.ResizeRedraw, true); this.SetStyle(ControlStyles.AllPaintingInWmPaint, true); this.ShowInTaskbar = false; this.VisibleChanged += new EventHandler(PopupNotifierForm_VisibleChanged); this.MouseMove += new MouseEventHandler(PopupNotifierForm_MouseMove); this.MouseUp += new MouseEventHandler(PopupNotifierForm_MouseUp); this.Paint += new PaintEventHandler(PopupNotifierForm_Paint); }
/// <summary> /// Create a new instance. /// </summary> /// <param name="parent">PopupNotifier</param> public PopupNotifierForm(PopupNotifier parent) { Parent = parent; SetStyle(ControlStyles.OptimizedDoubleBuffer, true); SetStyle(ControlStyles.ResizeRedraw, true); SetStyle(ControlStyles.AllPaintingInWmPaint, true); ShowInTaskbar = false; VisibleChanged += PopupNotifierForm_VisibleChanged; MouseMove += PopupNotifierForm_MouseMove; MouseUp += PopupNotifierForm_MouseUp; Paint += PopupNotifierForm_Paint; }