2 Attachment(s)
Displaying Mouse co-ordinates in an edit box
I'm working on a dialog based MFC. I have used a Picture Box Control to draw a rectangle and written the code for drawing in the picture box using a sperate class inherited from CStatic (Pict Class). I wish to capture the mouse co-ordinates as it moves inside the Picture box(only) and display the co-ordintaes to the user on the Dialog screen using an edit box. i have handled the onMouseMove function to get the co-ordinates. But i'm facing the difficulty to display it to the user. Can somebody please help me out in this. I want the edit to display the refreshed co-ordinates as soon as the mouse moves inside the Picture Box. I'm attaching the PictureCtrlDlg.cpp and the Pict.cpp file for refrence.
Re: Displaying Mouse co-ordinates in an edit box
With the approach you have started, ou need to get the mouse coordinates from the CPoint that's passed into OnMouseMove, format them into m_value, then call UpdateData.
I'd go for a CStatic rather than a CEdit.
Re: Displaying Mouse co-ordinates in an edit box
Apart from above suggestion .Why not put a tooltip on Mouse pointer itself . Instead of using any third control .
Thanks