I have a doubt in windows application
my doubt is
I have created a winform
for example
with two text boxes and two buttons
i have two different colours for two buttons
my question is if I click on a button, the colour of the button should be reflected on to the background
like if I click on blue button the background should become blue..
How to do this give me example with code???
Thank u
chaithu
Loading
Sunny ChenPosted Aug 5, 2008, 2:23 AM
1. Defines a common function like this:
private void OnButtonClick(object sender, System.EventArgs e)
{
if (sender is Button)
this.BackColor = (sender as Button).BackColor;
}
2. Binds the Click event to the above function on all buttons.
AlanPosted Aug 4, 2008, 4:45 AM
private void btnBlue_Click(object sender, EventArgs e)
{
this.BackColor = btnBlue.BackColor;
}