How can I stop GUI lag when working constantly?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • PBQuestions
    New Member
    • Oct 2012
    • 1

    How can I stop GUI lag when working constantly?

    When my program is working with a big list, it always connects to the internet and checks informations from a website. It is going fast, but when I'm trying to update a label on every connection, it just shows at the end, when everything is checked. Progressbar value is updating.
    How to solve this?
  • PsychoCoder
    Recognized Expert Contributor
    • Jul 2010
    • 465

    #2
    This is happening because everything is being ran on the applications main thread, meaning that one task has to complete before the next one can start, and do on. This makes your UI appear to become 'frozen' because only a single task can be ran at a time.

    The easiest way to resolve this issue is to use a BackgroundWorke r, which will allow for multiple task to be performed asynchronously

    Comment

    Working...