.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to get screen coordinate related to main form

0 REPLIES 0
Reply
Message 1 of 1
silent_joe
129 Views, 0 Replies

How to get screen coordinate related to main form

I want to get the red point position in screen related to the yellow point which is the main window position in screen. Then i can show a form  in that red position .Can anyone help me? 

silent_joe_0-1657783431095.png

int nCurVport = System.Convert.ToInt32(Autodesk.AutoCAD.ApplicationServices.Application.GetSystemVariable("CVPORT"));
var acView = editor.GetCurrentView();
Point2d pCenter = acView.CenterPoint;
Point3d leftTop = new Point3d(pCenter.X - (acView.Width / 2), (acView.Height / 2) + pCenter.Y, 0);
System.Windows.Point screen_LeftTop = editor.PointToScreen(leftTop, nCurVport);
MessageBox.Show(screen_LeftTop.ToString());//this shows the red point is (0,0), but is not what i want

0 REPLIES 0

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

AutoCAD Inside the Factory


Autodesk Design & Make Report