Solved 2008: update listbox control from multiple sources

Posted on 2011-10-03
Last Modified: 2012-05-12
I need to update a listbox control from multiple sources.  What is the best way to do this to avoid 2 competing updates?
Question by:dhenderson12
    LVL 22

    Expert Comment


    Author Comment

    OK, I wasn't clear in my question.  I have 2 classes, each of which monitors a serial connection (com1 and com2).  I need to post the data from each serial port in a common listbox, so I'm concerned about "collision" and was wondering what the best way to do this.
    LVL 83

    Accepted Solution

    One way is to use a Queue class. Both classes queue information to the queue and the main thread can dequeue the info and update UI.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Highfive Gives IT Their Time Back

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Suggested Solutions

    Microsoft Reports are based on a report definition, which is an XML file that describes data and layout for the report, with a different extension. You can create a client-side report definition language (*.rdlc) file with Visual Studio, and build g…
    Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
    To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…
    Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    9 Experts available now in Live!

    Get 1:1 Help Now