Can you modify where a dialog box shows up on screen?
Autodesk.AutoCAD.ApplicationServices.Application.ShowModalWindow(myWindow);
Solved! Go to Solution.
Solved by norman.yuan. Go to Solution.
With the form/dialog box being Windows Form, yes, you can set location where it show by setting the form's StartPosition to "Manual", and then use code to set the Posistion before the form is shown.
But I never used WPF form (probably I'd never use this dead/dying technology in production, stick with Windows Form seems a safer choice), but it may work the same way, because a WPF window also has a property "WindowStartUpLocation" that can be set to "Manual".
Norman Yuan
Also, when you use the ShowModalDialog method, the default is center. After that acad remembers where the size and location the user last specified. So, if you set it manually, you will be overriding the user's settings. If you decide to do this, you can set the form's properties before you call the show method.
Okay so this worked.
DimLineFormAsNew frmLineDsgn
LineForm.Left=System.Windows.Forms.Screen.PrimaryScreen.Bounds.Left+5
LineForm.Top=System.Windows.Forms.Screen.PrimaryScreen.Bounds.Top+5
Application.ShowModalDialog(LineForm.Handle,LineForm,False)