Example #1
0
        /*private static void actualizar()
         * {
         * this.listBox1.Items.Clear();
         * foreach (Tempera item in this.MiPaleta.MisTemperas)
         * {
         *  if (!Equals(item, null))
         *  {
         *    listBox1.Items.Add(Tempera.Mostrar(item));
         *  }
         * }
         * }
         */
        private void listBox1_SelectedIndexChanged(object sender, EventArgs e)
        {
            FormTempera frmTempera;
            int         lugar = listBox1.SelectedIndex;

            //MessageBox.Show(Tempera.Mostrar(MiPaleta.MisTemperas[lugar]));
            frmTempera = new FormTempera(MiPaleta.MisTemperas[lugar]);
            frmTempera.ShowDialog();
            if (frmTempera.DialogResult == DialogResult.OK)
            {
                MiPaleta.MisTemperas[lugar] = frmTempera.MiTempera;
            }
        }
Example #2
0
        private void button2_Click(object sender, EventArgs e)
        {
            //FormTempera frm = new FormTempera();

            /*string a;
             * int i = 0;
             *
             * a = this.listBox1.SelectedItem.ToString();
             *
             * foreach (Tempera item in this.MiPaleta.MisTemperas)
             * {
             *  if (item.Mostrar(item) == a)
             *  {
             *      this.MiPaleta.MisTemperas.RemoveAt(i);
             *      this.MiPaleta.MisTemperas.Insert(i,null);
             *      break;
             *  }
             *  i++;
             * }
             * this.listBox1.Items.Clear();
             * foreach (Tempera item in this.MiPaleta.MisTemperas)
             * {
             *  if (!Equals(item, null))
             *  {
             *      listBox1.Items.Add(item.Mostrar(item));
             *  }
             * }*/

            FormTempera frmTempera;
            int         lugar = listBox1.SelectedIndex;

            MessageBox.Show(Tempera.Mostrar(MiPaleta.MisTemperas[lugar]));
            frmTempera = new FormTempera(MiPaleta.MisTemperas[lugar]);
            frmTempera.ShowDialog();
            if (frmTempera.DialogResult == DialogResult.OK)
            {
                MiPaleta.MisTemperas.Remove(MiPaleta.MisTemperas[lugar]);
                this.listBox1.Items.Clear();
                foreach (Tempera item in this.MiPaleta.MisTemperas)
                {
                    if (!Equals(item, null))
                    {
                        listBox1.Items.Add(Tempera.Mostrar(item));
                    }
                }
            }
        }
Example #3
0
        private void button1_Click(object sender, EventArgs e)
        {
            FormTempera frm = new FormTempera();

            frm.ShowDialog();

            if (frm.DialogResult == DialogResult.OK)
            {
                this.MiPaleta += frm.MiTempera;
                this.listBox1.Items.Clear();

                foreach (Tempera item in this.MiPaleta.MisTemperas)
                {
                    if (!Equals(item, null))
                    {
                        listBox1.Items.Add(Tempera.Mostrar(item));
                    }
                }
            }
        }