c# - Opening another form with a method/function that is on another thread? -


is possible open second form, when method/or function opening 2nd form on thread?

i have read other threads related this.. seems cant figure out how use invoke

here's how open 2nd form when im calling this.. nothing happens..(because on 2nd thread)

timermode f2 = new timermode(); f2.showdialog(); 

please me. newbie multi -threading..

it should doing something. because showdialog run own message loop. timermode form should @ least visible , functioning. but, right, not best practice if form interacting other forms running on main ui thread.

here how might it.

anotherform.invoke(   (methodinvoker)(() =>   {     new timermode().showdialog();   })); 

note anotherform reference 1 of other forms hosted on main ui thread.


Comments

Popular posts from this blog

c# - how to write client side events functions for the combobox items -

exception - Python, pyPdf OCR error: pyPdf.utils.PdfReadError: EOF marker not found -