Note that there are some explanatory texts on larger screens.

plurals
  1. POvb.net : background worker causing delay in UI
    primarykey
    data
    text
    <p>I am running a background worker to gather some information before I show the user a log in screen. I have the call to the log in page inside the workerCompleted sub, but for the first few seconds that the log in page shows, the mouse moves very jerky and you can't click any buttons, then everything works fine after a couple of seconds. It looks like the background worker isn't really finished, but it showed me the log in page anyway. Is there a way to determine if the background worker is REALLY finished before moving on?</p> <p>Thanks.</p> <p>Here is my code:</p> <pre><code>Private check_config_bw As BackgroundWorker = New BackgroundWorker Public Sub start() check_config_bw.WorkerReportsProgress = True check_config_bw.WorkerSupportsCancellation = True AddHandler check_config_bw.DoWork, AddressOf check_config_bw_DoWork AddHandler check_config_bw.ProgressChanged, AddressOf check_config_bw_ProgressChanged AddHandler check_config_bw.RunWorkerCompleted, AddressOf check_config_bw_RunWorkerCompleted If Not check_config_bw.IsBusy = True Then check_config_bw.RunWorkerAsync() End If End Sub Private Sub check_config_bw_DoWork(ByVal sender As Object, ByVal e As DoWorkEventArgs) ' open database connection, check it, move on End Sub Private Sub check_config_bw_RunWorkerCompleted(ByVal sender As Object, ByVal e As RunWorkerCompletedEventArgs) ' dispose of the background worker since it is no longer needed ' ------------------------------------------------------------ check_config_bw.Dispose() If check_config_success = True Then ' Go on to the next step ' ---------------------- show_login() Else ' go to configuration page ' ------------------------ configure_application() End If End Sub </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload