# \[WPF\] MapWinGIS is above everything

**URL:** <https://mapwindow.discourse.group/t/wpf-mapwingis-is-above-everything/670>\
**Category:** MapWinGIS\
**Created:** [July 26, 2020, 1:58pm UTC](https://mapwindow.discourse.group/t/wpf-mapwingis-is-above-everything/670 "2020-07-26T13:58:23Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ZeroByter](https://avatars.discourse-cdn.com/v4/letter/z/ccd318/32.png) [@ZeroByter](https://mapwindow.discourse.group/u/ZeroByter)\
**Post date:** [July 26, 2020, 1:58pm UTC](https://mapwindow.discourse.group/t/wpf-mapwingis-is-above-everything/670/1 "2020-07-26T13:58:23Z")

</div>

I’m designing the UI for where the MapWinGIS will appear in my project and I am trying to place buttons/controls over the MapWinGIS but it’s not working.

In fact, nothing can be placed over the MapWinGIS. I tried:

- Right clicking and pressing ‘Bring to Front’ or ‘Send to Back’ on the respective controls
- Messing with Panel.ZIndex
- Changing the order of the controls in the XAML
- Tried calling `map.SendToBack` on the `AxMap` variable upon creation

Anyone has any idea on how to achieve this?

---

<div class="post-metadata">

**Author:** ![ZeroByter](https://avatars.discourse-cdn.com/v4/letter/z/ccd318/32.png) [@ZeroByter](https://mapwindow.discourse.group/u/ZeroByter)\
**Post date:** [July 26, 2020, 2:03pm UTC](https://mapwindow.discourse.group/t/wpf-mapwingis-is-above-everything/670/2 "2020-07-26T14:03:48Z")

</div>

I thought about maybe calling `map.SendToBack()` a bit after everything has loaded so for testing purposes I tried adding the MouseMove event for either:

- the control itself (I made a custom user control to host the WindowsFormsHost/AxMap)
- the WindowsFormsHost itself
- the map itself

but the event never fires. Weird.

---

<div class="post-metadata">

**Author:** ![ZeroByter](https://avatars.discourse-cdn.com/v4/letter/z/ccd318/32.png) [@ZeroByter](https://mapwindow.discourse.group/u/ZeroByter)\
**Post date:** [July 26, 2020, 2:15pm UTC](https://mapwindow.discourse.group/t/wpf-mapwingis-is-above-everything/670/3 "2020-07-26T14:15:30Z")

</div>

Actually need a mod to delete or flag this or something.

Turns out there is nothing wrong with MapWinGIS, my bad, the problem is with WindowsFormsHost.

> <https://stackoverflow.com/questions/9920480/windowsformshost-is-always-the-most-top-from-wpf-element>

> <https://stackoverflow.com/questions/8006092/controls-dont-show-over-winforms-host>

There is no current fix.

---

<div class="post-metadata">

**Author:** ![pmeems](https://yyz2.discourse-cdn.com/free1/user_avatar/mapwindow.discourse.group/pmeems/32/9_2.png) [@pmeems](https://mapwindow.discourse.group/u/pmeems)\
**Post date:** [January 5, 2022, 3:09pm UTC](https://mapwindow.discourse.group/t/wpf-mapwingis-is-above-everything/670/4 "2022-01-05T15:09:06Z")

</div>


