I seem to remember how I noticed a way to invoke InvokeRequired and Invoke neatly to avoid repeating too much code in each event handler, but I can't remember what it was. So does anyone know a neat way to write this code?
Preferred for VB.Net 2005.
The SO question here addresses this issue from a C # point of view, and any of the answers can probably be easily adapted to VB.
Although my answer was not accepted, I believe that using the anonymous method method MethodInvokeris the easiest.
MethodInvoker
, .
- , Roy Osherove ( , DLL):
[RunInUIThread] protected virtual void DoSomeUIStuff() { this.Text = "hey"; }
Source: https://habr.com/ru/post/1743511/More articles:WPF Team MenuItem ViewModel - .netOverride delete function in entity structure - asp.netКак выполнить проверку Spring в MultiActionController? - springКлиент Android: веб-сервис - какой правильный SOAP_ACTION, METHOD_NAME, NAMESPACE, URL, который я должен использовать? - androidcan't show JTable - javaA query for the existence of an object with LINQ (for entities) - .netSpring 3: task namespace: how to find out next run time? - javaProblems with C ++ macro __VA_ARGS__ - c ++Загрузка/сохранение объектов в файле в Java - javaBesides the @Produces annotation, how does Jersey (JAX-RS) know how to handle POJOs as a specific MIME type? - javaAll Articles