3

I have a GMap.NET control on my main form, and then I have a second form that will show when the user clicks on a button. The problem is, that when the user leaves the second window and hovers over the GMap control from the main form, the main form comes to the front. This does not happen when i hover over the rest of the main window with the second window on the front. Also I have another form that will show while the program searches for some data, and this one will also disappear when the user hovers over the map.

I hope I explained it well enough, basically when I hover over the map the main window comes to the front. And it does only happen when there is another form of my project in front of it, not when there is any other window like firefox or something in the front.

So my question is: why does this happen and can I change this behavior? Is it a standard of the GMap.NET control? I am using the Version 1.7.0.0 control btw.

4

2 回答 2

12

你必须使用

GMap1.DisableFocusOnMouseEnter = true;

我将此代码添加到我的程序中并解决了问题。

于 2015-11-30T18:25:44.703 回答
3

查看有关如何显示表单的一些代码会有所帮助,但听起来您正在执行诸如 secondwindow.Show() 而不是 secondwindow.ShowDialog() 之类的操作,然后来自 GMap 的 OnEnter 事件正在执行 Focus ()。

然后,当您在它前面有“其他表单”时,它会以一种限制访问父表单的方式打开(ShowDialog() 等)。

于 2014-09-10T14:19:36.770 回答