.NET

Reply
Distinguished Contributor
VB_Autocad_guy
Posts: 136
Registered: ‎07-24-2009
Message 1 of 4 (186 Views)
Accepted Solution

Where Dialog Boxes Showes up on Screen

186 Views, 3 Replies
06-28-2012 11:32 AM

Can you modify where a dialog box shows up on screen? 

Autodesk.AutoCAD.ApplicationServices.Application.ShowModalWindow(myWindow);

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".

*Expert Elite*
norman.yuan
Posts: 1,002
Registered: ‎04-27-2009
Message 2 of 4 (177 Views)

Re: Where Dialog Boxes Showes up on Screen

06-28-2012 12:53 PM in reply to: VB_Autocad_guy

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".

Distinguished Contributor
eljobe
Posts: 704
Registered: ‎01-24-2003
Message 3 of 4 (171 Views)

Re: Where Dialog Boxes Showes up on Screen

06-28-2012 01:49 PM in reply to: 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.

Distinguished Contributor
VB_Autocad_guy
Posts: 136
Registered: ‎07-24-2009
Message 4 of 4 (158 Views)

Re: Where Dialog Boxes Showes up on Screen

06-28-2012 02:25 PM in reply to: norman.yuan

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)
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.