I have a custom button on an Excel toolbar that displays my Userform. In the Initialize event, I want to set the form’s Left & Top property so that the form starts up close to the mouse pointer.
Currently, I am using the GetCursorPos API, using the X & Y as Left & Top. This is OK when my application is in the upper-left corner of the screen, but as I move accross/down the screen, the GetCursorPos values that I am using for Left & Top are too big by about 30%.
So, for now, I just subtract 30% & it is close, but I would like to know how to properly convert and why? Points, pixels, TIA –Sam