private void pictureBox_Click(object sender, EventArgs e) { if (state == AUSGELOEST) { this.pictureBox.Image = freiImage; state = AKTIVE; } else { state = AUSGELOEST; this.pictureBox.Image = ausgeloestImage; foreach (Control cc in Form1.instanceBedienpanel.Controls) { if (cc.HasChildren) { if (cc is Bedienelement) { Bedienelement z = (Bedienelement)cc; if (z.mitNotaus()) { z.notAus(true); } } } } } }
private void freigabe(Boolean b) { if (state == AKTIVE) { if (b) { this.setState(FREI); foreach (Control cc in Form1.instanceBedienpanel.Controls) { if (cc.HasChildren) { if (cc is Bedienelement) { Bedienelement z = (Bedienelement)cc; if (z.mitNotaus()) { z.notAus(false); } } } } } } }