472,958 Members | 1,752 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

using splitter control


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.         }
  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.         }
  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.         }
  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.         }
  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.         }
  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.         }
  56.         private void button2_Click(object sender, EventArgs e)
  57.         {
  59.         }
  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.         }
  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.         }
  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.         }
  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.         }
  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 1414
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

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...
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...
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. ...
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...
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
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...
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...
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...
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...
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...
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...

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.