473,503 Members | 1,678 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1844
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
4935
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
452
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
2323
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
3983
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
2329
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
243
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
3961
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
601
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
7201
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7083
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7328
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6988
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7456
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5578
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5011
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3166
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1510
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.