bart Posted July 31, 2003 Posted July 31, 2003 Hi. My problem is that for the purposes of displaying a customized context menu for an ActiveX control - I need the abosulte coordinates of the user control that the ActiveX control resides. Using the coordinates from the ActiveX's event args properties does not work because when the ActiveX control is scrolled down, the coordinates it returns are further down the screen than they actually should be - so the context menu is being shown down at the bottom of the screen. I can get the coordinates of the mouse after clicking by using the Cursor.Position, but I need the position of the screen control relative to the top of the screen so that I can work out where to place the menu (it needs coordinates relative to the top corner of the control). Any ideas? Bart Quote
*Gurus* divil Posted July 31, 2003 *Gurus* Posted July 31, 2003 To translate client coordinates in to screen coordinates you use the PointToScreen method of the control in question. All controls support this method. Quote MVP, Visual Developer - .NET Now you see why evil will always triumph - because good is dumb. My free .NET Windows Forms Controls and Articles
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.