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
Post a Comment