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

前端 未结 9 871
时光取名叫无心
时光取名叫无心 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:03

    logAddDelegate(message);

    I think you are calling this before the Form_Load event has been raised. Fix your code to wait for the form to load before calling logAddDelegate(...) i.e. before calling Logging.updateLog()

提交回复
热议问题