我不知道如何提出这个问题,但这是最后一次努力,因为我很难过。C#工具提示阻止执行?
我有这一点的C#代码,将发送到服务器(使用JSON)的请求,以绘制一个WMS图层到地图。该服务器将执行并完成其任务,并且bms wms图层将出现在地图上。
在这段代码中,我有时想输出他们点击的时间来渲染这张地图(它是一个基于时间轴的渲染),所以在c#中使用包含图片框的UserControl,我渲染这个时间轴,提供一个工具提示,当鼠标沿着这个图片框移动时显示不同的时间。
工具提示被定义为全球:
ToolTip myToolTip;
后来,当我使用它在我的代码位:
private void pictureBox1_MouseClick(object sender, MouseEventArgs e)
{
//...blah blah blah stuff to calculate time where user clicked based on width of timeline drawn in the picturebox etc.
prisms.callServer("Timetable", "setSelection", selection, null); //call to server to tell it to render the map at the time defined by selection
}
private void pictureBox1_MouseMove(object sender, MouseEventArgs e)
{
//...blah blah..code to calculate mTheDate showing what the time is where they are where they are hovering
myToolTip.Show(mTheDate, this, toolTipX, toolTipY, 100);
}
所以,当上面的情况发生时,地图不渲染直到我将鼠标从其上具有图片框的userControl移开。
但是,如果我拿出MouseMove中的myToolTip.show,那么我点击地图呈现(我意识到它可能与我打的等WMS服务器有很多关系,但它让我相信它是与工具提示的东西,因为删除它使事情足够好,地图渲染,而不必移动我的鼠标从图片框控制)。
所以我意识到这是一个模糊,朦胧的问题,但我卡住了,只是抛出了任何想法。也许有更多的东西给我不明白的工具提示,或者我需要一个不使用工具提示的不同方法?
我也应该说prisms.Call服务器确实得到执行(使用断点解决了这一点)即使使用工具提示,所以不知道发生了什么。