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

Where Dialog Boxes Showes up on Screen

3 REPLIES 3
SOLVED
Reply
Message 1 of 4
VB_Autocad_guy
453 Views, 3 Replies

Where Dialog Boxes Showes up on Screen

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

Autodesk.AutoCAD.ApplicationServices.Application.ShowModalWindow(myWindow);
3 REPLIES 3
Message 2 of 4

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

Message 3 of 4
Ed.Jobe
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.

Ed

EESignature

Message 4 of 4

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)

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

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost