Results 1 to 6 of 6

Thread: Background Thread causing System.Reflection.TargetInvocationException

Threaded View

  1. #6
    PowerPoster PlausiblyDamp's Avatar
    Join Date
    Dec 2016
    Location
    Pontypool, Wales
    Posts
    2,958

    Re: Background Thread causing System.Reflection.TargetInvocationException

    Quote Originally Posted by John_SC View Post
    I am dealing only with progress bars and datagridviews.
    I only access the progress bar in the background thread so that should be clean
    I make make all changes to the dgv in the background thread. i pass in the fields and add rows in the background. I also am changing some colors of cells in the background. I the foreground I do get the number of rows in the background and do read information out of the dgv.
    That is pretty much your problem then, you are accessing user interface elements from a background thread. This is a big no-no, you can only access the UI from the main UI thread.

    http://www.vbforums.com/showthread.p...ding-in-VB-Net is probably something you will find worth a read.
    Last edited by PlausiblyDamp; Mar 18th, 2017 at 02:32 PM.

Tags for this Thread

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