problem with modeless child dialog

A

AboutJAV

Hi,

I created a child dialog to tell the user that there is a loading of
data from the database. When the loading is done, the child dialog will
close. The child dialog contains a custom control and the child dialog
with the custom control show up fine if the dialog is called as a modal
state

dlgLoading.ShowDialog();

However, the process will stop unless the dialog is closed. I tried
using the modeless state


dlgLoading = new LoadingUI(); // in the class constructor

dlgLoading.Show(); // in another method

When the loading data is done, this is called

dlgLoading.Hide();


However the child dialog is not painted correctly. It is all black. I
can't see the custom control.

What call is missing. Any help is appreciated.

Thanks
 
G

Guest

Hi,
are you using .Net 1.1 or 2.0, are you utilizing threading in your
application?

Mark.
 
K

KWienhold

My first guess would be that while loading your data, the process never
returns to handle its events, so your parent form won't get the chance
to properly redraw itself or its children.
If you use a loop to load your data you could try calling
Application.DoEvents() on each iteration. Depending on how fast your
loop runs, this might already be enough to make the application seem
responsive to the user.
Otherwise you might consider moving your loading functionality into its
own thread, so it won't lock up your form. This would of course require
some way to assure that your application doesn't try to work with data
that is not yet loaded.

Sincerely,
Kevin Wienhold
 

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