Quantcast
Channel: VBForums
Viewing all articles
Browse latest Browse all 16013

Multithreading and timer

$
0
0
Hello everyone,

I have been facing some problems related to multithreading and timer. I have read in some other posts about it but as being a beginner in this field, could not exactly understand my problem and possible solutions.
The problem is, my second form loading process is taking a bit more time which is why I have planned to show the running process by using a panel with rotating Giff in a PictureBox and a loading message in a label. For this, I made a thread, put the form-changing process in it, and showed the waiting panel(by making it visible and invisible when necessary) using the main thread. Everything was working fine but later I realized my timer in the second form that should start right after the form loading event was not working. I read in the other post the timer works only in the main UI thread, is that right? I also tried by exchanging the threading process in the first form but only the form changing process was running and not the panel showing process.
How am I supposed to solve this issue.

This should make it easy to understand my problem:

First Case:

1st form main thread:
panel(Rotating Giff and message) showing process

1st form added thread:
form changing process(1st form to second form)

In this case, both the processes are working fine but the timer in the second form is not running which should start working after the form load event.

Second Case:

1st form main thread:
form changing process(1st form to second form)

1st form added thread:
panel(Rotating Giff and message) showing process

In this case, the form changing process is working fine and the timer is also working in the second form but the panel is not visible while changing the form.

I also tried working with the Backgroundworker but the result was the same. Any help would be highly appreciated.

Viewing all articles
Browse latest Browse all 16013

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>