JOHNLOGIC

I always get zero for X and Y. Anyone know why

Private Sub NotifyIcon1_MouseUp(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles NotifyIcon1.MouseUp

NotifyIcon1.Text = e.X & vbCrLf & e.Y

End Sub



Re: Visual Basic Express Edition NotifyIcon mouse position always zero?

nobugz

Yes, the NotifyIcon Windows message handler fires any of the mouse events with the mouse position hard-coded to 0,0. Educated guess as to why: it gets the mouse coordinates relative from the Tray window. Since the shell doesn't let you find out where the icon is located in the tray, Windows Forms can't calculate the mouse position relative from the icon's upper left corner.





Re: Visual Basic Express Edition NotifyIcon mouse position always zero?

JOHNLOGIC

Thank you nobugz and thank you M$ for wasting my time with something that doesn't work. How about fix it, remove it or document the fact that it doesn't work



Re: Visual Basic Express Edition NotifyIcon mouse position always zero?

nobugz

An excellent way to blow of steam like this is to report this at Product Feedback. They can't fix it but at least somebody else would find your insight very valuable.