コード例 #1
0
        private void btnRestarTempera_Click(object sender, EventArgs e)
        {
            frmTempera frm = new frmTempera();

            frm.StartPosition = FormStartPosition.CenterScreen;
            frm.ShowDialog();
            if (frm.DialogResult == DialogResult.OK)
            {
                this.lsbPaleta.Items.Clear();
                this.p -= frm.MiTempera;
                for (int i = 0; i < 5; i++)
                {
                    this.lsbPaleta.Items.Add((string)this.p[i]);
                }
            }
        }
コード例 #2
0
        private void crearTemperaToolStripMenuItem_Click(object sender, EventArgs e)
        {
            frmTempera frm = new frmTempera();

            //frm.MdiParent = this;
            frm.StartPosition = FormStartPosition.CenterScreen;
            //frm.Show();
            frm.ShowDialog();
            if (frm.DialogResult == DialogResult.OK)
            {
                this.lsbPaleta.Items.Clear();
                this.p += frm.MiTempera;
                for (int i = 0; i < 5; i++)
                {
                    this.lsbPaleta.Items.Add((string)this.p[i]);
                }
            }
        }
コード例 #3
0
        private void btnModificar_Click(object sender, EventArgs e)
        {
            frmTempera frm;
            int        index;

            index = this.lsbPaleta.SelectedIndex;
            if (index != -1 && !Object.Equals(this.p[index], null))
            {
                frm = new frmTempera(p[index]);
                frm.StartPosition = FormStartPosition.CenterScreen;
                frm.ShowDialog();
                if (frm.DialogResult == DialogResult.OK)
                {
                    this.lsbPaleta.Items.Clear();
                    this.p[index] = frm.MiTempera;
                    for (int i = 0; i < 5; i++)
                    {
                        this.lsbPaleta.Items.Add((string)this.p[i]);
                    }
                }
            }
        }