Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations dencom on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

odd mousepointer behavior with MSChart 1

Status
Not open for further replies.

norason

Programmer
Jan 28, 2009
139
US
I have a problem with MSChart and mouse pointer control. I have a button that creates a chart. When I click the button, I can cause an hourglass to appear while I build the chart. When I'm done building the chart, I can make the pointer revert to normal arrow as long as I don't move the mouse over the chart area. But, if I move the mouse over the chart area while I'm building the chart, the mouse will not revert back to the normal arrow. I have to move the mouse slightly, then it shows the arrow. Here's where I call DrawTheGraph which basically causes MSChart1 to get all the info it needs to draw the graph. While I'm drawing the graph, the mouse shows the hourglass anywhere on the screen, but when the program gets back here, it doesn't show the arrow if I leave the mouse on the chart. I watched the value of .MousePointer, and it shows 1, but the mouse shows the hourglass - until I move it.

What am I missing?

Thanks,

Gary


Call DrawTheGraph
With MSChart1
.MousePointer = VtMousePointerArrow
End With
Screen.MousePointer = vbArrow
End Sub
 
It seems to be specific to MSChart, and I've tried several conventional ways of forcing the mousepointer to refresh but none of them seem to work.

The only solution I've found is to force the mousepointer to move slightly:

Code:
Dim cp As pointApi
  
A& = GetCursorPos(cp)
SetCursorPos cp.x + 1, cp.y
SetCursorPos cp.x, cp.y

- Andy
___________________________________________________________________
If you think nobody cares you're alive, try missing a couple of mortgage payments
 
AndyGroom,

That was my conclusion too. I solved it by forcing the mousepointer back to the command button that calls the chart. I like your solution better.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top