splitContainer control
-
Is there a split container control that will allow the user the ability to resize the control during the applications runtime environment. And will allow for more than 2 split panels. As the SplitContainer control I can only see it allowing 2 containers. I need at least 3 or 4 containers to be resizable. Without having to next the containers inside each other.
-
Is there a split container control that will allow the user the ability to resize the control during the applications runtime environment. And will allow for more than 2 split panels. As the SplitContainer control I can only see it allowing 2 containers. I need at least 3 or 4 containers to be resizable. Without having to next the containers inside each other.
AFAIK nesting SplitContainers is the normal approach. The alternative could be a TableLayoutPanel, but then IMO you have to organize the resizing handles and everything yourself. :)
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages
-
AFAIK nesting SplitContainers is the normal approach. The alternative could be a TableLayoutPanel, but then IMO you have to organize the resizing handles and everything yourself. :)
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages
Thanks, That is what I figured :(... As that was the only way I could get it to work and drop the margins to maximize used space. Quick question though... On this control how to you fix 1 of the partitions sizes to a minimum size. Here is what I tried but it is not working.
if (scRPTFilter1.Panel2.Height != 275)
{
scRPTFilter1.Panel2.Height = 275;
}
if (scRPTFilter1.Panel2.Width != 557)
{
scRPTFilter1.Panel2.Width = 557;
}I was thinking I needed to say something like
if (scRPTFilter1.Panel2.Height != 275)
{
scRPTFilter1.Panel2.Height = new size(275, scrptfilter1.panel2.width);
}Just Not Sure since the height is separated here.
-
Thanks, That is what I figured :(... As that was the only way I could get it to work and drop the margins to maximize used space. Quick question though... On this control how to you fix 1 of the partitions sizes to a minimum size. Here is what I tried but it is not working.
if (scRPTFilter1.Panel2.Height != 275)
{
scRPTFilter1.Panel2.Height = 275;
}
if (scRPTFilter1.Panel2.Width != 557)
{
scRPTFilter1.Panel2.Width = 557;
}I was thinking I needed to say something like
if (scRPTFilter1.Panel2.Height != 275)
{
scRPTFilter1.Panel2.Height = new size(275, scrptfilter1.panel2.width);
}Just Not Sure since the height is separated here.
Hi, 1. Control.Height and Control.Width are existing properties, you can get and set them. Control.Size is also a property, you can get and set it, however setting it requires a new Size, it does not make sense to set either Control.Size.Height or Control.Size.Width, since that will change the H or W of the copied size, not the Control's actual Size. 2. I haven't done such things with SplitContainer (I used it only once), it probably works just fine. 3. If you want to enforce a minimum W or H, you should test for < and not for equality, otherwise you can't change it at all. :)
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages
-
Hi, 1. Control.Height and Control.Width are existing properties, you can get and set them. Control.Size is also a property, you can get and set it, however setting it requires a new Size, it does not make sense to set either Control.Size.Height or Control.Size.Width, since that will change the H or W of the copied size, not the Control's actual Size. 2. I haven't done such things with SplitContainer (I used it only once), it probably works just fine. 3. If you want to enforce a minimum W or H, you should test for < and not for equality, otherwise you can't change it at all. :)
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages
I just need to know how to enforce 1 panel's minimum size.
-
I just need to know how to enforce 1 panel's minimum size.
well, try
if (pan.Width<minWidth) pan.Width=minWidth;
and similar for height inside its Resize, SplitterMoving and/or SplitterMoved handler. And/or read up on those events. :)Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages
-
Is there a split container control that will allow the user the ability to resize the control during the applications runtime environment. And will allow for more than 2 split panels. As the SplitContainer control I can only see it allowing 2 containers. I need at least 3 or 4 containers to be resizable. Without having to next the containers inside each other.
Hi, A colleague and I came across this same problem and made a control derived from
TableLayoutPanel
, implementing theMouseDown
,MouseMove
andMouseUp
events. It works reasonably well, except for designer support - we have to add all the controls via code. DybsThe shout of progress is not "Eureka!" it's "Strange... that's not what i expected". - peterchen