Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
400
Adding buttons dynamically on backgroundWorker_RunWorkerCompleted
posted

Hi!

I have some code that adds buttons in a toolbar dynamically. This code runs on RunWorkerCompleted of a background worker (this is because the buttons I am about to add refer to data loaded from a database, so I want to use a background thread). Code is executed without exception but buttons are not shown.

If I temporarily cut and paste the same code so that it is out of the background work context it runs again and the buttons are show properly.

What's going on?