Questions tagged [splitcontainer]

Split Container is a object that allows the user to split a page/form in multiple sections with each section being resizable.

A split container in a WinForms application will allow for a vertical or horizontal split of the form. This split can be 50%/50% or any other percentage. The benefit is that the container can then be resized by dragging the 'bar' inbetween the panels so that one set of controls/information can be better viewed. The split container panels can also be completely collapsed so that a section of the form is hidden.

When resizing each panel gains space at the expense of another panel -> for example increasing panel1 to 75% of the screen space will mean that panel2 has the remaining 25%.

MSDN defines a split container as:

The Windows Forms SplitContainer control can be thought of as a composite; it is two panels separated by a movable bar. When the mouse pointer is over the bar, the pointer changes shape to show that the bar is movable.

122 questions
5
votes
4 answers

Split Container SplitterDistance changes without user intervention

My Winforms app saves and restores its GUI state in the database. Everything's working ok, except for a Split Container's SplitterDistance. The value is correctly loaded and set from DB, but when I exit the app without touching the splitter, I…
dario_ramos
  • 7,118
  • 9
  • 61
  • 108
5
votes
1 answer

Splitcontainer flowlayoutpanel or autosized panel (VB.NET)

Forms in an application I'm working on with a team have a datagridview as main component (it should take up most of the size), but there are other components. there is a horizontal splitcontainer to split them, but I was wondering how to make the…
MarioDS
  • 12,895
  • 15
  • 65
  • 121
4
votes
1 answer

SplitterDistance changes as size of control changes

I have a SplitContainer control on my form. It's docked to the form. And I set the SplitterDistance from code when the form loads. This works fine except that the SplitterDistance changes when I resize the form. For example, when I make the form…
Jonathan Wood
  • 65,341
  • 71
  • 269
  • 466
4
votes
1 answer

Splitcontainer, Make a fixed panel

I have a splitcontainer with horizontal orientation. I want a fixed height for panel2 only during form resize, and let splitter resize panel2 Now I'm doing it this way, but I'm not satisfy because user notice that the panel resize Private Sub…
Marcx
  • 6,806
  • 5
  • 46
  • 69
3
votes
0 answers

SplitContainer splitter movement is not visible on WebView control

I have datagridview and webview2 in splitcontainer.(orientation=horizontal, dock=fill) After placing the textbox instead of webview2, if I grab the splitter with the mouse and move it, the splitter's movement is visible. But when I place the…
haren
  • 33
  • 3
3
votes
2 answers

Handle event in splitter area of splitcontainer control

Is there any trivial way to handle click event on the splitter area of the WinFroms splitcontainer control? (symbolized by blue in my picture) E.g. I'd like to collapse panel1 by double clicking this area. Or another possibility to put some nice…
Tom
  • 3,899
  • 22
  • 78
  • 137
3
votes
1 answer

Adjust form width to Match SplitContainer Size

I have a SplitContainer within a Form with the Dock property set to Fill .SplitPanel1 contains a picturebox,so when the picturebox size reduces,the right side of the form has blank space. How can i trim the form size so that it matches its…
techno
  • 6,100
  • 16
  • 86
  • 192
3
votes
2 answers

Winforms control combining best of both the SplitContainer and TableLayoutPanel

With a SplitContainer, the user can resize the two sides of the control. But it's only limited to two sections. With a TableLayoutPanel you have unlimited rows and columns. Unfortunately, the user can't drag any of these sections around. How can I…
Dan W
  • 3,520
  • 7
  • 42
  • 69
3
votes
2 answers

With the .NET "WinForms" SplitContainer control, how can I hide a panel dynamically?

Calling MyPanel.Panel1.Hide(); or MyPanel.Panel2.Hide(); simply hides the controls inside the panel... but I want to have the other side of the panel fill up the whole space. So, if I hide Panel1, I want Panel2 to take up the whole space, and I want…
Timothy Khouri
  • 31,315
  • 21
  • 88
  • 128
3
votes
6 answers

Multiline Textbox Resizing in C#

I have two multiline textboxes separated within a splitContainer. When I drag the splitter left or right I would like the textboxes to resize accordingly. How do I do this? I am using Microsoft Visual C# 2008 Express Edition. Thanks.
Jim Fell
  • 13,750
  • 36
  • 127
  • 202
3
votes
3 answers

Is it possible to avoid Focus on SplitContainer?

The WinForm SplitContainer gets the focus when it's dragged or clicked, while the Splitter does not. The side-effect of this, is that dragging a SplitContainer bar fires Leave/Validate on other controls, and I need to avoid this. I already tried…
Filini
  • 2,109
  • 2
  • 22
  • 32
3
votes
1 answer

Remove SplitContainer panel padding in WinForms

Is there a way to remove to padding from the Panel within a SplitContainer? So far I tried setting or overwriting the Padding Property with no effort. I don't necessarily want to end up custom drawing everything either. Screenshot…
bytecode77
  • 14,163
  • 30
  • 110
  • 141
2
votes
1 answer

c# Using TreeView control in SplitContainer to change the content

I have a TreeView in the left side of a SplitContainer and I would like the content on the right side to change when I click on a TreeNode. What I'm trying to do is a settings "window" such as the one in Putty, i.e. te content in the right side can…
scibuff
  • 13,377
  • 2
  • 27
  • 30
2
votes
1 answer

How does one use a WPF/SL Grid and GridSplitter as a bindable SplitContainer?

Suppose you want to allow a user to re-size a WPF/SL Grid containing two columns. But you also want to allow the user to hide one column (a "panel") or the other column. When both columns (panels) are shown, the GridSplitter should be also be…
CalvinDale
  • 9,005
  • 5
  • 29
  • 38
2
votes
4 answers

WinForms : how to add toolStrip to a form already divided into left/right panes using a SplitContainer control

My form is divided up into left and right panes, and the right pane is split into upper and lower panes: AAAABBBB AAAACCCC There's a menu-strip at the top, below the title-bar and a status bar at the bottom: menuStrip …
Tim
  • 5,371
  • 3
  • 32
  • 41
1
2
3
8 9