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

System.Windows.Forms.Control maximum sizes

P: n/a
Hi,

Does anyone know how Windows allocates memory for controls? For example,
given a huge Panel, say, in a relatively much smaller Form with scrollbars,
will Windows attempt to allocate a huge area of memory for the Panel's
visible surface, or will it only allocate as much as is required (i.e. as
much as is visible)?

If the former, is there any way of preventing this? Like telling it that at
this point in time, only X amount of the panel will be necessary?

Thanks,

Steve
Jul 21 '05 #1
Share this Question
Share on Google+
6 Replies


P: n/a
Steve,

windows doesn't allocate memory for contorl surfaces. Amount of memory used
depends on the number of controls used on form, not of its size.

HTH
Alex

"Steve McLellan" <sjm.NOSPAM AT fixerlabs DOT com> wrote in message
news:ea**************@TK2MSFTNGP10.phx.gbl...
Hi,

Does anyone know how Windows allocates memory for controls? For example,
given a huge Panel, say, in a relatively much smaller Form with scrollbars, will Windows attempt to allocate a huge area of memory for the Panel's
visible surface, or will it only allocate as much as is required (i.e. as
much as is visible)?

If the former, is there any way of preventing this? Like telling it that at this point in time, only X amount of the panel will be necessary?

Thanks,

Steve

Jul 21 '05 #2

P: n/a
Steve,

windows doesn't allocate memory for contorl surfaces. Amount of memory used
depends on the number of controls used on form, not of its size.

HTH
Alex

"Steve McLellan" <sjm.NOSPAM AT fixerlabs DOT com> wrote in message
news:ea**************@TK2MSFTNGP10.phx.gbl...
Hi,

Does anyone know how Windows allocates memory for controls? For example,
given a huge Panel, say, in a relatively much smaller Form with scrollbars, will Windows attempt to allocate a huge area of memory for the Panel's
visible surface, or will it only allocate as much as is required (i.e. as
much as is visible)?

If the former, is there any way of preventing this? Like telling it that at this point in time, only X amount of the panel will be necessary?

Thanks,

Steve

Jul 21 '05 #3

P: n/a
Hi,

Thanks for the reply. To clarify then, I should be able to create a Panel
that's 100,000 X 100,000 pixels if I like, and as long as I don't try to put
an Image on top of it it should be fine? In that case, how does Windows
decide what to display for any parts of the control that are visible? And
assuming it buffers the visible surface, is it definitely the case that it
doesn't try to buffer the entire surface of the control?

Steve

"AlexS" <sa***********@SPAMsympaticoPLEASE.ca> wrote in message
news:e$**************@TK2MSFTNGP09.phx.gbl...
Steve,

windows doesn't allocate memory for contorl surfaces. Amount of memory used depends on the number of controls used on form, not of its size.

HTH
Alex

"Steve McLellan" <sjm.NOSPAM AT fixerlabs DOT com> wrote in message
news:ea**************@TK2MSFTNGP10.phx.gbl...
Hi,

Does anyone know how Windows allocates memory for controls? For example,
given a huge Panel, say, in a relatively much smaller Form with

scrollbars,
will Windows attempt to allocate a huge area of memory for the Panel's
visible surface, or will it only allocate as much as is required (i.e. as much as is visible)?

If the former, is there any way of preventing this? Like telling it that

at
this point in time, only X amount of the panel will be necessary?

Thanks,

Steve


Jul 21 '05 #4

P: n/a
Hi,

Thanks for the reply. To clarify then, I should be able to create a Panel
that's 100,000 X 100,000 pixels if I like, and as long as I don't try to put
an Image on top of it it should be fine? In that case, how does Windows
decide what to display for any parts of the control that are visible? And
assuming it buffers the visible surface, is it definitely the case that it
doesn't try to buffer the entire surface of the control?

Steve

"AlexS" <sa***********@SPAMsympaticoPLEASE.ca> wrote in message
news:e$**************@TK2MSFTNGP09.phx.gbl...
Steve,

windows doesn't allocate memory for contorl surfaces. Amount of memory used depends on the number of controls used on form, not of its size.

HTH
Alex

"Steve McLellan" <sjm.NOSPAM AT fixerlabs DOT com> wrote in message
news:ea**************@TK2MSFTNGP10.phx.gbl...
Hi,

Does anyone know how Windows allocates memory for controls? For example,
given a huge Panel, say, in a relatively much smaller Form with

scrollbars,
will Windows attempt to allocate a huge area of memory for the Panel's
visible surface, or will it only allocate as much as is required (i.e. as much as is visible)?

If the former, is there any way of preventing this? Like telling it that

at
this point in time, only X amount of the panel will be necessary?

Thanks,

Steve


Jul 21 '05 #5

P: n/a
Steve,
In addition to the other comments.

The visible surface of a control is painted (created) each time in the
controls Paint event. There is no memory allocated for the display of the
control per se.

For a complete discussion on Controls & Windows Forms and Paint events, see
Charles Petzold's book "Programming Microsoft Windows with Microsoft Visual
Basic .NET - Core Reference" from MS Press, a C# version of the book is also
available.

Hope this helps
Jay

"Steve McLellan" <sjm.NOSPAM AT fixerlabs DOT com> wrote in message
news:ea**************@TK2MSFTNGP10.phx.gbl...
Hi,

Does anyone know how Windows allocates memory for controls? For example,
given a huge Panel, say, in a relatively much smaller Form with scrollbars, will Windows attempt to allocate a huge area of memory for the Panel's
visible surface, or will it only allocate as much as is required (i.e. as
much as is visible)?

If the former, is there any way of preventing this? Like telling it that at this point in time, only X amount of the panel will be necessary?

Thanks,

Steve

Jul 21 '05 #6

P: n/a
Steve,
In addition to the other comments.

The visible surface of a control is painted (created) each time in the
controls Paint event. There is no memory allocated for the display of the
control per se.

For a complete discussion on Controls & Windows Forms and Paint events, see
Charles Petzold's book "Programming Microsoft Windows with Microsoft Visual
Basic .NET - Core Reference" from MS Press, a C# version of the book is also
available.

Hope this helps
Jay

"Steve McLellan" <sjm.NOSPAM AT fixerlabs DOT com> wrote in message
news:ea**************@TK2MSFTNGP10.phx.gbl...
Hi,

Does anyone know how Windows allocates memory for controls? For example,
given a huge Panel, say, in a relatively much smaller Form with scrollbars, will Windows attempt to allocate a huge area of memory for the Panel's
visible surface, or will it only allocate as much as is required (i.e. as
much as is visible)?

If the former, is there any way of preventing this? Like telling it that at this point in time, only X amount of the panel will be necessary?

Thanks,

Steve

Jul 21 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.