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]); } } }
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]); } } }
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]); } } } }