473,396 Members | 1,777 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 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 1430
kenobewan
4,871 Expert 4TB
Comment out all the splitter references and report what happens.
Mar 2 '08 #2

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

Similar topics

1
by: Bob (remove 'excise-' to reply) | last post by:
I've got a form with three controls: a left-docked richtextbox, a right-docked form, and a right-docked listview. When I resize the form, the listview increases and decreases, the splitter...
7
by: John | last post by:
Hi, I have a group of controls in a panel on the right-hand side of a splitter and a treeview on the left-hand side. The only configuration that I can find to make the right-hand side resize...
0
by: keith | last post by:
I have a form and added a RichTextBox and set Dock to TOP, added a Splitter and set Dock to TOP, and finally added a listView set Dock Fill. Then added several items to the listView control. ...
3
by: Andre Loker | last post by:
Hi! For my current application I'm looking for a four-way-(cross) splitter control (as often seen in 3D-editors). The .NET Splitter-class is (IIRC) only a two-way splitter. Does anyone know such...
3
by: MFRASER | last post by:
How do I move the splitter inside of code. if(TypeA) { this.pnlHXMLList.Visible = false; this.splTop.is.Top = 65; } else
4
by: BBM | last post by:
I'm trying to set up a form with two panels divided by a Splitter control. I can make the Splitter work in the situations described in the documentation (Listbox or TreeView on left w/Dock set to...
1
by: Chuck Bowling | last post by:
I have a couple of controls that I'd like to use a vertical splitter control with. My problem is that I want different heights for the controls. Is there any way to set the height of each...
2
by: Mika M | last post by:
Hello! My windows form has Splitter control on it, and I save splitter's last X-location when user changes it like ... Private Sub Splitter1_SplitterMoved(ByVal sender As Object, ByVal e As...
4
by: Frank | last post by:
On a form I have a control that is docked top. Under it a splitterbar that is also docked top. If I want to programmatically move the splitter how do I do that: Set the height of the control or...
1
by: JDeats | last post by:
I have a WinForm with three Splitter controls on it. The form divides up in this order: Tab Control (docked to the left): Splitter1: RichTextBox (docked to the left): Splitter2 After Splliter2...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.