开发者

C# ToolTip blocking execution?

开发者 https://www.devze.com 2023-04-12 17:02 出处:网络
I have no clue how to ask this question but this is a last ditch effort as I am stumped. I have this bit of c# code that will send off to a server (using JSON) a request to draw a wms layer to a map.

I have no clue how to ask this question but this is a last ditch effort as I am stumped.

I have this bit of c# code that will send off to a server (using JSON) a request to draw a wms layer to a map. That server goes and does its duty and bam the wms layer appears on the map.

IN this bit of code I sometimes wanna output the times they are clicking on to render this map (its a timeline based render), so using a UserControl in c# that contains a picture box, I render this timeline and then put up a tooltip that shows the various times as the mouse moves along this pictureBox.

The Tooltip is defined as globally:

ToolTip myToolTip;

Then when I use it in my bit of code:

  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);
    }

So when the scenario above happens, the map doesn't render until i move the mouse off the userControl that has the picturebox on it.

BUT if i take out the myToolTip.show in the MouseMove then minute I click the map renders (i realize it could have lo开发者_StackOverflow中文版ts to do with the WMS server I am hitting etc etc, but it leads me to believe it is something with the tooltips, since removing it makes things work well enough that the map renders without having to move my mouse off the picturebox control).

So I realize this is a vague, hazy question but I am stuck and just throwing this out there for any ideas. Maybe there is something more to the tooltips I don't understand or I need a different approach that does not use the tool tips?

I should also state that the prisms.Call server does get executed (using breakpoint figured this out) even with tool tip there so not sure what is going on.


You could always hide the tooltip (if its showing) while you run the WMS call, then resume showing the tooltip.

I do not have any tooltip-specific knowledge.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号