示例#1
0
        public LoadingForm()
        {
            InitializeComponent();
               //
            //
            //

            //
            //testing PuTTy
            //

            //Double buffered activated in form.designer
            this.BackColor = Color.LightGray;

            loader = new LoadingControl(Color.Honeydew,
                Color.Transparent, 150);
            this.Controls.Add(loader);
            loader.Show();
        }
示例#2
0
        public FadeLoader(Control pControl, 
            Form pForm ,
            Color BrushColor, 
            Color backgroundColor,
            int animationSpeed)
        {
            parentForm = pForm;
            parentControl = pControl;
            loader = new LoadingControl(BrushColor, backgroundColor,
                animationSpeed);

            //Add Loader Control to Parent control so it shows up when being painted
            //parentControl.Controls.Add(loader);
            pControl.Controls.Add(loader);

            //set offset inside form for loader
            Point posInControl = new Point(pControl.Size.Width / 2 - (loader.Size.Width / 2)
                , pControl.Size.Height / 2 - (loader.Size.Height / 2));

            //get absolute x and yPos in entire Form
            Point posInForm = GetPositionInForm(pControl);

               // posInForm.Offset(posInControl);

            loader.Location = new Point(posInControl.X,
                                        posInControl.Y);

            loader.Name = "loader";
            loader.BringToFront();
            loader.Hide();

            alpha = 1.0F;
            fadeColorMatrix = new ColorMatrix();

            fadeTimer = new Timer();
            //Add custom event Handler
            fadeTimer.Tick += new System.EventHandler(this.fadeTimer_Tick);
        }