Basic Threading Problem
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums
Results 1 to 3 of 3

Thread: Basic Threading Problem

  1. #1
    Join Date
    Dec 2012

    Basic Threading Problem

    I just want a label to show a loading message before executing a bunch of code. I wrote this:
            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));
    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

  2. #2
    Arjay's Avatar
    Arjay is offline Moderator / MS MVP Power Poster
    Join Date
    Aug 2004

    Re: Basic Threading Problem

    You need to show a more complete code snippet. The code you posted is missing the BindAuditQueue thread proc implementation.

  3. #3
    Join Date
    Feb 2011
    United States

    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,

    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

Windows Mobile Development Center

Click Here to Expand Forum to Full Width

On-Demand Webinars (sponsored)