Exemplo n.º 1
0
 private void Correccion_Deactivate(object sender, EventArgs e)
 {
     if (m_pc.ModoCorreccion != "")
     {
         m_pc.CambioModo(m_pc.ModoActualCorreccion);
     }
 }
Exemplo n.º 2
0
        public void DibujarControles(string frase, ProcesamientoComandos pc)
        {
            int      X = INI_X, Y = INI_Y;
            Graphics g = this.CreateGraphics();
            Label    tbPalabra;
            Label    lblPalabra;
            int      AnchoPalabra;

            m_pc = pc;

            if (m_pc.ModoCorreccion != "")
            {
                m_pc.CambioModo(m_pc.ModoCorreccion);
            }

            int alto  = Screen.PrimaryScreen.Bounds.Height;
            int ancho = Screen.PrimaryScreen.Bounds.Width;

            this.Width  = ancho;
            tbPalabras  = new Label[palabras.Length];
            lblPalabras = new Label[palabras.Length];
            for (int i = 0; i < palabras.Length; i++)
            {
                tbPalabra              = new Label();
                lblPalabra             = new Label();
                tbPalabras[i]          = tbPalabra;
                lblPalabras[i]         = lblPalabra;
                tbPalabra.Font         = new System.Drawing.Font("Arial", 11);
                lblPalabra.Font        = new System.Drawing.Font("Arial", 11);
                lblPalabra.BackColor   = System.Drawing.Color.Azure;
                tbPalabra.BackColor    = System.Drawing.Color.White;
                lblPalabra.BorderStyle = BorderStyle.FixedSingle;
                tbPalabra.BorderStyle  = BorderStyle.FixedSingle;

                lblPalabra.Text = i.ToString();
                tbPalabra.Text  = palabras[i];
                this.CreateGraphics();
                AnchoPalabra = (int)g.MeasureString(palabras[i], new Font("Arial", 11)).Width + 2 + ESPACIO_COMPONENTES;

                tbPalabra.Width      = AnchoPalabra;
                lblPalabra.Width     = AnchoPalabra;
                lblPalabra.TextAlign = ContentAlignment.MiddleCenter;

                if (X + AnchoPalabra + INI_X >= ancho - INI_X)
                {
                    int Alto = tbPalabra.Height + lblPalabra.Height + ESPACIO_VERTICAL;
                    Y           += Alto;
                    X            = INI_X;
                    this.Height += Alto;
                }
                tbPalabra.Location  = new System.Drawing.Point(X, Y);
                lblPalabra.Location = new System.Drawing.Point(X, Y - ALTURA_TB);

                X += AnchoPalabra;

                this.Controls.Add(tbPalabra);
                this.Controls.Add(lblPalabra);
            }
        }