473,499 Members | 1,541 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Slow form with multiple user controls redraw

Hello.
I'm working with WinForm. It has 30 same user control, each with 4 buttons,
3 labels, 3 textboxes, 2 picture boxes and uses override onPaint to draw
gradient rectangle. Main form also has 2 panels with same gradient.
I'm trying to reduce drawing speed on form activation. But at the moment it
is too noticeable for each user control to be drawn.
Tried to use double buffering on main form and on each user control, looks
almost the same.
Any help appreciated.
Nov 17 '05 #1
2 7873
Just in case, make sure that UserPaint and AllPaintingInWmPaint is true. DoubleBuffering requires these bits to be set.

You can attempt to cut down on the flicker and paint time by reducing the number of controls that you are using. You mentioned that
you are using 3 labels and 2 picture boxes. These can easily be represented through GDI without the use of a control. Less
messages in the message loop = faster response time. If you need hit detection for mouse events or other user-interaction with
these controls you'd have to implement that manually via the events of the container control, of course. Also, you'll lose
Form-based featuers that Controls provide such as docking, anchoring, tabbing, amoung others. The 2 panels can also be drawing (the
gradient) without the panels, but you'll lose Control containment that the Panel provides.

If you can reduce the number of controls you are using you will most surely notice a difference.

--
Dave Sexton
dave@www..jwaonline..com
-----------------------------------------------------------------------
"conset23" <a@yahoo.com> wrote in message news:el*************@TK2MSFTNGP12.phx.gbl...
Hello.
I'm working with WinForm. It has 30 same user control, each with 4 buttons, 3 labels, 3 textboxes, 2 picture boxes and uses
override onPaint to draw gradient rectangle. Main form also has 2 panels with same gradient.
I'm trying to reduce drawing speed on form activation. But at the moment it is too noticeable for each user control to be drawn.
Tried to use double buffering on main form and on each user control, looks almost the same.
Any help appreciated.

Nov 17 '05 #2
And is there any other way except reducing controls number. UserPaint and
AllPaintingInWmPaint is true.

Maybe it is possible to draw all form at once, and deny drawing each user
control separately?
Nov 17 '05 #3

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

Similar topics

5
6068
by: Richard Cornford | last post by:
I am interested in hearing opinions on the semantic meaning of FORM (elements) in HTML. I have to start of apologising because this question arose in a context that is not applicable to the...
12
2613
by: Neil | last post by:
I previously posted re. this, but thought I'd try again with a summary of facts. I have an Access 2000 MDB with a SQL Server 7 back end. There is a view that is linked to the database via ODBC...
8
2866
by: Neil | last post by:
I have a very puzzling situation with a database. It's an Access 2000 mdb with a SQL 7 back end, with forms bound using ODBC linked tables. At our remote location (accessed via a T1 line) the time...
7
2798
by: IntraRELY | last post by:
I am using the following command to launch and .NET VB Executable, which is a simple Windows Form (printCheckClient.exe). I am using a HyperLink Control and works perfect....
8
5637
by: Benoit Martin | last post by:
I had to draw my own control because I couldn't find any control doing what I wanted it to do. This control has a grid that I need to have control over. To do that, I draw each line of the grid...
2
5243
by: jgraham | last post by:
I have an application which configures the user interface (UI) at runtime, meaning, the images that make up the UI are loaded based on the current configuration when the application starts. The UI...
9
2965
by: jeff | last post by:
Hi All. I realize that when my Deployed winforms application starts, Windows needs to load the .net 2 framework before control is given to my application.... Is there anyway to either ... -...
8
2741
by: George | last post by:
Hello everyone, I am using C# on a Pocket PC 2003 project based on .Net Compact Framework of Visual Studio 2005. I want to re-draw some controls of a Form (Window) at a regular interval (for...
3
2110
by: John | last post by:
Hi I have replaced an ms access app with its vb.net version at a client site. Now the clients keeps complaining about how slow the app response is. The complains they have are for example when...
0
7006
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
7169
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7215
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...
0
5467
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,...
0
4597
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3096
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
3088
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1425
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 ...
1
661
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.