c# - Windows Form runs new thread with dialog box (form) and main thread owns the dialog box -



c# - Windows Form runs new thread with dialog box (form) and main thread owns the dialog box -

i have windows application written in c#. when app started, create new thread run background process while main thread idle. background thread show dialog box. found dialog box hidden if click on main ui.

the question how can create dialog box own main ui? know setting topmost property true create dialog remain on top of screen, don't want this.

please help.

you should trigger ui changes on main thread. have background process homecoming result main ui thread , trigger dialog box there. async/await works tasks such this.

here simple illustration of executing asynchronously , setting ui element returned result... accessing ui controls in task.run async/await on winforms

c# multithreading winforms

Comments

Popular posts from this blog

assembly - What is the addressing mode for ld, add, and rjmp instructions? -

vowpalwabbit - Interpreting Vowpal Wabbit results: Why are some lines appended by "h"? -

Is there a way to convert an HTML page styled with Bootstrap CSS into email-compatible html? -