C# compile error: “Invoke or BeginInvoke cannot be called on a control until the window handle has been created.”

前端 未结 9 897
时光取名叫无心
时光取名叫无心 2020-12-16 23:16

I just posted a question about how to get a delegate to update a textbox on another form. Just when I thought I had the answer using Invoke...this happens. Here is my code:<

9条回答
  •  [愿得一人]
    2020-12-17 00:14

    This is to help in case any other person got caught up with this. My problem: VB.net: “Invoke or BeginInvoke cannot be called on a control until the window handle has been created.” I closed a form which has a handler for the event am calling to update the delegate, without removing the handler for the event.

    What I did: When I close the form, I removed all the handlers, and assigned them back when i opened the form. It solved the problem.

提交回复
热议问题