# Display and WPF

**URL:** <https://forum.commonvisionblox.com/t/display-and-wpf/552>\
**Category:** Programming Questions\
**Tags:** display, activex, wpf\
**Created:** [September 14, 2018, 9:45am UTC](https://forum.commonvisionblox.com/t/display-and-wpf/552 "2018-09-14T09:45:36Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mikael](https://avatars.discourse-cdn.com/v4/letter/m/f04885/32.png) [@Mikael](https://forum.commonvisionblox.com/u/Mikael)\
**Post date:** [September 14, 2018, 9:45am UTC](https://forum.commonvisionblox.com/t/display-and-wpf/552/1 "2018-09-14T09:45:36Z")

</div>

Hello,  
I am using a WPF application with a display OCX.  
I’ve added a in a grid:

```auto
        <WindowsFormsHost>
            <local:CvbDisplay x:Name="cvDisplay" BackColor="Window"/>
        </WindowsFormsHost>
        <Button Content="Test" Height="50" Width="50"/>

```

When I do that, it is impossible with WPF to see a button (in execution mode) that has been added on the dispay (in the xaml code).

I have seen in C:\Windows\[Microsoft.NET](http://Microsoft.NET)\assembly\GAC\_MSIL\Stemmer.Cvb.Wpf\v4.0\_1.8.0.0\_\_865233c490b278f9\Stemmer.Cvb.Wpf.dll that stemmer a desinged a WPF display control that corrects that effect.

My problem is that we have done a c++ OCX edxDisplay based on “CCVdisplay m\_Display;” (it interceps also events from cvdisplay). That OCX has its own overlays management adapted to our use.  
So we have the same problem with edxdisplay.ocx that there is with cvdisplay.ocx: impossible with WPF to see a button placed on the display.

My question are: if a specific display for WPF designed in Stemmer.Cvb.Wpf.dll solves that effects. How have you done to implement cvdisplay.ocx in Stemmer.Cvb.Wpf.dll to solve the problem? Do you have details?  
I will need to do the same with my edxdisplay.ocx (based on cvdisplay).

Thanks in advance,  
Best regards,  
Mikael Person

---

<div class="post-metadata">

**Author:** ![parsd](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.commonvisionblox.com/parsd/32/7_2.png) [@parsd](https://forum.commonvisionblox.com/u/parsd)\
**Post date:** [September 14, 2018, 12:45pm UTC](https://forum.commonvisionblox.com/t/display-and-wpf/552/2 "2018-09-14T12:45:47Z")

</div>

Hello @Mikael,

what you see is called airspace problem. WPF doesn’t use `HWND`s for its controls but does its own rendering. If you add an ActiveX control, this is placed in an `HWND` resulting in a ‘hole’ in the WPF window (not just the current control). For in-depth information see the Microsoft article:

> [https://docs.microsoft.com/en-us/previous-versions/dotnet/netframework-3.5/aa970688(v=vs.90)](https://docs.microsoft.com/en-us/previous-versions/dotnet/netframework-3.5/aa970688(v=vs.90))

And yes, this is the reason why we wrote our own :cvb: WPF Display.

---

<div class="post-metadata">

**Author:** ![parsd](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.commonvisionblox.com/parsd/32/7_2.png) [@parsd](https://forum.commonvisionblox.com/u/parsd)\
**Post date:** [September 14, 2018, 12:56pm UTC](https://forum.commonvisionblox.com/t/display-and-wpf/552/3 "2018-09-14T12:56:54Z")

</div>

Also to be clear(er): this is not a _Display.dll_/_.ocx_ wrapper, but a pure WPF implementation displaying our `Image` objects (object oriented wrappers):

> [https://forum.commonvisionblox.com/t/getting-started-with-cvb-net/](https://forum.commonvisionblox.com/t/getting-started-with-cvb-net/)

---

<div class="post-metadata">

**Author:** ![Mikael](https://avatars.discourse-cdn.com/v4/letter/m/f04885/32.png) [@Mikael](https://forum.commonvisionblox.com/u/Mikael)\
**Post date:** [September 14, 2018, 1:12pm UTC](https://forum.commonvisionblox.com/t/display-and-wpf/552/4 "2018-09-14T13:12:27Z")

</div>

OK. Thanks for you support.  
Mikael.
