Ahoj, nevíte jak říct 117 pictureboxům, aby měli černé pozadí? (ne tím stylem na 117 řádků :D )
Ještě tu mám jeden problém. Potřeboval bych při nové hodnotě aktualizovat stav "do černa", davám kód:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace Buse
{
public partial class UserControl1 : UserControl
{
public string _znak = "";
public UserControl1()
{
InitializeComponent();
}
[Category("Behavior")]
[Description("Nastaví, jaký znak se má zobrazit")]
[DisplayName("Znak")]
public string Alert
{
get
{
return _znak;
}
set
{
_znak = value;
vypis_znak();
}
}
public void vypis_znak()
{
switch (_znak)
{
case "1":
pictureBox6.BackColor = Color.White;
pictureBox14.BackColor = Color.White;
pictureBox13.BackColor = Color.White;
pictureBox22.BackColor = Color.White;
pictureBox23.BackColor = Color.White;
pictureBox24.BackColor = Color.White;
pictureBox34.BackColor = Color.White;
pictureBox31.BackColor = Color.White;
pictureBox32.BackColor = Color.White;
pictureBox33.BackColor = Color.White;
pictureBox44.BackColor = Color.White;
pictureBox43.BackColor = Color.White;
pictureBox41.BackColor = Color.White;
pictureBox40.BackColor = Color.White;
pictureBox54.BackColor = Color.White;
pictureBox53.BackColor = Color.White;
pictureBox50.BackColor = Color.White;
pictureBox49.BackColor = Color.White;
pictureBox63.BackColor = Color.White;
pictureBox59.BackColor = Color.White;
pictureBox58.BackColor = Color.White;
pictureBox68.BackColor = Color.White;
pictureBox67.BackColor = Color.White;
pictureBox77.BackColor = Color.White;
pictureBox76.BackColor = Color.White;
pictureBox86.BackColor = Color.White;
pictureBox85.BackColor = Color.White;
pictureBox94.BackColor = Color.White;
pictureBox95.BackColor = Color.White;
pictureBox104.BackColor = Color.White;
pictureBox103.BackColor = Color.White;
pictureBox113.BackColor = Color.White;
pictureBox112.BackColor = Color.White;
break;
Dál to pokračuje (a to dost), ale to není podstatné.