DESMAN2003
Programmer
Hi Everyone,
today is my first day learning c# and I am having trouble creating a simple function. What I have is a button called button1 on my form. What I want is that whenever the button is clicked, the background of the button will become red. In otherwords, the button itself will become red.
This is what I have so far, but i get an error. Could anyone please help? Thanks in advance!!
private void button1_Click(object sender, System.EventArgs e)
{
If (button1.Click)
{
button1.BackColor = Color.Red;
}
}
today is my first day learning c# and I am having trouble creating a simple function. What I have is a button called button1 on my form. What I want is that whenever the button is clicked, the background of the button will become red. In otherwords, the button itself will become red.
This is what I have so far, but i get an error. Could anyone please help? Thanks in advance!!
private void button1_Click(object sender, System.EventArgs e)
{
If (button1.Click)
{
button1.BackColor = Color.Red;
}
}