473,699 Members | 2,768 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

using splitter control

2 New Member
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 1455
kenobewan
4,871 Recognized Expert Specialist
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
3020
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 remaining at the same spot. How can I maintain the size of the right-side listview when resizing the parent form? (Have the splitter move in relationship to the right-edge of the form.) I have to do this programmatically, no VS IDE to work with.
7
3308
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 correctly is: lhsTreeview - Dock = Fill, Anchor = Top,Left splitter - Dock = Right rhsPanel - Dock = Right, Anchor = Top,Left
0
1031
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. When ran it, I cannot see the items in listView until dragged the Splitter control to very top. If I used a RichTextBox to replace the listView and typed some text in the box, I could see the text when ran it.
3
2864
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 a four-way-splitter control? Regards, Andre Loker
3
6021
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
8100
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 Left, Panel on right of form w/ Dock set to Fill, Splitter between them set w/ Dock set to Left. Works as advertised. But... if I change to have two panels on the form one on the left with Dock set to Left, a panel on the right with Dock set to...
1
3463
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 individual control and still use a splitter?
2
3697
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 System.Windows.Forms.SplitterEventArgs) Handles Splitter1.SplitterMoved '// Saving new Splitter X-Location oSettings.SaveSetting(Application.ProductName, Me.Name, "SplitterLocationX", Splitter1.Location.X.ToString())
4
5982
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 the top of the splitter? I have various instances of similar scenarios and cut-and-try sometime I can get it to work and sometimes I can not. What is the correct way?
1
1719
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 there is some empty space on the form where I have a few button controls. When the app starts the form is 800x600, but I need to give the user the ability to maximize and to resize the form to whatever size they like. When the occurs I need the...
0
8615
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9033
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8882
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5872
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4375
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4627
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3057
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2345
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2009
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.