By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,846 Members | 1,646 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,846 IT Pros & Developers. It's quick & easy.

Form AutoScroll Problem

P: n/a
Hi,

I have a form which contain 2 panels, Master and Detail, Master panel is on
top and Detail panel is at the bottom. In the form, I set Detail panel to
Dock to the bottom and Master panel Dock to fill. As a result, when I do
form resize, Detail's height always retain whereas Master height change base
on form size.

What I want to do now is I want to set a minimum size for the form, so that
if the form got resize small than certain value, the Scroll Bar will visible.
So I set form AutoScroll = True and form AutoScrollMinSize = 400,300 (which
is my form size). Then I have a problem that Master panel suddenly grow to
size 400,300 and I cannot set Master panel size lower than 400,300...and the
Scroll Bar always on.

Sorry if I didn't explain my problem very clear, I should have attach a
simple program to demostrate but I don't see such option open.

To put it simple, I want to put 2 panels to fill up the form, top panel will
resize base on form resize, whereas bottom panel size always retain. And the
form should have scroll bar visible when smaller than minimum size.

Thanks for help in advance.
Nov 21 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
You should be dynamically resizing the controls based on the form size.
Override the form's OnSizeChanged method and layout your child controls to
the formula you like. Use AutoScrollMinSize correctly on the lower panel and
you should be ok.

--
Bob Powell [MVP]
Visual C#, System.Drawing

Ramuseco Limited .NET consulting
http://www.ramuseco.com

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.

"Kent" <Ke**@discussions.microsoft.com> wrote in message
news:51**********************************@microsof t.com...
Hi,

I have a form which contain 2 panels, Master and Detail, Master panel is
on
top and Detail panel is at the bottom. In the form, I set Detail panel to
Dock to the bottom and Master panel Dock to fill. As a result, when I do
form resize, Detail's height always retain whereas Master height change
base
on form size.

What I want to do now is I want to set a minimum size for the form, so
that
if the form got resize small than certain value, the Scroll Bar will
visible.
So I set form AutoScroll = True and form AutoScrollMinSize = 400,300
(which
is my form size). Then I have a problem that Master panel suddenly grow
to
size 400,300 and I cannot set Master panel size lower than 400,300...and
the
Scroll Bar always on.

Sorry if I didn't explain my problem very clear, I should have attach a
simple program to demostrate but I don't see such option open.

To put it simple, I want to put 2 panels to fill up the form, top panel
will
resize base on form resize, whereas bottom panel size always retain. And
the
form should have scroll bar visible when smaller than minimum size.

Thanks for help in advance.

Nov 21 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.