Esempio n. 1
0
        private void refreshform(bool anim)
        {
            //   tmrAnimation.Stop();

            Size = new Size(wid, 20 + (h_t * timelist.Count));

            System.Diagnostics.Debug.WriteLine(timelist.Count);
            if (anim == false)
            {
                //while going down content need to be refreshed first then and then displayed on screen
                frmPopup.Refresh();
                frmPopup.Size = Size;
            }
            else
            {
                //while animation is on form size refresh not require
                frmPopup.Size = Size;
            }

            frmPopup.painting_require = false;

            if (Scroll == true & anim == true)
            {
                if (animation_working == true)
                {
                    posStart = posCurrent;
                    System.Diagnostics.Debug.WriteLine("Postion start ");
                    System.Diagnostics.Debug.WriteLine(posStart);

                    posStop = Screen.PrimaryScreen.WorkingArea.Bottom - (frmPopup.Height);
                }
                else
                {
                    posStart = Screen.PrimaryScreen.WorkingArea.Bottom - (h_t * (timelist.Count - 1) + 20);
                    posStop  = Screen.PrimaryScreen.WorkingArea.Bottom - (frmPopup.Height);
                }
            }
            else
            {
                posStart = Screen.PrimaryScreen.WorkingArea.Bottom - (frmPopup.Height);
                posStop  = Screen.PrimaryScreen.WorkingArea.Bottom - (frmPopup.Height);
            }

            opacityStart = 1;
            opacityStop  = 1;

            frmPopup.Location = new Point(Screen.PrimaryScreen.WorkingArea.Right - frmPopup.Size.Width - 1, posStart);
            System.Diagnostics.Debug.WriteLine("value at refresh");
            System.Diagnostics.Debug.WriteLine(frmPopup.Location.Y.ToString());



            if (anim == true)
            {
                animation_working     = true;
                frmPopup.Opacity      = 1;
                tmrAnimation.Interval = AnimationInterval;
                tmrAnimation.Start();
                sw = System.Diagnostics.Stopwatch.StartNew();
                System.Diagnostics.Debug.WriteLine("Animation started.");
            }
            else
            {
                frmPopup.Opacity = 1;
            }

            frmPopup.painting_require = true;
            // referesh require to fill netw
        }