473,320 Members | 1,857 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

System.Windows.Forms.Control maximum sizes

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
6 1829
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
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
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Penn Markham | last post by:
Hello all, I am writing a script where I need to use the system() function to call htpasswd. I can do this just fine on the command line...works great (see attached file, test.php). When my...
5
by: Olli Krollmann | last post by:
hello folks, we have been developing several .NET-based windows forms applications during the last two years. there are two mysterious display problems that we have encountered so far but have...
10
by: Niall | last post by:
I'm not quite sure which groups to post this to, so short of a massive crosspost, I decided on these two. I am running into troubles with resource usage of our app on Win2k and above systems. In...
1
by: lwickland | last post by:
Summary: System.Net.ScatterGatherBuffers.MemoryChuck allocates inordinately large bytes when sending large post data. The following application consumes inordinate quantities of memory. My code...
2
by: Graeme Neath | last post by:
I'm having a very bizarre problem. I have a vb.net application which uses the ESRI MapObjects 2.2 component (unmanaged code). When I use the MapObjects built-in function 'CopyMap' to copy the map...
3
by: Steve McLellan | last post by:
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...
3
by: forest demon | last post by:
for example, let's say I do something like, System.Diagnostics.Process.Start("notepad.exe","sample.txt"); if the user does a SaveAs (in notepad), how can i capture the path that the user...
0
by: =?Utf-8?B?TWFyY3VzIFNjaGFlZmVy?= | last post by:
Hi everybody, I'm working on my application for appr. 2 years and now suddenly I got an System.TypeInitializationException in one of my global modules. The error is thrown at the first call of a...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.