# What's the best way to refresh multiple CVB displays in C# in a multithread acquisition application

**URL:** <https://forum.commonvisionblox.com/t/whats-the-best-way-to-refresh-multiple-cvb-displays-in-c-in-a-multithread-acquisition-application/482>\
**Category:** Programming Questions\
**Tags:** display, csharp, multithreading\
**Created:** [June 27, 2018, 8:26am UTC](https://forum.commonvisionblox.com/t/whats-the-best-way-to-refresh-multiple-cvb-displays-in-c-in-a-multithread-acquisition-application/482 "2018-06-27T08:26:08Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Greg](https://avatars.discourse-cdn.com/v4/letter/g/71c47a/32.png) [@Greg](https://forum.commonvisionblox.com/u/Greg)\
**Post date:** [June 27, 2018, 8:26am UTC](https://forum.commonvisionblox.com/t/whats-the-best-way-to-refresh-multiple-cvb-displays-in-c-in-a-multithread-acquisition-application/482/1 "2018-06-27T08:26:08Z")

</div>

Hello,

please imagine the following scenario:  
I have an application acquiring images from up to four cameras. Each camera has is it’s own thread where G2Wait is called in a loop. Furthermore each camera has it’s own display, which should be refreshed after G2Wait returned.

What is the way you would recommend for the implementation of the display refreshes. I know how to do in c++ but my c# is a bit rusty. A code example or a snippet would be extremely helpfully as well.

Thank you in advance & keep the finger crossed for match this evening.  
Greg

---

<div class="post-metadata">

**Author:** ![illusive](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.commonvisionblox.com/illusive/32/61_2.png) [@illusive](https://forum.commonvisionblox.com/u/illusive)\
**Post date:** [June 27, 2018, 9:36am UTC](https://forum.commonvisionblox.com/t/whats-the-best-way-to-refresh-multiple-cvb-displays-in-c-in-a-multithread-acquisition-application/482/2 "2018-06-27T09:36:04Z")

</div>

Effectively what you need to do is pass a Refresh request over to the UI thread. In with Forms components (and ActiveX controls are effectively wrapped in forms components) this is done either through the `Invoke` or `BeginInvoke` method. Which one you choose depends on whether you want to wait for the processing to be finished (`Invoke`) - which I guess is not what you’re after - or whether you prefer to trigger the UI processing now and (potentially) synchronize later (`BeginInvoke` and `EndInvoke`). If you use anonymous delegates the syntax is as simple as it is straightforward:

```auto
myDisplay.BeginInvoke((MethodInvoker)delegate () { myDisplay.Refresh(); });

```

---

<div class="post-metadata">

**Author:** ![Greg](https://avatars.discourse-cdn.com/v4/letter/g/71c47a/32.png) [@Greg](https://forum.commonvisionblox.com/u/Greg)\
**Post date:** [June 28, 2018, 6:51am UTC](https://forum.commonvisionblox.com/t/whats-the-best-way-to-refresh-multiple-cvb-displays-in-c-in-a-multithread-acquisition-application/482/3 "2018-06-28T06:51:18Z")

</div>

Tnx a lot,

I will give it a try.  
cheers
