Example #1
0
        private void btnCancelar_Click(object sender, EventArgs e)
        {
            int i               = 0,
                indice          = -1;
            string seleccionado = "";

            string[] texto = textBox1.Lines;
            seleccionado = textBox1.SelectedText;

            foreach (string item in texto)
            {
                if (item == seleccionado)
                {
                    indice = i;
                }
                i++;
            }

            seleccionado += " " + indice.ToString();
            MessageBox.Show(seleccionado);

            FrmTempera   frm       = new FrmTempera(miPaleta[indice]);
            DialogResult resultado = frm.ShowDialog();

            if (resultado == DialogResult.OK)
            {
                this.miPaleta     -= frm.MiTempera;
                this.textBox1.Text = (string)miPaleta;
            }
        }
Example #2
0
        private void btnAceptar_Click(object sender, EventArgs e)
        {
            FrmTempera tempera = new FrmTempera();

            tempera.StartPosition = FormStartPosition.CenterScreen; //Centramos el formulario

            //Abrimos el formulario tempera y no dejamos que lo cierre a traves de X
            DialogResult rta = tempera.ShowDialog();

            if (rta == DialogResult.OK)
            {
                this.miPaleta     += tempera.MiTempera;
                this.textBox1.Text = (string)miPaleta;
            }
        }