.NET

.NET

Reply
Distinguished Contributor
136 Posts
5 Kudos
Registered: ‎07-24-2009
Post 1 of 4
Accepted Solution

Where Dialog Boxes Showes up on Screen

201 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*
1,088 Posts
217 Kudos
Registered: ‎04-27-2009
Post 2 of 4

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
716 Posts
4 Kudos
Registered: ‎01-24-2003
Post 3 of 4

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
136 Posts
5 Kudos
Registered: ‎07-24-2009
Post 4 of 4

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)
Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Are you interested in helping shape the future of the Autodesk Community? To participate in this brief usability study, please click here. Your time and input is greatly appreciated!