Controls are slow to paint

G

Guest

I am developing a mdi application that will act as a front end to a database.

I am finding that when i show any of the mdi child forms in my application
it is noticeable that the form is shown first with the areas where the
controls will be displayed cut out and what ever is top most before the form
is shown is momentarity seen through these areas.

This is also noticed if the user changes focus to say internet explorer and
then back to the running application.

I find that this is more noticeable for textboxes, labels and toolstrips but
not listboxes or tab controls.

I have tried various methods suggested for double buffering, however these
appear to show no signs of improvement.

None of my mdi child forms are currently doing anything special on loading -
the form as seen in the form designer is just being shown (no data access on
load)

I would appreciate any suggestions.
 
G

Guest

Are you using any third-party components? We've had some issues with
third-party components causing issues.

One thing I did find made form display a little quicker was rather than
writing code into the form_load event, I use the form_onload. I have seen
noticeably quicker paints.

HTH.

-Eric
 
G

Guest

Thanks for your feedback Eric.

I'm not using any third party components in this application yet.

I find that this problem exists even on an about form that i have. I am
intialising the labels on that form after the InitializeComponent() call in
the constructor.

I find that even if i take out all of my initialisation code on this form,
this takes out all of my code for this particular form, I see no improvement
in the problem even though all the form is doing is loading what i have
designed in the windows form designer.

I mention just the about form above but this problem is present in all mdi
child forms in the application.

Should I expect applications created in the .net framework to paint forms
piecemeal in this way? It's a while since I have used VB6 but i don't
remember this problem with it.

Jonathan
 
G

Guest

I wouldn't expect this type of problem at all. I've written many .NET
applications that are based on the MDI model and I have never had any real
issues. The reason I mentioned the third-party controls is that we have some
forms with very complex grids and docking schemes that were a bit of a
problem however even they perform well now.

What are the specs for the development machine you're using. Are you
noticing any limiting factors like CPU or Memory?

Is this slowness still apparent if you show the form with no MDIParent set?
Is it only apparent for the first instance of the form or for every single
form being shown?

-Eric
 
G

Guest

My development machine has a 2.7Ghz Processor and 512Mb RAM. I am not
noticing any adverse affects on other applications.

I have run some tests and find that the slowness is as apparent if the form
if it is hidden and then that same instance is subsequntly shown again, as it
is when a new instance is created. It is slightly more noticeable when the
form is first shown.

The main child forms used in my app have many pairs of textboxes and labels,
however i find that the slowness is just as apprent on the about form which
has relatively few controls - so I am assuming that this problem is not
related to the number of controls on the form.

It appears to be more apparent in mdi child forms, and i assume this is
because there are 'holes' where the controls should be and therefore you
momentarily see the dark grey of the parent form. Do you find that this is at
all noticeable in your apps? - I just wonder if I am being too sensitive
regarding this - do you notice this behaviour at all in your apps or do the
child forms appear at once with no noticeable drawing of controls?

Regards

Jonathan
 
G

Grandpa0594 via DotNetMonster.com

I have been experiencing the exact same thing you are and for the past two
years have yet to find anyone to tell me why. Here's a work-around however.
Put Me.Refresh in the form.activated of your mdiChild form. It's like night
and day.
 
G

Guest

Honestly, I have not noticed anything like the problem you're experiencing.
It is going to be difficult to diagnose as I have a number of programmers
working for me and I have not seen this type of slowness on any of the
machines we use. We generally do not provide our developers with machines
with less that 1GB Ram however you would expect to see issues across the
board if this were the problem.

What version of the .NET framework are you using? Have you had any other
versions installed on the machine previously?

-Eric
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top