# Marker MouseHover Problem

**URL:** <https://community.thinkgeo.com/t/marker-mousehover-problem/2457>\
**Category:** WinForms\
**Created:** [October 7, 2014, 7:01am UTC](https://community.thinkgeo.com/t/marker-mousehover-problem/2457 "2014-10-07T07:01:57Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sam](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/s/5f9b8f/32.png) [@Sam](https://community.thinkgeo.com/u/Sam)\
**Post date:** [October 7, 2014, 7:01am UTC](https://community.thinkgeo.com/t/marker-mousehover-problem/2457/1 "2014-10-07T07:01:57Z")

</div>

Hi,  
  
  
  
Why&nbsp;does&nbsp;the&nbsp;marker.MouseHover&nbsp;method&nbsp;not&nbsp;fire?  
  
  
  
I&nbsp;assign&nbsp;an&nbsp;event&nbsp;listener:  
  
marker.MouseHover&nbsp;+=&nbsp;markerHover;  
  
  
  
But&nbsp;this&nbsp;does&nbsp;not&nbsp;fire?&nbsp;However,&nbsp;the&nbsp;MouseMove&nbsp;and&nbsp;Click&nbsp;events&nbsp;both&nbsp;fire&nbsp;for&nbsp;the&nbsp;Marker.&nbsp;My&nbsp;aim&nbsp;is&nbsp;to&nbsp;have&nbsp;a&nbsp;method&nbsp;that&nbsp;is&nbsp;executed&nbsp;on&nbsp;a&nbsp;hover&nbsp;of&nbsp;a&nbsp;marker,&nbsp;something&nbsp;similar&nbsp;to&nbsp;how&nbsp;marker.ToolTipText&nbsp;works.  
  
  
  
Any&nbsp;help&nbsp;on&nbsp;why&nbsp;this&nbsp;is&nbsp;the&nbsp;case&nbsp;would&nbsp;be&nbsp;great.  
  
  
  
Regards,  
  
  
  
Sam

---

<div class="post-metadata">

**Author:** ![Sam](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/s/5f9b8f/32.png) [@Sam](https://community.thinkgeo.com/u/Sam)\
**Post date:** [October 7, 2014, 7:19am UTC](https://community.thinkgeo.com/t/marker-mousehover-problem/2457/2 "2014-10-07T07:19:06Z")

</div>

\*\*&nbsp;It&nbsp;works&nbsp;for&nbsp;the&nbsp;Click&nbsp;event&nbsp;and&nbsp;MouseMoveEvent,&nbsp;not&nbsp;MouseMove.

---

<div class="post-metadata">

**Author:** ![Ethan](https://community.thinkgeo.com/user_avatar/community.thinkgeo.com/ethan/32/19964_2.png) [@Ethan](https://community.thinkgeo.com/u/Ethan)\
**Post date:** [October 7, 2014, 10:09pm UTC](https://community.thinkgeo.com/t/marker-mousehover-problem/2457/3 "2014-10-07T22:09:24Z")

</div>

Hi&nbsp;Sam,&nbsp;  
&nbsp;&nbsp;  
&nbsp;Does&nbsp;that&nbsp;because&nbsp;the&nbsp;event&nbsp;stopped&nbsp;by&nbsp;some&nbsp;other&nbsp;control&nbsp;in&nbsp;the&nbsp;top&nbsp;of&nbsp;mark?&nbsp;  
&nbsp;&nbsp;  
&nbsp;Could&nbsp;you&nbsp;please&nbsp;paste&nbsp;more&nbsp;detail&nbsp;code&nbsp;include&nbsp;how&nbsp;you&nbsp;add&nbsp;the&nbsp;mark&nbsp;to&nbsp;map&nbsp;and&nbsp;whether&nbsp;map&nbsp;contains&nbsp;other&nbsp;layers?&nbsp;  
&nbsp;&nbsp;  
&nbsp;And&nbsp;I&nbsp;want&nbsp;to&nbsp;know&nbsp;your&nbsp;detail&nbsp;dll&nbsp;version.&nbsp;  
&nbsp;&nbsp;  
&nbsp;That’s&nbsp;helpful&nbsp;for&nbsp;us&nbsp;to&nbsp;reproduce&nbsp;that.&nbsp;  
&nbsp;&nbsp;  
&nbsp;Regards,&nbsp;  
&nbsp;&nbsp;  
&nbsp;Don

---

<div class="post-metadata">

**Author:** ![Sam](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/s/5f9b8f/32.png) [@Sam](https://community.thinkgeo.com/u/Sam)\
**Post date:** [October 8, 2014, 3:06am UTC](https://community.thinkgeo.com/t/marker-mousehover-problem/2457/4 "2014-10-08T03:06:40Z")

</div>

There&nbsp;is&nbsp;no&nbsp;other&nbsp;control&nbsp;on-top&nbsp;of&nbsp;mark.  
  
  
  
I&nbsp;add&nbsp;the&nbsp;Markers&nbsp;from&nbsp;a&nbsp;collection&nbsp;of&nbsp;features.&nbsp;

> `Marker marker = ``new`&nbsp;`Marker(feature.GetShape().GetCenterPoint());`  
> `marker.Image = Image.FromFile(@``"…"``);`  
> `marker.MouseMoveEvent += markerMove;`  
> `marker.ToolTipText = setMarkerText(feature);`  
> `marker.Width = 32;`  
> `marker.Height = 32;`  
> `marker.YOffset = -17;`  
> ` `&nbsp;  
> `markerOverlay.Markers.Add(marker);`

  
  
  
  
  
Yes&nbsp;the&nbsp;map&nbsp;does&nbsp;contain&nbsp;other&nbsp;layers:&nbsp;Shapefile&nbsp;Feature&nbsp;Layer,&nbsp;Feature&nbsp;Layer&nbsp;and&nbsp;an&nbsp;InMemoryFeatureLayer.  
  
  
  
The&nbsp;dll&nbsp;version&nbsp;is&nbsp;8.0.0.110.  
  
  
  
Any&nbsp;help&nbsp;on&nbsp;this&nbsp;would&nbsp;be&nbsp;great.  
  
  
  
Regards,  
  
  
  
Sam

---

<div class="post-metadata">

**Author:** ![Ethan](https://community.thinkgeo.com/user_avatar/community.thinkgeo.com/ethan/32/19964_2.png) [@Ethan](https://community.thinkgeo.com/u/Ethan)\
**Post date:** [October 9, 2014, 5:28am UTC](https://community.thinkgeo.com/t/marker-mousehover-problem/2457/5 "2014-10-09T05:28:16Z")

</div>

Hi&nbsp;Sam,&nbsp;  
  
  
  
Thanks&nbsp;for&nbsp;your&nbsp;code.&nbsp;  
  
  
  
I&nbsp;found&nbsp;in&nbsp;fact&nbsp;we&nbsp;haven’t&nbsp;implemented&nbsp;special&nbsp;mouse&nbsp;hover&nbsp;event&nbsp;for&nbsp;marker&nbsp;object,&nbsp;so&nbsp;that&nbsp;event&nbsp;is&nbsp;hard&nbsp;to&nbsp;be&nbsp;fired(in&nbsp;your&nbsp;sample,&nbsp;it&nbsp;can&nbsp;be&nbsp;fired&nbsp;when&nbsp;you&nbsp;move&nbsp;mouse&nbsp;to&nbsp;a&nbsp;position&nbsp;in&nbsp;the&nbsp;right&nbsp;side&nbsp;of&nbsp;your&nbsp;marker.)&nbsp;  
  
  
  
Here&nbsp;is&nbsp;the&nbsp;solution&nbsp;for&nbsp;your&nbsp;requirement:  
  
  
  
1.&nbsp;Inherit&nbsp;from&nbsp;Marker&nbsp;class.  
  
2.&nbsp;Create&nbsp;your&nbsp;MouseHoverEvent&nbsp;in&nbsp;your&nbsp;new&nbsp;class.  
  
3.&nbsp;Pass&nbsp;your&nbsp;new&nbsp;markers&nbsp;into&nbsp;SimpleMarkerOverlay&nbsp;when&nbsp;you&nbsp;create&nbsp;it.  
  
  
  
Here&nbsp;is&nbsp;some&nbsp;important&nbsp;code&nbsp;for&nbsp;implement&nbsp;your&nbsp;class:  
  
  
  
public&nbsp;event&nbsp;EventHandler\<EventArgs\>&nbsp;MouseHoverEvent;  
  
  
  
this.ControlAdded&nbsp;+=&nbsp;new&nbsp;ControlEventHandler(Marker\_ControlAdded);  
  
  
  
&nbsp;void&nbsp;Marker\_ControlAdded(object&nbsp;sender,&nbsp;ControlEventArgs&nbsp;e)  
&nbsp;{  
  
e.Control.MouseHover&nbsp;+=&nbsp;new&nbsp;EventHandler(MarkerControl\_MouseHover);  
  
}  
  
  
  
&nbsp;void&nbsp;MarkerControl\_MouseHover(object&nbsp;sender,&nbsp;EventArgs&nbsp;e)  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(MouseHoverEvent&nbsp;!=&nbsp;null)  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;MouseHoverEvent(this,&nbsp;e);  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}  
  
  
Wish&nbsp;it’s&nbsp;helpful.  
  
  
  
  
Please&nbsp;let&nbsp;me&nbsp;know&nbsp;if&nbsp;you&nbsp;have&nbsp;any&nbsp;question.  
  
  
  
Regards,&nbsp;  
  
  
  
Don

---

<div class="post-metadata">

**Author:** ![Sam](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/s/5f9b8f/32.png) [@Sam](https://community.thinkgeo.com/u/Sam)\
**Post date:** [October 9, 2014, 5:51am UTC](https://community.thinkgeo.com/t/marker-mousehover-problem/2457/6 "2014-10-09T05:51:55Z")

</div>

Hi&nbsp;Don,  
  
  
  
Thank&nbsp;you&nbsp;for&nbsp;that.&nbsp;I&nbsp;will&nbsp;try&nbsp;it&nbsp;and&nbsp;get&nbsp;back&nbsp;to&nbsp;you&nbsp;with&nbsp;the&nbsp;result.  
  
  
  
Regards,  
  
  
  
Sam.

---

<div class="post-metadata">

**Author:** ![Ethan](https://community.thinkgeo.com/user_avatar/community.thinkgeo.com/ethan/32/19964_2.png) [@Ethan](https://community.thinkgeo.com/u/Ethan)\
**Post date:** [October 10, 2014, 1:05am UTC](https://community.thinkgeo.com/t/marker-mousehover-problem/2457/7 "2014-10-10T01:05:33Z")

</div>

Hi&nbsp;Sam,&nbsp;  
&nbsp;&nbsp;  
&nbsp;I&nbsp;am&nbsp;waiting&nbsp;for&nbsp;your&nbsp;good&nbsp;news&nbsp;on&nbsp;it.&nbsp;  
&nbsp;&nbsp;  
&nbsp;Any&nbsp;question&nbsp;please&nbsp;let&nbsp;us&nbsp;know.&nbsp;  
&nbsp;&nbsp;  
&nbsp;Regards,&nbsp;  
&nbsp;&nbsp;  
&nbsp;Don

---

<div class="post-metadata">

**Author:** ![Sam](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/s/5f9b8f/32.png) [@Sam](https://community.thinkgeo.com/u/Sam)\
**Post date:** [October 23, 2014, 6:00am UTC](https://community.thinkgeo.com/t/marker-mousehover-problem/2457/8 "2014-10-23T06:00:43Z")

</div>

Hi&nbsp;Don,  
  
  
  
The&nbsp;solution&nbsp;you&nbsp;gave&nbsp;works&nbsp;really&nbsp;well.&nbsp;I&nbsp;do&nbsp;have&nbsp;a&nbsp;question&nbsp;though.  
  
  
  
Currently,&nbsp;the&nbsp;event&nbsp;is&nbsp;fired&nbsp;very&nbsp;quickly,&nbsp;i.e.&nbsp;almost&nbsp;immediately.&nbsp;Is&nbsp;there&nbsp;any&nbsp;way&nbsp;we&nbsp;can&nbsp;alter&nbsp;this&nbsp;to&nbsp;happen&nbsp;after&nbsp;a&nbsp;similar&nbsp;time&nbsp;to&nbsp;the&nbsp;Marker’s&nbsp;tool-tip?&nbsp;So&nbsp;the&nbsp;event&nbsp;becomes&nbsp;a&nbsp;true&nbsp;hover.  
  
  
  
Any&nbsp;help&nbsp;on&nbsp;this&nbsp;would&nbsp;be&nbsp;great.  
  
  
  
Kind&nbsp;Regards,  
  
  
  
Sam

---

<div class="post-metadata">

**Author:** ![Ethan](https://community.thinkgeo.com/user_avatar/community.thinkgeo.com/ethan/32/19964_2.png) [@Ethan](https://community.thinkgeo.com/u/Ethan)\
**Post date:** [October 24, 2014, 3:57am UTC](https://community.thinkgeo.com/t/marker-mousehover-problem/2457/9 "2014-10-24T03:57:36Z")

</div>

Hi&nbsp;Sam,&nbsp;  
&nbsp;&nbsp;  
&nbsp;I&nbsp;think&nbsp;maybe&nbsp;we&nbsp;cannot&nbsp;control&nbsp;this.&nbsp;  
&nbsp;&nbsp;  
&nbsp;The&nbsp;MarkerControl\_MouseHover&nbsp;is&nbsp;fired&nbsp;by&nbsp;system&nbsp;control&nbsp;and&nbsp;it&nbsp;looks&nbsp;the&nbsp;Mouse&nbsp;Hover&nbsp;time&nbsp;is&nbsp;a&nbsp;system&nbsp;static&nbsp;setting.&nbsp;I&nbsp;think&nbsp;we&nbsp;should&nbsp;can&nbsp;read&nbsp;it&nbsp;but&nbsp;cannot&nbsp;modify&nbsp;it&nbsp;in&nbsp;code.&nbsp;  
&nbsp;&nbsp;  
&nbsp;For&nbsp;my&nbsp;machine,&nbsp;the&nbsp;default&nbsp;value&nbsp;looks&nbsp;is&nbsp;20ms,&nbsp;I&nbsp;think&nbsp;I&nbsp;can&nbsp;only&nbsp;modify&nbsp;it&nbsp;via&nbsp;Registry&nbsp;Editor.&nbsp;  
&nbsp;&nbsp;  
&nbsp;So&nbsp;maybe&nbsp;you&nbsp;want&nbsp;to&nbsp;Google&nbsp;it&nbsp;for&nbsp;more&nbsp;information,&nbsp;I&nbsp;am&nbsp;not&nbsp;sure&nbsp;whether&nbsp;there&nbsp;is&nbsp;any&nbsp;workaround&nbsp;about&nbsp;it.&nbsp;  
&nbsp;&nbsp;  
&nbsp;Regards,&nbsp;  
&nbsp;&nbsp;  
&nbsp;Don
