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

400 usercontrols to display take too much time - any solution?

hello,

I am developing a boardgame, with a large number of customed
usercontrols ( e.g. 20 X 20 = 400 ).
I find it very usefull to use usercontrols, as they can contains
specific properties and methods, but it makes the application very
slow to redraw, even if I redraw only a small subset of them.

Is there a way to speed up the drawing time? I included in my codes
those lines:

this.SetStyle(ControlStyles.DoubleBuffer, true);
this.SetStyle(ControlStyles.AllPaintingInWmPaint, true);
this.SetStyle(ControlStyles.UserPaint, true);

but it does not really help.

Is there a way to remove all unused standard methods of the
usercontrol? Any suggestions?

thx,

picander
Nov 16 '05 #1
2 1223
The presence of a lot of methods won't have an appreciable impact on
performance -- in fact, as far as I know, no impact other than large code
size taking memory away from other things, but remember, unlike with
instance data, there is just one copy of the code in memory per class, not
per instance. And if you don't call a given method, it's never JITted, so
there shouldn't be any overhead there.

Are you certain that drawing time is the bottleneck? There could be a lot
of other sources of the problem. If you haven't already, do some profiling
to see what is really soaking up the time. And be sure to profile and
benchmark in a non-debug version.

--Bob

"Picander" <pi********@yahoo.de> wrote in message
news:88*************************@posting.google.co m...
hello,

I am developing a boardgame, with a large number of customed
usercontrols ( e.g. 20 X 20 = 400 ).
I find it very usefull to use usercontrols, as they can contains
specific properties and methods, but it makes the application very
slow to redraw, even if I redraw only a small subset of them.

Is there a way to speed up the drawing time? I included in my codes
those lines:

this.SetStyle(ControlStyles.DoubleBuffer, true);
this.SetStyle(ControlStyles.AllPaintingInWmPaint, true);
this.SetStyle(ControlStyles.UserPaint, true);

but it does not really help.

Is there a way to remove all unused standard methods of the
usercontrol? Any suggestions?

thx,

picander

Nov 16 '05 #2
If you create custom graphical objects, that know how to draw and hit test,
they will be much faster than controls. This way you use only a single
control.

Regards,
Frank Hileman

check out VG.net: http://www.vgdotnet.com
Animated vector graphics system
Integrated Visual Studio .NET graphics editor

"Picander" <pi********@yahoo.de> wrote in message
news:88*************************@posting.google.co m...
hello,

I am developing a boardgame, with a large number of customed
usercontrols ( e.g. 20 X 20 = 400 ).
I find it very usefull to use usercontrols, as they can contains
specific properties and methods, but it makes the application very
slow to redraw, even if I redraw only a small subset of them.

Is there a way to speed up the drawing time? I included in my codes
those lines:

this.SetStyle(ControlStyles.DoubleBuffer, true);
this.SetStyle(ControlStyles.AllPaintingInWmPaint, true);
this.SetStyle(ControlStyles.UserPaint, true);

but it does not really help.

Is there a way to remove all unused standard methods of the
usercontrol? Any suggestions?

thx,

picander

Nov 16 '05 #3

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

Similar topics

0
by: Matrix - MAM | last post by:
Hi, We are usiing datagrid Web Server contol in our Web Application. We've set tooltip property for one column of datagrid. It is working fine. But the problem is the tool tip message disappears...
1
by: karanam ravi kiran via DotNetMonster.com | last post by:
hi friends, i am fresher in the world of .net, i have problem to display time in asp.net web continuously. i want to display time on the form like the "live timer on windows task bar" plz help...
5
by: japin0 | last post by:
This code below suppose to display time of my PC on the web but it doesnt ..it just echos "Hello W3Schools!" <html> <body bgcolor="yellow"> <center> <h2>Hello W3Schools!</h2>...
6
by: Xavier | last post by:
hello, what is the best way to display display the time needed for rendering the information. I must get the difference of time from the start of rendering till the finish rendering the page -...
4
by: Ren | last post by:
Hi all, I am trying to display the current time including milliseconds (two digits only). So for example the current time will have Hour : Minute : Second : Millisecond. Example: ...
1
by: VB Programmer | last post by:
I want to display the Live time in New York and Hong Kong on my website. Any suggestions on how to display these live clocks? I suppose some client side scripting is necessary because I don't...
0
by: Stefan L | last post by:
Hi everybody! I was just starting to use partial classes in my projects, but it is kind of anoying that the VS solution explorer displays the files flat in the hierachy rather than nested. ...
1
by: vchezel | last post by:
Hi, I did a project in c++ to do file operations.The output of the program would be like this File create\File1_1 created File create\File1_1 Copied to copy\FileDest_1 File copy\FileDest_1 (6302...
3
by: timhoagland | last post by:
Hi, I have a C++ data acquisition program, running under Linux. The basic stucture is: Setup devices Acquire data for x seconds. Cleanup. The problem is that I don't have a way to...
1
by: noorcsharp | last post by:
how to display time in a label in c#.net in this format hh:mm:ss
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: 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: 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.