Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

me.refresh problem

Status
Not open for further replies.

sunaj

Technical User
Feb 13, 2001
1,474
DK
Hi,

I've made a class that exposes a 'Progress' event. In a windows application I use the progress event to show some information (about the progress of the class task suprisingly..):
----------------------------------------------------
Private Sub hej_Progress(ByVal msg As String) Handles hej.Progress
Label1.Text = msg
Me.Refresh()
End Sub
----------------------------------------------------
This works fine as long as the window is in focus. But if I move another window in front of it, the repainting of the form stops - even if I give focus back to the form.
I can get rid of the problem by adding
System.Windows.Forms.Application.DoEvents()
in the event handler, but why does the refresh not work?


Sunaj
'The gap between theory and practice is not as wide in theory as it is in practice'
 
Anybody?

Sunaj
'The gap between theory and practice is not as wide in theory as it is in practice'
 
I think U have to use threads:
create a new thread and open the new form within that thread.

MaxZak
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top