473,325 Members | 2,712 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,325 software developers and data experts.

out of memory in c# display

I have a form in c# with handreds of controls. It's take alot of time to th
program to start what can i do?
Jul 11 '07 #1
3 1198
On Wed, 11 Jul 2007 00:20:01 -0700, einat
<ei***@discussions.microsoft.comwrote:
I have a form in c# with handreds of controls. It's take alot of time to
th
program to start what can i do?
Fewer controls?

Seriously, that's a lot of controls.

It's hard to provide very good advice without knowing the specifics. How
are the controls arranged? Why do you have so many? Are they all visible
at once? What kinds of controls are they?

But for the most part, the solution will still be some form of "fewer
controls". Whether that's using the same controls but more intelligently,
or revising the UI so that instead of using controls, you use some sort of
custom drawn UI that's a single custom control, or at least some smaller
number of custom controls, the general goal would be to reduce the number
of controls.

Of course, there is also the question of what "a lot of time" means (some
people don't like waiting even a second or two, while others are happy if
their application starts up in under 30 seconds...subjective terms like "a
lot of" don't convey the reality very well), as well as what exactly the
controls are doing in their initialization (hundreds of controls is a lot
of controls, but you should also make sure that you aren't doing something
especially expensive during initialization that would slow things down).

Again, you should provide better specifics if you want a really good
answer. You may even want to post a concise-but-complete example of code
that demonstrates what your form looks like, how the controls are used,
and how slow it is to start the program.

Pete
Jul 11 '07 #2
Hi,

"einat" <ei***@discussions.microsoft.comwrote in message
news:EB**********************************@microsof t.com...
>I have a form in c# with handreds of controls. It's take alot of time to th
program to start what can i do?
Less controls?

Frankly I have never see a form with more than 100 controls, what it looks
like?
(post a picture)

There are a couple of things you could do, you can use a Splash screen until
the form is created or even shown in the screen (you close the Splash from
the Form_Load handler)

Also you could try to create some laziness , create the controls when
needed, like the first time that a tabpage is activated, etc
Jul 11 '07 #3
On Wed, 11 Jul 2007 00:20:01 -0700, einat
<ei***@discussions.microsoft.comwrote:
>I have a form in c# with handreds of controls. It's take alot of time to th
program to start what can i do?
100 controls? My! What does the form do? Is it necessary to have all
the controls on the form?

If they are all necessary then you might want to look at ways to
minimize them -- for instance using a calendar instead of 3 combo
boxes, etc

--
http://bytes.thinkersroom.com
Jul 11 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: shyamal | last post by:
I want to display memory content using C++ on LINUX. For example, the user may ask to display 256 bytes from 0x1000ff00. The problem is , if any location is invalid, the program will coredump...
12
by: jois.de.vivre | last post by:
Hi, I have the following piece of code that is designed to help me add debug traces to my program (I wanted to use purely C++ code, but the only way I know how to do something like this is with...
30
by: jimjim | last post by:
Hello, This is a simple question for you all, I guess . int main(){ double *g= new double; *g = 9; delete g; cout<< sizeof(g)<<" "<<sizeof(double)<<" "<<sizeof(*g)<<" "<<*g<<" "<<endl; *g =...
5
by: Tomaz Koritnik | last post by:
Hi I have many short HTML files stored in a binary stream storage to display descriptions for various items in application. HTML would be display inside application using some .NET control or...
20
by: mariano.difelice | last post by:
Hi, I've a big memory problem with my application. First, an example: If I write: a = range(500*1024) I see that python process allocate approximately 80Mb of memory.
18
by: happyvalley | last post by:
Hi, basically, the test function get a char pointer, and assigned a string to it. then the string is passed back by the call-by-reference mechanism. in test(), I reallocate some memory for the...
1
by: Peterwkc | last post by:
Hello all expert, i have two program which make me desperate bu after i have noticed the forum, my future is become brightness back. By the way, my problem is like this i the first program was...
0
by: krishnasamy | last post by:
Hello, I am writing a DLL for Capturing the Image from Camera Device using Camera SDK DLL. All the calls made to functions in Camera SDK DLL are working properly as I am able to get a return...
0
by: Hypnotik | last post by:
My program is to simulate cache memory. I read in the info from 2 external files, 1) access 2) data in memory. When I read the information in I display the info...and it is all correct. However...
2
by: Jay | last post by:
I have a web app running on the windows CE device. In one of the asp.net pages - it has javascript code. That seems to have a memory leak. When I run the web app - in about one hour, the app hangs....
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
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
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...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
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)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work

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.