ilhami caliskan

ilhami caliskan

  • NA
  • 76
  • 91.7k

c#

Jul 19 2014 6:23 PM
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 

Answers (2)