//Funcion que creara y dibujara los botones temporales de los usuarios public void construccion_BotonesTemps() { if (conteo < 5) { //creacion del boton temporal circular en memoria.. BotonCircular temp = new BotonCircular(); temp.Height = 144; temp.Width = 144; temp.Location = new Point(x, y); x += 170; temp.Name = string.Format("botonCircular{0}", conteo); temp.Text = string.Format("Usuario {0}", conteo); //Adicionamos el handler temp.Click += new EventHandler(handlerComun_Click); //Adicionamos el boton a la forma Controls.Add(temp); conteo++; variableGlobal.contador = conteo; } else { MessageBox.Show("No se pueden agregar más usuarios ", "Advertencia", MessageBoxButtons.OK, MessageBoxIcon.Warning); } }
private void InitializeComponent() { // this.btnFlat = new System.Windows.Forms.Button(); this.button1 = new Button(); //////////////////// Inicializar el boton this.bsalir = new Button(); this.label1 = new Label(); //inicializar el label this.labeltitulo = new Label(); this.TextBox1 = new TextBox(); //iniciamos el textbox this.botonc = new BotonCircular(); // Inicializar el boton //// NPI this.SuspendLayout(); // // botonc // this.botonc.Font = new Font("Segoe UI", 8F, System.Drawing.FontStyle.Bold); ///////////////// this.botonc.Location = new Point(800, 200); //////////////////// this.botonc.Click += new EventHandler(this.botonc_Click); // // button1 // this.button1.Font = new Font("Segoe UI", 8F, System.Drawing.FontStyle.Bold); ///////////////// this.button1.Location = new Point(10, 10); //////////////////// this.button1.Name = "button1"; //////////////////// this.button1.Size = new System.Drawing.Size(120, 25); //////////////////// this.button1.Text = "CALCULAR AFORO"; //////////////////// this.button1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; //////////////////// this.button1.FlatStyle = FlatStyle.Flat; this.button1.Click += new EventHandler(this.button1_Click); // // bsalir // this.bsalir.Font = new Font("Segoe UI", 8F, System.Drawing.FontStyle.Bold); ///////////////// this.bsalir.Location = new Point(945, 10); //////////////////// this.bsalir.Name = "button1"; //////////////////// this.bsalir.Size = new System.Drawing.Size(45, 25); //////////////////// this.bsalir.Text = "SALIR"; //////////////////// this.bsalir.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; /////////MiddleCenter/TopCenter////////// this.bsalir.FlatStyle = FlatStyle.Flat; this.bsalir.Click += new EventHandler(this.bsalir_Click); // // Label1 // this.label1.Location = new Point(button1.Left, button1.Height + button1.Top + 10); //localizacion del label en el formulario this.label1.Name = "label1"; //Nombre del label como tal this.label1.Font = new Font("Segoe UI", 6F, System.Drawing.FontStyle.Bold); this.label1.Size = new Size(600, 700); //Tamaño del label 600/700 this.label1.Text = "y"; //lo que muestra el label al usuario // // Labeltitulo // this.labeltitulo.Size = new Size(600, 25); //Tamaño del label this.labeltitulo.Location = new Point(550 - (labeltitulo.Width / 2), 10); //localizacion del label en el formulario this.labeltitulo.Name = "labeltitulo"; //Nombre del label como tal this.labeltitulo.Font = new Font("Segoe UI", 16F, System.Drawing.FontStyle.Bold); this.labeltitulo.Text = "INGENIERA DE TRANSITO Y TRANSPORTES 2016"; //lo que muestra el label al usuario // // TextBox // this.TextBox1.Location = new Point(button1.Left + 610, button1.Height + button1.Top + 10); this.TextBox1.Size = new Size(50, 30); this.TextBox1.Text = ""; // // FormularioOpaco //////////////////// // this.AutoScaleBaseSize = new System.Drawing.Size(5, 13); this.ClientSize = new System.Drawing.Size(1000, 600); this.Opacity = .85; this.BackColor = Color.MintCream; //cambia color de fondo, Black, MintCream, MediumOrchid, this.ForeColor = Color.MediumOrchid; //cambia color de la fuente SlateBlue // Define el tipo o estilo de borde del formulario this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; //FixedDialog, None, Fixed3D this.Name = "FormularioOpaco"; this.Text = "PROGRAMA VENTANA GRAFICA 1.1.0"; this.CancelButton = bsalir; // // Añadir los botones, label, picturebox al FormularioOpaco //////////////////// // this.Controls.Add(this.button1); //////////////////// this.Controls.Add(this.bsalir); this.Controls.Add(this.label1); //////////////////// this.Controls.Add(this.labeltitulo); this.Controls.Add(this.TextBox1); this.Controls.Add(this.botonc); /// NPI this.ResumeLayout(false); }