Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

Dim i As Integer = 1

For i = 1 To 100000

Me.Label1.Text = Str(i) & " of 100000"

Me.Refresh()

Next

End Sub

 

When I click my Button1 and then click on another window, say Windows Explorer or Outlook, etc., my VB.NET form obviously loses focus. When I come back to it it doesn't refresh until the loop is completed.

 

Is there anyway to either keep the VB.NET form modal; not just within my VB.NET app but throughout all of the windows that are up on my PC?

 

Or is there a way to keep it running in the background or refresh it upon activating? I've tried the activated event, but it still waits for the for loop to finish.

 

Any thoughts? Thanks

Ben

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...