.NET

.NET

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

Where Dialog Boxes Showes up on Screen

198 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,064
Registered: ‎04-27-2009
Message 2 of 4 (189 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: 707
Registered: ‎01-24-2003
Message 3 of 4 (183 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 (170 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)
Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Do you have 60 seconds to spare? The Autodesk Community Team is revamping our site ranking system and we want your feedback! Please click here to launch the 5 question survey. As always your input is greatly appreciated.