locked
Updating a label without using DoEvents RRS feed

  • Question

  • I have a snippet of code that updates a status label to read "Awaiting Response..." and then queries a device.  Of course, the label doesn't update until after the sub exits, which is too late.   I know I could update the label immediately using application.doevents(), but I want to avoid giving control away until the sub finishes.  Is there a way to update the label without using doevents?  Thanks.

    - Jon
    Tuesday, March 10, 2009 11:41 AM

Answers

  • http://www.dotnet-friends.com/articles/csharp/artincsd57df79a-cbfd-4230-9977-59dda178c25b.aspx

    Thanks, A.m.a.L
    • Proposed as answer by BrainWasher Tuesday, March 10, 2009 12:12 PM
    • Marked as answer by Yichun Feng Monday, March 16, 2009 2:21 AM
    Tuesday, March 10, 2009 11:59 AM

All replies

  • http://www.dotnet-friends.com/articles/csharp/artincsd57df79a-cbfd-4230-9977-59dda178c25b.aspx

    Thanks, A.m.a.L
    • Proposed as answer by BrainWasher Tuesday, March 10, 2009 12:12 PM
    • Marked as answer by Yichun Feng Monday, March 16, 2009 2:21 AM
    Tuesday, March 10, 2009 11:59 AM
  • Thanks Amal,

    good article and not too hard to translate to VB ;)
    Please mark the post as answer if solved and maybe post the final solution for others
    Tuesday, March 10, 2009 12:12 PM
  • label1.Refresh();
    Tuesday, March 10, 2009 2:11 PM