Windows Develop Bookmark and Share   
 index > Windows Forms General > Screen Updating Issues
 

Screen Updating Issues

I have a VS 2005 winform with a toolstrip menu item that opens another form in dialog mode:

private void viewBatchesToolStripMenuItem_Click(object sender, EventArgs e)

{

FrmBatch frmBatch = new FrmBatch();

frmBatch.ShowDialog();

}

When FrmBatch starts it runs a long-running query that takes about 10 seconds to complete and then loads a DataGridView with the data from the query.

During the loading process the screen looks terrible. After a few seconds, the parent form (FrmDialer) goes totally white. Finally, the query is done and FrmBatch loads its grid but there is bleed through of items from FrmDialer into FrmBatch. Furthermore, the part of FrmDialer that is not covered by FrmBatch has white areas on it and when FrmBatch is closed those white areas remain.

I have tried various this.Update() and this.Refresh() but nothing seems to quite work.

There has to be way to fix this very unprofessional looking UI. Help, please.

Thanks,

Paul

Paul Litwin  Friday, May 30, 2008 7:03 PM
Use the BackgroundWorker to perform your long lasting task. It will execute the work in a different thread so it won't lock the user interface (letting it to repaint itself). If you want to know how to work with it there are plenty of articles/threads/tutorials around about it.

Regards,
Fábio
Fábio Franco  Friday, May 30, 2008 8:39 PM
Use the BackgroundWorker to perform your long lasting task. It will execute the work in a different thread so it won't lock the user interface (letting it to repaint itself). If you want to know how to work with it there are plenty of articles/threads/tutorials around about it.

Regards,
Fábio
Fábio Franco  Friday, May 30, 2008 8:39 PM

You can hide the main form before showing frmBatch.

You can use Show instead of ShowDialog.

You can use a BackGroundWorker and Show frmBatch in the DoWork event.

JohnWein  Friday, May 30, 2008 8:46 PM

You can use google to search for other answers

Custom Search

More Threads

• Checkbox Layout in DataGridView - any way to change?
• DataGridViewCheckBoxCell - programatically set value
• Tree list grid view control needed
• securing a folder
• How to change the display text to a custom one on propertygrid control
• How to display multiple local reports using single reportviewer
• User control property
• combobox problem
• cant override the Region property of a control
• LINQ with winforms