CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Feb 2013
    Posts
    11

    background worker error handling

    hi to everyone.
    not sure if this is the proper place to post this question - if it is not, then please accept my apology.

    i am trying to find out how to use a try/catch in the backgroundworker completed code block?

    the situation is this:
    i have a grid that is refreshing and the refresh is attached to a background worker.
    everything seems to be going good. except for 1 hiccup -

    seems if i click on the button that is attached to the posting of my grid - and this click event happens to
    take place at the same time my background worker is in a refresh state - i will recieve the error of "it is in use"
    when i hit continue through this error - my grid will refresh and carry on its merry way.

    it is not happening all the time - just at the odd times my refresh is coinciding with my button click event.

    any suggestions would be greatly appreciated!

  2. #2
    Join Date
    Jan 2006
    Location
    Fox Lake, IL
    Posts
    15,007

    Re: background worker error handling

    Delete Line #42?

    Seriously, we'd need to see some code. Study the links (in my signature) for the VB SAMPLES on the right way to do it!
    David

    CodeGuru Article: Bound Controls are Evil-VB6
    2013 Samples: MS CODE Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured