Example #1
0
        /// <summary>
        /// Create a new instance of the popup component.
        /// </summary>
        public PopupNotifier()
        {
            // set default values
            HeaderColor       = SystemColors.ControlDark;
            BodyColor         = SystemColors.Control;
            ContentColor      = Color.White;
            BorderColor       = SystemColors.WindowFrame;
            ButtonBorderColor = SystemColors.WindowFrame;
            ButtonHoverColor  = SystemColors.Highlight;
            ContentHoverColor = SystemColors.HotTrack;
            GradientPower     = 0;
            //ContentFont = new Font("Verdana", 10.0f, FontStyle.Regular | FontStyle.Italic);
//            ContentFont = CustomFont.GetFont("Helve", 10, FontStyle.Regular);
//            TitleFont = CustomFont.GetFont("Helve", 12, FontStyle.Regular);
            //TitleFont = new Font("Verdana", 14.0f, FontStyle.Bold);
            TitleColor        = Color.FromArgb(255, 255, 255);
            ShowGrip          = true;
            Scroll            = true;
            TitlePadding      = new Padding(5, 5, 5, 0);
            ContentPadding    = new Padding(5, 2, 5, 5);
            ImagePadding      = new Padding(10);
            HeaderHeight      = 9;
            ShowCloseButton   = true;
            ShowOptionsButton = false;
            Delay             = 3000;
            AnimationInterval = 10;
            AnimationDuration = 1000;
            posStop           = 500;
            Size = new Size(400, 100);

            frmPopup                    = new PopupNotifierForm(this);
            frmPopup.TopMost            = true;
            frmPopup.FormBorderStyle    = FormBorderStyle.None;
            frmPopup.StartPosition      = FormStartPosition.Manual;
            frmPopup.FormBorderStyle    = FormBorderStyle.None;
            frmPopup.MouseEnter        += new EventHandler(frmPopup_MouseEnter);
            frmPopup.MouseLeave        += new EventHandler(frmPopup_MouseLeave);
            frmPopup.CloseClick        += new EventHandler(frmPopup_CloseClick);
            frmPopup.LinkClick         += new EventHandler(frmPopup_LinkClick);
            frmPopup.ContextMenuOpened += new EventHandler(frmPopup_ContextMenuOpened);
            frmPopup.ContextMenuClosed += new EventHandler(frmPopup_ContextMenuClosed);
            frmPopup.VisibleChanged    += new EventHandler(frmPopup_VisibleChanged);

            tmrAnimation       = new Timer();
            tmrAnimation.Tick += new EventHandler(tmAnimation_Tick);

            tmrWait       = new Timer();
            tmrWait.Tick += new EventHandler(tmWait_Tick);
        }
Example #2
0
 /// <summary>
 /// Dispose the notification form.
 /// </summary>
 /// <param name="disposing"></param>
 protected override void Dispose(bool disposing)
 {
     if (!disposed)
     {
         if (disposing && frmPopup != null)
         {
             frmPopup.Close();
             frmPopup.Dispose();
             frmPopup = null;
             MemoryManagement.FlushMemory();
         }
         disposed = true;
     }
     base.Dispose(disposing);
 }