Cyber Axe Posted January 16, 2010 Share Posted January 16, 2010 (edited) I'm using Visual C++ 2008 and am trying to create a context menu when clicking on a button, i have managed to get the context menu to show when the button is clicked however it appears offset to the window the same amount that the window is form the top left of the screen.I'm going to be reusing the code for various other buttons so do not want to use any button specific names in the code. i know i can get it appearing where i want it if i could subtract the values of this->Location from this->MousePosition but have been unable to get the specific X and Y values from them , and cannot find any decent info on Point's so i can convert them to integers.private: System::Void button_Click(System::Object^ sender, System::EventArgs^ e) { contextMenuPCOptions->Show(this, this->MousePosition);}Any Help would be appreciated, thanks. Edited January 16, 2010 by Cyber Axe Link to comment Share on other sites More sharing options...
Cyber Axe Posted January 17, 2010 Author Share Posted January 17, 2010 I managed to figure out how to get the X and Y values though i now have the problem of that it seems to be offset to the curser the same amount as the width of the window border and the height of the window top border Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now