469,924 Members | 1,420 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,924 developers. It's quick & easy.

Splitter Container Resize

Hi All,

I have a horizontal Splitter, for which I would like the top panel to
remain 20 pixels in height. I do this because I have a containter on
it, and I overide the OnPaint method. It is being painted as a band
similar to that of Disk Defragmentor.

Any ideas on how to disable a Splitter panel from being resized? I've
locked the controls (it stops me from resizing it at design time);
I've set SplitterFixedPanel = Panel1 [1,5]; and I've set
SplitterDistance to the same as design time [2]. Overriding Moving
events causes a runtime error when I try to force the control's height
back to the desired height through the Height property [3, 4]. From
[5,6]: "Use the Panel1 [or Panel2] property to configure the left
panel of a vertical SplitContainer or the top panel of a horizontal
SplitContainer. For example, you can specify the minimum size of the
panel by changing the value of the Panel1MinSize property, set the
FixedPanel property to Panel1 so that the panel remains the same size
when the container is resized, or you can get or set the panel's
BackgroundImage and BackgroundImageLayout properties."

Nothing stops this damn thing from moving. Any help would be
appreciated.

Thanks,
Jeff
[1] http://msdn2.microsoft.com/en-us/lib...el(vs.80).aspx
[2] http://msdn2.microsoft.com/en-us/lib...ce(VS.80).aspx
[3] http://msdn2.microsoft.com/en-us/lib...ng(VS.80).aspx
[4] http://msdn2.microsoft.com/en-us/lib...ed(VS.80).aspx
[5] http://msdn2.microsoft.com/en-us/lib...l1(VS.80).aspx
[6] http://msdn2.microsoft.com/en-us/lib...l2(VS.80).aspx
Nov 21 '07 #1
3 3901
You should look at SplitContainer which offers Panel1MinSize and
Panel2MinSize. This would do what you are looking for, in my opinion.
"Jeffrey Walton" wrote:
Hi All,

I have a horizontal Splitter, for which I would like the top panel to
remain 20 pixels in height. I do this because I have a containter on
it, and I overide the OnPaint method. It is being painted as a band
similar to that of Disk Defragmentor.

Any ideas on how to disable a Splitter panel from being resized? I've
locked the controls (it stops me from resizing it at design time);
I've set SplitterFixedPanel = Panel1 [1,5]; and I've set
SplitterDistance to the same as design time [2]. Overriding Moving
events causes a runtime error when I try to force the control's height
back to the desired height through the Height property [3, 4]. From
[5,6]: "Use the Panel1 [or Panel2] property to configure the left
panel of a vertical SplitContainer or the top panel of a horizontal
SplitContainer. For example, you can specify the minimum size of the
panel by changing the value of the Panel1MinSize property, set the
FixedPanel property to Panel1 so that the panel remains the same size
when the container is resized, or you can get or set the panel's
BackgroundImage and BackgroundImageLayout properties."

Nothing stops this damn thing from moving. Any help would be
appreciated.

Thanks,
Jeff
[1] http://msdn2.microsoft.com/en-us/lib...el(vs.80).aspx
[2] http://msdn2.microsoft.com/en-us/lib...ce(VS.80).aspx
[3] http://msdn2.microsoft.com/en-us/lib...ng(VS.80).aspx
[4] http://msdn2.microsoft.com/en-us/lib...ed(VS.80).aspx
[5] http://msdn2.microsoft.com/en-us/lib...l1(VS.80).aspx
[6] http://msdn2.microsoft.com/en-us/lib...l2(VS.80).aspx
Nov 21 '07 #2
Hi Mike,

Thanks. I tried that also. I suppose this is another bug. I'm amazed
that so many of these exist. How did the Framework (2.0) get through
QA??? I've had problems with ListView/SelectedNode after ExpandAll,
setting the application icon, this issue, and three more - and this is
one project. It never ends. I guess this is why when visiting MSDN's
pages, their sample code receives a single star rating.

Jeff

On Nov 21, 10:24 am, Family Tree Mike
<FamilyTreeM...@discussions.microsoft.comwrote:
You should look at SplitContainer which offers Panel1MinSize and
Panel2MinSize. This would do what you are looking for, in my opinion.

"Jeffrey Walton" wrote:
Hi All,
I have a horizontal Splitter, for which I would like the top panel to
remain 20 pixels in height. I do this because I have a containter on
it, and I overide the OnPaint method. It is being painted as a band
similar to that of Disk Defragmentor.
Any ideas on how to disable a Splitter panel from being resized? I've
locked the controls (it stops me from resizing it at design time);
I've set SplitterFixedPanel = Panel1 [1,5]; and I've set
SplitterDistance to the same as design time [2]. Overriding Moving
events causes a runtime error when I try to force the control's height
back to the desired height through the Height property [3, 4]. From
[5,6]: "Use the Panel1 [or Panel2] property to configure the left
panel of a vertical SplitContainer or the top panel of a horizontal
SplitContainer. For example, you can specify the minimum size of the
panel by changing the value of the Panel1MinSize property, set the
FixedPanel property to Panel1 so that the panel remains the same size
when the container is resized, or you can get or set the panel's
BackgroundImage and BackgroundImageLayout properties."
Nothing stops this damn thing from moving. Any help would be
appreciated.
Thanks,
Jeff
[1]http://msdn2.microsoft.com/en-us/library/system.windows.forms.splitco...
[2]http://msdn2.microsoft.com/en-us/library/system.windows.forms.splitco...
[3]http://msdn2.microsoft.com/en-us/library/system.windows.forms.splitco...
[4]http://msdn2.microsoft.com/en-us/library/system.windows.forms.splitco...
[5]http://msdn2.microsoft.com/en-us/library/system.windows.forms.splitco...
[6]http://msdn2.microsoft.com/en-us/library/system.windows.forms.splitco...- Hide quoted text -

- Show quoted text -
Nov 21 '07 #3
I'm sorry you are having trouble with this. I just tried it here, where all
I have is VS 2008 express. It works as advertised for me in this environment.

"Jeffrey Walton" wrote:
Hi Mike,

Thanks. I tried that also. I suppose this is another bug. I'm amazed
that so many of these exist. How did the Framework (2.0) get through
QA??? I've had problems with ListView/SelectedNode after ExpandAll,
setting the application icon, this issue, and three more - and this is
one project. It never ends. I guess this is why when visiting MSDN's
pages, their sample code receives a single star rating.

Jeff

On Nov 21, 10:24 am, Family Tree Mike
<FamilyTreeM...@discussions.microsoft.comwrote:
You should look at SplitContainer which offers Panel1MinSize and
Panel2MinSize. This would do what you are looking for, in my opinion.

"Jeffrey Walton" wrote:
Hi All,
I have a horizontal Splitter, for which I would like the top panel to
remain 20 pixels in height. I do this because I have a containter on
it, and I overide the OnPaint method. It is being painted as a band
similar to that of Disk Defragmentor.
Any ideas on how to disable a Splitter panel from being resized? I've
locked the controls (it stops me from resizing it at design time);
I've set SplitterFixedPanel = Panel1 [1,5]; and I've set
SplitterDistance to the same as design time [2]. Overriding Moving
events causes a runtime error when I try to force the control's height
back to the desired height through the Height property [3, 4]. From
[5,6]: "Use the Panel1 [or Panel2] property to configure the left
panel of a vertical SplitContainer or the top panel of a horizontal
SplitContainer. For example, you can specify the minimum size of the
panel by changing the value of the Panel1MinSize property, set the
FixedPanel property to Panel1 so that the panel remains the same size
when the container is resized, or you can get or set the panel's
BackgroundImage and BackgroundImageLayout properties."
Nothing stops this damn thing from moving. Any help would be
appreciated.
Thanks,
Jeff
[1]http://msdn2.microsoft.com/en-us/library/system.windows.forms.splitco...
[2]http://msdn2.microsoft.com/en-us/library/system.windows.forms.splitco...
[3]http://msdn2.microsoft.com/en-us/library/system.windows.forms.splitco...
[4]http://msdn2.microsoft.com/en-us/library/system.windows.forms.splitco...
[5]http://msdn2.microsoft.com/en-us/library/system.windows.forms.splitco...
[6]http://msdn2.microsoft.com/en-us/library/system.windows.forms.splitco...- Hide quoted text -
- Show quoted text -

Nov 21 '07 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Bob (remove 'excise-' to reply) | last post: by
7 posts views Thread by John | last post: by
1 post views Thread by Gustaf Liljegren | last post: by
5 posts views Thread by Sam | last post: by
5 posts views Thread by dotnetchic | last post: by
5 posts views Thread by mbh1 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.