471,120 Members | 1,497 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,120 software developers and data experts.

using splitter control

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

Expand|Select|Wrap|Line Numbers
  1. private void Prefs_Load(object sender, EventArgs e)
  2.         {
  3.             panel1.Show();
  4.             splitter1.SplitPosition = 400;
  5.             panel2.Hide();
  6.             splitter2.SplitPosition = 0;
  7.             panel3.Hide();
  8.             splitter3.SplitPosition = 0;
  9.             panel4.Hide();
  10.             splitter4.SplitPosition = 0;
  11.             panel5.Hide();
  12.             splitter5.SplitPosition = 0;
  13.             panel6.Hide();
  14.         }
  15.  
  16. private void button1_Click(object sender, EventArgs e)
  17.         {
  18.             splitter1.SplitPosition = 0;
  19.             splitter2.SplitPosition = 400;
  20.             panel1.Hide();
  21.             panel2.Show();
  22.         }
  23.  
  24.         private void button4_Click(object sender, EventArgs e)
  25.         {
  26.             splitter2.SplitPosition = 0;
  27.             splitter3.SplitPosition = 400;
  28.             panel2.Hide();
  29.             panel3.Show();
  30.         }
  31.  
  32.         private void button6_Click(object sender, EventArgs e)
  33.         {
  34.             splitter3.SplitPosition = 0;
  35.             splitter4.SplitPosition = 400;
  36.             panel3.Hide();
  37.             panel4.Show();
  38.         }
  39.  
  40.         private void button8_Click(object sender, EventArgs e)
  41.         {
  42.             splitter4.SplitPosition = 0;
  43.             splitter5.SplitPosition = 400;
  44.             panel4.Hide();
  45.             panel5.Show();
  46.         }
  47.  
  48.         private void button10_Click(object sender, EventArgs e)
  49.         {
  50.             splitter5.SplitPosition = 0;
  51.             //splitter6.SplitPosition = 400;
  52.             panel5.Hide();
  53.             panel6.Show();
  54.         }
  55.  
  56.         private void button2_Click(object sender, EventArgs e)
  57.         {
  58.  
  59.         }
  60.  
  61.         private void button3_Click(object sender, EventArgs e)
  62.         {
  63.             splitter1.SplitPosition = 400;
  64.             splitter2.SplitPosition = 0;
  65.             panel2.Hide();
  66.             panel1.Show();
  67.         }
  68.  
  69.         private void button5_Click(object sender, EventArgs e)
  70.         {
  71.             splitter2.SplitPosition = 400;
  72.             splitter3.SplitPosition = 0;
  73.             panel3.Hide();
  74.             panel2.Show();
  75.         }
  76.  
  77.         private void button7_Click(object sender, EventArgs e)
  78.         {
  79.             splitter3.SplitPosition = 400;
  80.             splitter4.SplitPosition = 0;
  81.             panel4.Hide();
  82.             panel3.Show();
  83.         }
  84.  
  85.         private void button9_Click(object sender, EventArgs e)
  86.         {
  87.             splitter4.SplitPosition = 400;
  88.             splitter5.SplitPosition = 0;
  89.             panel5.Hide();
  90.             panel4.Show();
  91.         }
  92.  
  93.         private void button11_Click(object sender, EventArgs e)
  94.         {
  95.             splitter5.SplitPosition = 400;
  96.             //splitter6.SplitPosition = 0;
  97.             panel6.Hide();
  98.             panel5.Show();
  99.         }

my problem is that when the form loads it is empty. i can't see nothing.

please help me, it's driving me crazy.
Mar 1 '08 #1
1 1326
kenobewan
4,871 Expert 4TB
Comment out all the splitter references and report what happens.
Mar 2 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

1 post views Thread by Bob (remove 'excise-' to reply) | last post: by
7 posts views Thread by John | last post: by
3 posts views Thread by Andre Loker | last post: by
3 posts views Thread by MFRASER | last post: by
1 post views Thread by Chuck Bowling | last post: by
2 posts views Thread by Mika M | last post: by
4 posts views Thread by Frank | last post: by
1 post views Thread by JDeats | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.