Hi All,
is there a better way to do this?
private void handleA100ModelUpdate()
{
if (_a100SafetyModel.A100SafetyStatus[0] == true)
{
this.customTxtBox1.IoList[0].BackColor = Color.FromA#c0ffc0;
}
else
this.customTxtBox1.IoList[0].BackColor = Color.White;
if (_a100SafetyModel.A100SafetyStatus[1] == true)
{
this.customTxtBox1.IoList[1].BackColor = Color.FromA#c0ffc0;
}
else
this.customTxtBox1.IoList[1].BackColor = Color.White;
if (_a100SafetyModel.A100SafetyStatus[2] == true)
{
this.customTxtBox1.IoList[2].BackColor = Color.FromA#c0ffc0;
}
else
this.customTxtBox1.IoList[2].BackColor = Color.White;
if (_a100SafetyModel.A100SafetyStatus[3] == true)
{
this.customTxtBox1.IoList[3].BackColor = Color.FromA#c0ffc0;
}
else
this.customTxtBox1.IoList[3].BackColor = Color.White;
if (_a100SafetyModel.A100SafetyStatus[4] == true)
{
this.customTxtBox1.IoList[4].BackColor = Color.FromA#c0ffc0;
}
else
this.customTxtBox1.IoList[4].BackColor = Color.White;
if (_a100SafetyModel.A100SafetyStatus[5] == true)
{
this.customTxtBox1.IoList[5].BackColor = Color.FromA#c0ffc0;
}
else
this.customTxtBox1.IoList[5].BackColor = Color.White;
if (_a100SafetyModel.A100SafetyStatus[6] == true)
{
this.customTxtBox1.IoList[6].BackColor = Color.FromA#c0ffc0;
}
else
this.customTxtBox1.IoList[6].BackColor = Color.White;
if (_a100SafetyModel.A100SafetyStatus[7] == true)
{
this.customTxtBox1.IoList[7].BackColor = Color.FromA#c0ffc0;
}
else
this.customTxtBox1.IoList[7].BackColor = Color.White;
}
thanx a lot

VulpesPosted Jul 19, 2014, 7:06 PM
I'm guessing what Color.FromA#c0ffc0 should mean but, whatever it is, it's the same for them all.
ilhami caliskanPosted Jul 19, 2014, 7:12 PM
so easy...