What is AutoScrollMinSize

  • Thread starter Thread starter Just Me
  • Start date Start date
J

Just Me

I've read the help docs but can't figure what AutoScrollMinSize does.

Probably very simple so they felt no need to explain but it is not evident
to me.

Can someone give a few words about it and an example of when it would be
useful?

Thanks
 
Just Me said:
I've read the help docs but can't figure what AutoScrollMinSize does.

Probably very simple so they felt no need to explain but it is not evident
to me.

The 'AutoScrollMinSize' property contains the minimum size of the area that
can be scrolled if scrollbars are shown. Does this make it more clear?
 
I saw something that suggests : If the window becomes smaller then the
AutoScrollMinSize the scroll bars appear. Is that true?

What happens if I do not set it?

Seems I should normally set it to ClientSize?


Thanks
 
Just Me,
Seems I should normally set it to ClientSize?
At design time yes, at run time no. If you are designing a form that is
larger then your "target" screen, then I normally set AutoScrollMinSize to
the size of my "target" screen. For example if I laid out my controls in a
640 x 960 grid (client area), I could set AutoScrollMinSize to 640 x 480 and
be able to scroll the controls up & down on the page to see both "halves".

Think about it in terms of how Page Preview shows a page. AutoScrollMinSize
would be set to the actual size of the Page itself, if the client area is
larger then the Page, then there is no need for Scroll Bars as the entire
Page can be seen. If the client area is smaller then the page itself, then
you do need Scroll Bars, as you need to what part of the page you are
looking at.

Bob Powell (GDI+ guru) has a nice writeup on Understanding Auto-Scroll,
including AutoScrollMinSize:

http://www.bobpowell.net/understanding_autoscroll.htm

Hope this helps
Jay

Just Me said:
I saw something that suggests : If the window becomes smaller then the
AutoScrollMinSize the scroll bars appear. Is that true?

What happens if I do not set it?

Seems I should normally set it to ClientSize?


Thanks
 
What do I get if I don't set it to anything?

Thanks

Jay B. Harlow said:
Just Me,
Seems I should normally set it to ClientSize?
At design time yes, at run time no. If you are designing a form that is
larger then your "target" screen, then I normally set AutoScrollMinSize to
the size of my "target" screen. For example if I laid out my controls in a
640 x 960 grid (client area), I could set AutoScrollMinSize to 640 x 480
and be able to scroll the controls up & down on the page to see both
"halves".

Think about it in terms of how Page Preview shows a page.
AutoScrollMinSize would be set to the actual size of the Page itself, if
the client area is larger then the Page, then there is no need for Scroll
Bars as the entire Page can be seen. If the client area is smaller then
the page itself, then you do need Scroll Bars, as you need to what part of
the page you are looking at.

Bob Powell (GDI+ guru) has a nice writeup on Understanding Auto-Scroll,
including AutoScrollMinSize:

http://www.bobpowell.net/understanding_autoscroll.htm

Hope this helps
Jay
 
Doh!
I said that backwards:
640 x 960 grid (client area), I could set AutoScrollMinSize to 640 x 480
and be able to scroll the controls up & down on the page to see both
"halves".
I could set the ClientSize to 640 x 480 & the AutoScrollMinSize to 640 x 960
and be able to scroll up & down on the page to see both halves!

Hope this helps
Jay


Jay B. Harlow said:
Just Me,
Seems I should normally set it to ClientSize?
At design time yes, at run time no. If you are designing a form that is
larger then your "target" screen, then I normally set AutoScrollMinSize to
the size of my "target" screen. For example if I laid out my controls in a
640 x 960 grid (client area), I could set AutoScrollMinSize to 640 x 480
and be able to scroll the controls up & down on the page to see both
"halves".

Think about it in terms of how Page Preview shows a page.
AutoScrollMinSize would be set to the actual size of the Page itself, if
the client area is larger then the Page, then there is no need for Scroll
Bars as the entire Page can be seen. If the client area is smaller then
the page itself, then you do need Scroll Bars, as you need to what part of
the page you are looking at.

Bob Powell (GDI+ guru) has a nice writeup on Understanding Auto-Scroll,
including AutoScrollMinSize:

http://www.bobpowell.net/understanding_autoscroll.htm

Hope this helps
Jay
 
Just Me,
You get nothing, as in no AutoScrolling, unless you set AutoScroll = True!

If you set AutoScroll = True & leave AutoScrollMinSize at (0,0) as far as I
can tell it picks bounding rectangle of all your controls on the form, which
is what I would normally set it to...

Of course this is something that is easy enough to try.

Create a form, place a bunch of controls on the form. Set FormBorderStyle to
Sizable, set AutoScroll to True, run the form, resize the form to a rather
small size. You should get scroll bars.

With the same form set AutoScroll to False, run the form, resize the form to
a rather small size. You should not get scroll bars.

Hope this helps
Jay
 
Good site.
I didn't see a description of what happens if I set it to 0,0 or do not set
it at all.
It appears that what happens is that it effectively includes all the
controls on the form.

Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top