Hi
I created a simple code here just to play C# around. It has 3 buttons and 1 panel.
If you click on the 2nd & 3rd button the panel height changes.
Is that also possible to change the color?
For example :
If I click on the 2nd button, I would like to have it as yellow and at the same time the height changes as well.
and the same with 3rd button.
Thanks :-)
public partial class Form1 : Form
{
public int heightPanel;
public Form1()
{
InitializeComponent();
heightPanel = panel1.Height;
}
private void button1_Click(object sender, EventArgs e)
{
panel1.Height = heightPanel;
}
private void button2_Click(object sender, EventArgs e)
{
panel1.Height = this.Height/2;
}
private void button3_Click(object sender, EventArgs e)
{
panel1.Height = this.Height - 150;
}
}
I have an idea but I don't know where to put this
I think it would be something like this:
panel1.Height=this.BackColor.ToString();
Any inputs?
Thanks