Click here to Skip to main content
16,012,316 members

Comments by leandro2 (Top 2 by date)

leandro2 23-Jun-15 9:19am View    
Hi guys, this is the solution i came up with at the moment...

private int _selectedOption;

public int SelectOption
{
get
{
return _selectedOption;
}
set
{
_selectedOption = value;
}
}
private void toolStripComboBox1_Click(object sender, EventArgs e)
{
if (toolStripComboBox1.Text == "Red")
{
SelectOption = toolStripComboBox1.SelectedIndex;
this.BackColor = System.Drawing.Color.Red;
}
else if (toolStripComboBox1.Text == "Blue")
{
this.BackColor = System.Drawing.Color.Blue;
}
else if (toolStripComboBox1.Text == "Green")
{
this.BackColor = System.Drawing.Color.Green;
}
else if (toolStripComboBox1.Text == "Magenta")
{
this.BackColor = System.Drawing.Color.Magenta;
}
else
{
toolStripComboBox1.Text = "Default";
this.BackColor = System.Drawing.Color.WhiteSmoke;
}
}

But when I try to change the color of the form by using the value "Red" for example from the comboBox, none of the selected values in the comboBox is working, the form is not changing to any of the colors... Any solutions please.
leandro2 23-Jun-15 8:44am View    
Sorry guy I only started coding the solution now, as soon as I am done i will deploy it here..