<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: ShowModalDialog question..... in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/showmodaldialog-question/m-p/1744223#M80671</link>
    <description>The reason is because AutoCAD manages the size/location&lt;BR /&gt;
of your window for you, persists it in the registry, and then&lt;BR /&gt;
restores it when you show the same form again, keyed to&lt;BR /&gt;
the string returned by GetType().FullName on your form.&lt;BR /&gt;
&lt;BR /&gt;
The ShowModalDialog() method is overloaded. Call the one&lt;BR /&gt;
that takes the optional bool parameter, and pass false to&lt;BR /&gt;
prevent it from persisting your forms size/position.&lt;BR /&gt;
&lt;BR /&gt;
-- &lt;BR /&gt;
http://www.caddzone.com&lt;BR /&gt;
&lt;BR /&gt;
AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005/2006/2007&lt;BR /&gt;
http://www.acadxtabs.com&lt;BR /&gt;
&lt;BR /&gt;
&lt;NATALIE-C&gt; wrote in message news:5304050@discussion.autodesk.com...&lt;BR /&gt;
That doesn't seem to work?&lt;BR /&gt;
&lt;BR /&gt;
This is my code:&lt;BR /&gt;
&lt;BR /&gt;
Dim legendFormAs Legend1 = New Legend1()&lt;BR /&gt;
'----TRIED DIFFERENT THINGS HERE-----&lt;BR /&gt;
Application.ShowModalDialog(legendForm)&lt;BR /&gt;
&lt;BR /&gt;
Things that I've tried are:&lt;BR /&gt;
&lt;BR /&gt;
legendForm.CenterToScreen()&lt;BR /&gt;
&lt;BR /&gt;
legendForm.Left = Windows.Forms.Screen.PrimaryScreen.Bounds.Left+5&lt;BR /&gt;
legendForm.Top = Windows.Forms.Screen.PrimaryScreen.Bounds.Top+5&lt;BR /&gt;
&lt;BR /&gt;
legendForm.StartPosition = Windows.Forms.FormStartPosition.CenterScreen&lt;BR /&gt;
&lt;BR /&gt;
None of the above seem to effect the position of the form?&lt;/NATALIE-C&gt;</description>
    <pubDate>Wed, 23 Aug 2006 15:41:15 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2006-08-23T15:41:15Z</dc:date>
    <item>
      <title>ShowModalDialog question.....</title>
      <link>https://forums.autodesk.com/t5/net-forum/showmodaldialog-question/m-p/1744220#M80668</link>
      <description>Im using ShowModalDialog to open up my form.  Question, is it possible to specify the location you want the form to open?&lt;BR /&gt;
&lt;BR /&gt;
Thanks in advance for any help!!</description>
      <pubDate>Wed, 23 Aug 2006 13:43:57 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/showmodaldialog-question/m-p/1744220#M80668</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2006-08-23T13:43:57Z</dc:date>
    </item>
    <item>
      <title>Re: ShowModalDialog question.....</title>
      <link>https://forums.autodesk.com/t5/net-forum/showmodaldialog-question/m-p/1744221#M80669</link>
      <description>This will place the dialog box at upper-left corner of the screen&lt;BR /&gt;
&lt;BR /&gt;
MyDialogBox dlg = new MyDialogBox()&lt;BR /&gt;
&lt;BR /&gt;
dlg.Left = Screen.PrimaryScreen.Bounds.Left + 50;&lt;BR /&gt;
&lt;BR /&gt;
dlg.Top = Screen.PrimaryScreen.Bounds.Top + 50&lt;BR /&gt;
&lt;BR /&gt;
if &lt;BR /&gt;
(Autodesk.AutoCad.ApplicationServices.Application.ShowModalDialog(dlg)==DialogResult.OK)&lt;BR /&gt;
&lt;BR /&gt;
{&lt;BR /&gt;
&lt;BR /&gt;
    //Do something when dialog dismissed, if you wish&lt;BR /&gt;
&lt;BR /&gt;
}&lt;BR /&gt;
&lt;BR /&gt;
dlg.Dispose();&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;NATALIE-C&gt; wrote in message news:5303932@discussion.autodesk.com...&lt;BR /&gt;
Im using ShowModalDialog to open up my form.  Question, is it possible to &lt;BR /&gt;
specify the location you want the form to open?&lt;BR /&gt;
&lt;BR /&gt;
Thanks in advance for any help!!&lt;/NATALIE-C&gt;</description>
      <pubDate>Wed, 23 Aug 2006 14:05:27 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/showmodaldialog-question/m-p/1744221#M80669</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2006-08-23T14:05:27Z</dc:date>
    </item>
    <item>
      <title>Re: ShowModalDialog question.....</title>
      <link>https://forums.autodesk.com/t5/net-forum/showmodaldialog-question/m-p/1744222#M80670</link>
      <description>That doesn't seem to work?&lt;BR /&gt;
&lt;BR /&gt;
This is my code:&lt;BR /&gt;
&lt;BR /&gt;
Dim legendFormAs Legend1 = New Legend1()&lt;BR /&gt;
'----TRIED DIFFERENT THINGS HERE-----&lt;BR /&gt;
Application.ShowModalDialog(legendForm)&lt;BR /&gt;
&lt;BR /&gt;
Things that I've tried are:&lt;BR /&gt;
&lt;BR /&gt;
legendForm.CenterToScreen()&lt;BR /&gt;
&lt;BR /&gt;
legendForm.Left = Windows.Forms.Screen.PrimaryScreen.Bounds.Left+5&lt;BR /&gt;
legendForm.Top = Windows.Forms.Screen.PrimaryScreen.Bounds.Top+5&lt;BR /&gt;
&lt;BR /&gt;
legendForm.StartPosition = Windows.Forms.FormStartPosition.CenterScreen&lt;BR /&gt;
&lt;BR /&gt;
None of the above seem to effect the position of the form?</description>
      <pubDate>Wed, 23 Aug 2006 14:40:33 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/showmodaldialog-question/m-p/1744222#M80670</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2006-08-23T14:40:33Z</dc:date>
    </item>
    <item>
      <title>Re: ShowModalDialog question.....</title>
      <link>https://forums.autodesk.com/t5/net-forum/showmodaldialog-question/m-p/1744223#M80671</link>
      <description>The reason is because AutoCAD manages the size/location&lt;BR /&gt;
of your window for you, persists it in the registry, and then&lt;BR /&gt;
restores it when you show the same form again, keyed to&lt;BR /&gt;
the string returned by GetType().FullName on your form.&lt;BR /&gt;
&lt;BR /&gt;
The ShowModalDialog() method is overloaded. Call the one&lt;BR /&gt;
that takes the optional bool parameter, and pass false to&lt;BR /&gt;
prevent it from persisting your forms size/position.&lt;BR /&gt;
&lt;BR /&gt;
-- &lt;BR /&gt;
http://www.caddzone.com&lt;BR /&gt;
&lt;BR /&gt;
AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005/2006/2007&lt;BR /&gt;
http://www.acadxtabs.com&lt;BR /&gt;
&lt;BR /&gt;
&lt;NATALIE-C&gt; wrote in message news:5304050@discussion.autodesk.com...&lt;BR /&gt;
That doesn't seem to work?&lt;BR /&gt;
&lt;BR /&gt;
This is my code:&lt;BR /&gt;
&lt;BR /&gt;
Dim legendFormAs Legend1 = New Legend1()&lt;BR /&gt;
'----TRIED DIFFERENT THINGS HERE-----&lt;BR /&gt;
Application.ShowModalDialog(legendForm)&lt;BR /&gt;
&lt;BR /&gt;
Things that I've tried are:&lt;BR /&gt;
&lt;BR /&gt;
legendForm.CenterToScreen()&lt;BR /&gt;
&lt;BR /&gt;
legendForm.Left = Windows.Forms.Screen.PrimaryScreen.Bounds.Left+5&lt;BR /&gt;
legendForm.Top = Windows.Forms.Screen.PrimaryScreen.Bounds.Top+5&lt;BR /&gt;
&lt;BR /&gt;
legendForm.StartPosition = Windows.Forms.FormStartPosition.CenterScreen&lt;BR /&gt;
&lt;BR /&gt;
None of the above seem to effect the position of the form?&lt;/NATALIE-C&gt;</description>
      <pubDate>Wed, 23 Aug 2006 15:41:15 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/showmodaldialog-question/m-p/1744223#M80671</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2006-08-23T15:41:15Z</dc:date>
    </item>
    <item>
      <title>Re: ShowModalDialog question.....</title>
      <link>https://forums.autodesk.com/t5/net-forum/showmodaldialog-question/m-p/1744224#M80672</link>
      <description>I works for me. I have a modal dialog, when it is shown, a selected entity &lt;BR /&gt;
in the Editor is zoomed to screen centre, so I place the dialog at &lt;BR /&gt;
upper-left corner of the screen. It works always.&lt;BR /&gt;
&lt;BR /&gt;
Note, if you need to specify a Win Form's location in code when it is &lt;BR /&gt;
loaded, you need to set the Form's "StartPosition" property to "Manual".&lt;BR /&gt;
&lt;BR /&gt;
&lt;NATALIE-C&gt; wrote in message news:5304050@discussion.autodesk.com...&lt;BR /&gt;
That doesn't seem to work?&lt;BR /&gt;
&lt;BR /&gt;
This is my code:&lt;BR /&gt;
&lt;BR /&gt;
Dim legendFormAs Legend1 = New Legend1()&lt;BR /&gt;
'----TRIED DIFFERENT THINGS HERE-----&lt;BR /&gt;
Application.ShowModalDialog(legendForm)&lt;BR /&gt;
&lt;BR /&gt;
Things that I've tried are:&lt;BR /&gt;
&lt;BR /&gt;
legendForm.CenterToScreen()&lt;BR /&gt;
&lt;BR /&gt;
legendForm.Left = Windows.Forms.Screen.PrimaryScreen.Bounds.Left+5&lt;BR /&gt;
legendForm.Top = Windows.Forms.Screen.PrimaryScreen.Bounds.Top+5&lt;BR /&gt;
&lt;BR /&gt;
legendForm.StartPosition = Windows.Forms.FormStartPosition.CenterScreen&lt;BR /&gt;
&lt;BR /&gt;
None of the above seem to effect the position of the form?&lt;/NATALIE-C&gt;</description>
      <pubDate>Wed, 23 Aug 2006 15:54:13 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/showmodaldialog-question/m-p/1744224#M80672</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2006-08-23T15:54:13Z</dc:date>
    </item>
    <item>
      <title>Re: ShowModalDialog question.....</title>
      <link>https://forums.autodesk.com/t5/net-forum/showmodaldialog-question/m-p/1744225#M80673</link>
      <description>Yes!! That was it. I overloaded it and set it to False and that allowed me to set the position of the window.&lt;BR /&gt;
&lt;BR /&gt;
Thanks everyone!!!</description>
      <pubDate>Wed, 23 Aug 2006 21:43:01 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/showmodaldialog-question/m-p/1744225#M80673</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2006-08-23T21:43:01Z</dc:date>
    </item>
  </channel>
</rss>

