Esempio n. 1
0
        private void InitializeComponent()
        {
            //Propiedades del panel
            this.Size      = new Size(785, 565);
            this.Location  = new Point(0, 0);
            this.BackColor = Color.FromArgb(40, 40, 40);

            //Instancia del panel Progreso
            this.progreso = new Progreso();
            this.Controls.Add(this.progreso);

            //Instancia del panel del generador
            this.panelGenerador = new PanelGenerador(progreso, this);
            this.Controls.Add(panelGenerador);

            //Instnacia de los botones
            this.btnAbortar = new Button
            {
                Size      = new Size(60, 60),
                Location  = new Point(710, 20),
                BackColor = Color.Transparent,
                FlatStyle = FlatStyle.Flat,
                Image     = Image.FromFile(Directory.GetCurrentDirectory() + "\\images\\abort.png")
            };
            btnAbortar.FlatAppearance.BorderSize = 0;
            this.btnAbortar.Click += Clic_Abortar;
            this.btnAbortar.FlatAppearance.MouseDownBackColor = Color.Transparent;
            this.btnAbortar.FlatAppearance.BorderSize         = 0;
            this.btnAbortar.FlatAppearance.MouseOverBackColor = Color.Transparent;
            this.btnAbortar.FlatAppearance.BorderColor        = Color.FromArgb(40, 40, 40);

            /*
             * this.btnAyuda = new Button
             * {
             *  Size = new Size(60, 60),
             *  Location = new Point(15, 20),
             *  BackColor = Color.Transparent,
             *  FlatStyle = FlatStyle.Flat,
             *  Image = Image.FromFile(Directory.GetCurrentDirectory() + "\\images\\help.png")
             * };
             * this.btnAyuda.Click += BtnAyuda;
             * this.btnAyuda.FlatAppearance.MouseDownBackColor = Color.Transparent;
             * this.btnAyuda.FlatAppearance.BorderSize = 0;
             * this.btnAyuda.FlatAppearance.MouseOverBackColor = Color.Transparent;
             * this.btnAyuda.FlatAppearance.BorderColor = Color.FromArgb(40, 40, 40);*/


            this.Controls.Add(this.btnAbortar);
            // this.Controls.Add(this.btnAyuda);
        }
        private void BtnReiniciar(object sender, EventArgs e)
        {
            //Limpiamos la interfaz
            this.contenedor.Controls.Remove(this);
            this.Dispose();


            progreso.ProgresoValue = 0;
            progreso.UpdateTextColor();

            //Instancia del panel
            PanelGenerador panel = new PanelGenerador(progreso, contenedor);

            contenedor.Refresh();
            contenedor.Controls.Add(panel);
        }