hi
i wanna make a form on which there are 6 panels. on form load the first panel will show up, and if the user clicks on a button on taht panel the first panel will hide and the second will show up, and so on.
i thought to do this with splitter controls, because we can animate the transition between two panels. but i'm a bit confused to use splitters. they don't work like i expect. so i'm using the following code
my problem is that when the form loads it is empty. i can't see nothing.
please help me, it's driving me crazy.
i wanna make a form on which there are 6 panels. on form load the first panel will show up, and if the user clicks on a button on taht panel the first panel will hide and the second will show up, and so on.
i thought to do this with splitter controls, because we can animate the transition between two panels. but i'm a bit confused to use splitters. they don't work like i expect. so i'm using the following code
Code:
private void Prefs_Load(object sender, EventArgs e)
{
panel1.Show();
splitter1.SplitPosition = 400;
panel2.Hide();
splitter2.SplitPosition = 0;
panel3.Hide();
splitter3.SplitPosition = 0;
panel4.Hide();
splitter4.SplitPosition = 0;
panel5.Hide();
splitter5.SplitPosition = 0;
panel6.Hide();
}
private void button1_Click(object sender, EventArgs e)
{
splitter1.SplitPosition = 0;
splitter2.SplitPosition = 400;
panel1.Hide();
panel2.Show();
}
private void button4_Click(object sender, EventArgs e)
{
splitter2.SplitPosition = 0;
splitter3.SplitPosition = 400;
panel2.Hide();
panel3.Show();
}
private void button6_Click(object sender, EventArgs e)
{
splitter3.SplitPosition = 0;
splitter4.SplitPosition = 400;
panel3.Hide();
panel4.Show();
}
private void button8_Click(object sender, EventArgs e)
{
splitter4.SplitPosition = 0;
splitter5.SplitPosition = 400;
panel4.Hide();
panel5.Show();
}
private void button10_Click(object sender, EventArgs e)
{
splitter5.SplitPosition = 0;
//splitter6.SplitPosition = 400;
panel5.Hide();
panel6.Show();
}
private void button2_Click(object sender, EventArgs e)
{
}
private void button3_Click(object sender, EventArgs e)
{
splitter1.SplitPosition = 400;
splitter2.SplitPosition = 0;
panel2.Hide();
panel1.Show();
}
private void button5_Click(object sender, EventArgs e)
{
splitter2.SplitPosition = 400;
splitter3.SplitPosition = 0;
panel3.Hide();
panel2.Show();
}
private void button7_Click(object sender, EventArgs e)
{
splitter3.SplitPosition = 400;
splitter4.SplitPosition = 0;
panel4.Hide();
panel3.Show();
}
private void button9_Click(object sender, EventArgs e)
{
splitter4.SplitPosition = 400;
splitter5.SplitPosition = 0;
panel5.Hide();
panel4.Show();
}
private void button11_Click(object sender, EventArgs e)
{
splitter5.SplitPosition = 400;
//splitter6.SplitPosition = 0;
panel6.Hide();
panel5.Show();
}
my problem is that when the form loads it is empty. i can't see nothing.
please help me, it's driving me crazy.
Comment