BeginInvoke claims the control's window handle has not been created even though I think it was

begininvoke, c#, winforms

Solution

Move `label1.BeginInvoke` from constructor to `Form_Load` event handler.

Problem

In my form's constructor, I call: ``` InitializeComponent(); // boilerplate placed by VS, initializing controls label1.BeginInvoke(new InvokeDelegate(RefreshLabelDelegate)); ``` Yet, I get the dreaded exception with the message: "Invoke or BeginInvoke cannot be called on a control until the window handle has been created" AFAIK, it is all the same thread, so why the exception?

Original source

Related problems