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