-
December 27th, 2012, 04:41 PM
#1
Basic Threading Problem
I just want a label to show a loading message before executing a bunch of code. I wrote this:
Code:
private void LoadQueue()
{
displayRangeAuditLabel.Visible = false;
sortByComboBox.Visible = false;
showLateCheckBox.Visible = false;
lblQueueLoading.Visible = true;
if (LoadingThread != null && LoadingThread.IsAlive) LoadingThread.Abort();
LoadingThread = new Thread(new ThreadStart(BindAuditQueue));
LoadingThread.Start();
}
This works and displays my label about half the time - the other half, it only grays out the background area of the label. I suck at threads. What's wrong?
Last edited by BioPhysEngr; January 3rd, 2013 at 12:53 AM.
Reason: code tags
-
January 2nd, 2013, 11:10 AM
#2
Re: Basic Threading Problem
You need to show a more complete code snippet. The code you posted is missing the BindAuditQueue thread proc implementation.
-
January 3rd, 2013, 12:53 AM
#3
Re: Basic Threading Problem
Also, if you use [code] and [/code] tags, it will preserve formatting (I have modified your original post to include these).
Best Regards,
BioPhysEngr
http://blog.biophysengr.net
--
All advice is offered in good faith only. You are ultimately responsible for effects of your programs and the integrity of the machines they run on.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|