<?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: Displaying WinForm with CommandMethod in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/displaying-winform-with-commandmethod/m-p/1375683#M84404</link>
    <description>Remove the semi-colon after this line.&lt;BR /&gt;
&amp;gt;public void ShowForm();&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Remember that C# is case sensitive.  Your dataForm variable name is not the&lt;BR /&gt;
same in these two lines.&lt;BR /&gt;
&amp;gt;Form dataForm = new dataGatheringForm();&lt;BR /&gt;
&amp;gt;// dataform. intellisense not working as expected...&lt;BR /&gt;
&lt;BR /&gt;
-- &lt;BR /&gt;
Bobby C. Jones&lt;BR /&gt;
http://www.acadx.com</description>
    <pubDate>Mon, 11 Jul 2005 14:31:37 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2005-07-11T14:31:37Z</dc:date>
    <item>
      <title>Displaying WinForm with CommandMethod</title>
      <link>https://forums.autodesk.com/t5/net-forum/displaying-winform-with-commandmethod/m-p/1375680#M84401</link>
      <description>Hi Everyone,&lt;BR /&gt;
&lt;BR /&gt;
I've been working with CommandMethod to create some AutoCAD commands that &lt;BR /&gt;
interact with the user through prompts and messagebox display. Next, I want &lt;BR /&gt;
to start using Winforms but I can't find any examples and the "trial and &lt;BR /&gt;
error" approach has been failing me. I have the forms designed but can't &lt;BR /&gt;
display them. I'm using AutoCAD 2006 and VS2005 Beta 2 on Windows XP SP2.&lt;BR /&gt;
&lt;BR /&gt;
Any suggestions?&lt;BR /&gt;
&lt;BR /&gt;
Thanks,&lt;BR /&gt;
&lt;BR /&gt;
Scott</description>
      <pubDate>Mon, 11 Jul 2005 04:23:18 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/displaying-winform-with-commandmethod/m-p/1375680#M84401</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2005-07-11T04:23:18Z</dc:date>
    </item>
    <item>
      <title>Re: Displaying WinForm with CommandMethod</title>
      <link>https://forums.autodesk.com/t5/net-forum/displaying-winform-with-commandmethod/m-p/1375681#M84402</link>
      <description>Hi Scott,&lt;BR /&gt;
To display a form simply create an instance of it and call its .Show or&lt;BR /&gt;
.ShowDialog method.&lt;BR /&gt;
-- &lt;BR /&gt;
Bobby C. Jones&lt;BR /&gt;
http://www.acadx.com&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
"Homer Simpson" &lt;HOMER&gt; wrote in message&lt;BR /&gt;
news:4897447@discussion.autodesk.com...&lt;BR /&gt;
Hi Everyone,&lt;BR /&gt;
&lt;BR /&gt;
I've been working with CommandMethod to create some AutoCAD commands that&lt;BR /&gt;
interact with the user through prompts and messagebox display. Next, I want&lt;BR /&gt;
to start using Winforms but I can't find any examples and the "trial and&lt;BR /&gt;
error" approach has been failing me. I have the forms designed but can't&lt;BR /&gt;
display them. I'm using AutoCAD 2006 and VS2005 Beta 2 on Windows XP SP2.&lt;BR /&gt;
&lt;BR /&gt;
Any suggestions?&lt;BR /&gt;
&lt;BR /&gt;
Thanks,&lt;BR /&gt;
&lt;BR /&gt;
Scott&lt;/HOMER&gt;</description>
      <pubDate>Mon, 11 Jul 2005 12:14:27 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/displaying-winform-with-commandmethod/m-p/1375681#M84402</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2005-07-11T12:14:27Z</dc:date>
    </item>
    <item>
      <title>Re: Displaying WinForm with CommandMethod</title>
      <link>https://forums.autodesk.com/t5/net-forum/displaying-winform-with-commandmethod/m-p/1375682#M84403</link>
      <description>I've been trying to do that but the intellisense won't display the &lt;BR /&gt;
showdialog or show methods for the instance. The code is inserted below. I &lt;BR /&gt;
also have one form named 'dataGatheringForm' in the project. Any suggestions &lt;BR /&gt;
are greatly appreciated.&lt;BR /&gt;
&lt;BR /&gt;
Thanks,&lt;BR /&gt;
Scott&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
using System;&lt;BR /&gt;
&lt;BR /&gt;
using System.Collections.Generic;&lt;BR /&gt;
&lt;BR /&gt;
using System.Text;&lt;BR /&gt;
&lt;BR /&gt;
using System.Windows.Forms;&lt;BR /&gt;
&lt;BR /&gt;
using Autodesk.AutoCAD.DatabaseServices;&lt;BR /&gt;
&lt;BR /&gt;
using Autodesk.AutoCAD.Runtime;&lt;BR /&gt;
&lt;BR /&gt;
using Autodesk.AutoCAD.Geometry;&lt;BR /&gt;
&lt;BR /&gt;
using Autodesk.AutoCAD.ApplicationServices;&lt;BR /&gt;
&lt;BR /&gt;
using Autodesk.AutoCAD.EditorInput;&lt;BR /&gt;
&lt;BR /&gt;
using Autodesk.AutoCAD.Windows;&lt;BR /&gt;
&lt;BR /&gt;
namespace ProfileChecking&lt;BR /&gt;
&lt;BR /&gt;
{&lt;BR /&gt;
&lt;BR /&gt;
public class getData&lt;BR /&gt;
&lt;BR /&gt;
{&lt;BR /&gt;
&lt;BR /&gt;
[CommandMethod("CheckProfile")]&lt;BR /&gt;
&lt;BR /&gt;
public void ShowForm();&lt;BR /&gt;
&lt;BR /&gt;
{&lt;BR /&gt;
&lt;BR /&gt;
Form dataForm = new dataGatheringForm();&lt;BR /&gt;
&lt;BR /&gt;
// dataform. intellisense not working as expected...&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
}&lt;BR /&gt;
&lt;BR /&gt;
}&lt;BR /&gt;
&lt;BR /&gt;
}&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
"Bobby C. Jones" &lt;BJONES&gt; wrote in message &lt;BR /&gt;
news:4897582@discussion.autodesk.com...&lt;BR /&gt;
Hi Scott,&lt;BR /&gt;
To display a form simply create an instance of it and call its .Show or&lt;BR /&gt;
.ShowDialog method.&lt;BR /&gt;
-- &lt;BR /&gt;
Bobby C. Jones&lt;BR /&gt;
http://www.acadx.com&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
"Homer Simpson" &lt;HOMER&gt; wrote in message&lt;BR /&gt;
news:4897447@discussion.autodesk.com...&lt;BR /&gt;
Hi Everyone,&lt;BR /&gt;
&lt;BR /&gt;
I've been working with CommandMethod to create some AutoCAD commands that&lt;BR /&gt;
interact with the user through prompts and messagebox display. Next, I want&lt;BR /&gt;
to start using Winforms but I can't find any examples and the "trial and&lt;BR /&gt;
error" approach has been failing me. I have the forms designed but can't&lt;BR /&gt;
display them. I'm using AutoCAD 2006 and VS2005 Beta 2 on Windows XP SP2.&lt;BR /&gt;
&lt;BR /&gt;
Any suggestions?&lt;BR /&gt;
&lt;BR /&gt;
Thanks,&lt;BR /&gt;
&lt;BR /&gt;
Scott&lt;/HOMER&gt;&lt;/BJONES&gt;</description>
      <pubDate>Mon, 11 Jul 2005 14:18:26 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/displaying-winform-with-commandmethod/m-p/1375682#M84403</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2005-07-11T14:18:26Z</dc:date>
    </item>
    <item>
      <title>Re: Displaying WinForm with CommandMethod</title>
      <link>https://forums.autodesk.com/t5/net-forum/displaying-winform-with-commandmethod/m-p/1375683#M84404</link>
      <description>Remove the semi-colon after this line.&lt;BR /&gt;
&amp;gt;public void ShowForm();&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Remember that C# is case sensitive.  Your dataForm variable name is not the&lt;BR /&gt;
same in these two lines.&lt;BR /&gt;
&amp;gt;Form dataForm = new dataGatheringForm();&lt;BR /&gt;
&amp;gt;// dataform. intellisense not working as expected...&lt;BR /&gt;
&lt;BR /&gt;
-- &lt;BR /&gt;
Bobby C. Jones&lt;BR /&gt;
http://www.acadx.com</description>
      <pubDate>Mon, 11 Jul 2005 14:31:37 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/displaying-winform-with-commandmethod/m-p/1375683#M84404</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2005-07-11T14:31:37Z</dc:date>
    </item>
    <item>
      <title>Re: Displaying WinForm with CommandMethod</title>
      <link>https://forums.autodesk.com/t5/net-forum/displaying-winform-with-commandmethod/m-p/1375684#M84405</link>
      <description>Thanks, Bobby!&lt;BR /&gt;
&lt;BR /&gt;
It was that @#*&amp;amp;% little semicolon!&lt;BR /&gt;
&lt;BR /&gt;
I was focusing on checking the case of the variables and missed the line &lt;BR /&gt;
terminator shouldn't be there. You have no idea how much time I already &lt;BR /&gt;
spent trying to figure out what was wrong. I tried new projects, retyping &lt;BR /&gt;
rather than cut &amp;amp; paste, etc.&lt;BR /&gt;
&lt;BR /&gt;
Thanks,&lt;BR /&gt;
Scott&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
"Bobby C. Jones" &lt;BJONES&gt; wrote in message &lt;BR /&gt;
news:4897756@discussion.autodesk.com...&lt;BR /&gt;
Remove the semi-colon after this line.&lt;BR /&gt;
&amp;gt;public void ShowForm();&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Remember that C# is case sensitive.  Your dataForm variable name is not the&lt;BR /&gt;
same in these two lines.&lt;BR /&gt;
&amp;gt;Form dataForm = new dataGatheringForm();&lt;BR /&gt;
&amp;gt;// dataform. intellisense not working as expected...&lt;BR /&gt;
&lt;BR /&gt;
-- &lt;BR /&gt;
Bobby C. Jones&lt;BR /&gt;
http://www.acadx.com&lt;/BJONES&gt;</description>
      <pubDate>Mon, 11 Jul 2005 15:22:21 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/displaying-winform-with-commandmethod/m-p/1375684#M84405</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2005-07-11T15:22:21Z</dc:date>
    </item>
    <item>
      <title>Re: Displaying WinForm with CommandMethod</title>
      <link>https://forums.autodesk.com/t5/net-forum/displaying-winform-with-commandmethod/m-p/1375685#M84406</link>
      <description>Glad to help out Scott.  Sometimes that second pair of eyes makes all the&lt;BR /&gt;
difference in the world!&lt;BR /&gt;
-- &lt;BR /&gt;
Bobby C. Jones&lt;BR /&gt;
http://www.acadx.com&lt;BR /&gt;
&lt;BR /&gt;
"Homer Simpson" &lt;HOMER&gt; wrote in message&lt;BR /&gt;
news:4897845@discussion.autodesk.com...&lt;BR /&gt;
Thanks, Bobby!&lt;BR /&gt;
&lt;BR /&gt;
It was that @#*&amp;amp;% little semicolon!&lt;BR /&gt;
&lt;BR /&gt;
I was focusing on checking the case of the variables and missed the line&lt;BR /&gt;
terminator shouldn't be there. You have no idea how much time I already&lt;BR /&gt;
spent trying to figure out what was wrong. I tried new projects, retyping&lt;BR /&gt;
rather than cut &amp;amp; paste, etc.&lt;BR /&gt;
&lt;BR /&gt;
Thanks,&lt;BR /&gt;
Scott&lt;/HOMER&gt;</description>
      <pubDate>Mon, 11 Jul 2005 15:25:19 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/displaying-winform-with-commandmethod/m-p/1375685#M84406</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2005-07-11T15:25:19Z</dc:date>
    </item>
    <item>
      <title>Re: Displaying WinForm with CommandMethod</title>
      <link>https://forums.autodesk.com/t5/net-forum/displaying-winform-with-commandmethod/m-p/1375686#M84407</link>
      <description>Here's a C# example.&lt;BR /&gt;
&lt;BR /&gt;
Create a new solution with a c# project, add references to &lt;BR /&gt;
System.Windows.Forms, and the AutoCAD managed DLLS, &lt;BR /&gt;
then add a new Form to the project using the default name&lt;BR /&gt;
"Form1".&lt;BR /&gt;
&lt;BR /&gt;
Then, replace the entire Form1.cs file generated by the IDE&lt;BR /&gt;
with the code below.  Then, build the project and NETLOAD&lt;BR /&gt;
into AutoCAD, and issue the MODALFORM command.&lt;BR /&gt;
&lt;BR /&gt;
//////////// Form1.cs /////////////////&lt;BR /&gt;
using System;&lt;BR /&gt;
using System.Drawing;&lt;BR /&gt;
using System.Collections;&lt;BR /&gt;
using System.ComponentModel;&lt;BR /&gt;
using System.Windows.Forms;&lt;BR /&gt;
using Autodesk.AutoCAD.Runtime;&lt;BR /&gt;
using AcadApp = Autodesk.AutoCAD.ApplicationServices.Application;&lt;BR /&gt;
&lt;BR /&gt;
namespace AcadModalFormSample&lt;BR /&gt;
{&lt;BR /&gt;
 /// &lt;SUMMARY&gt;&lt;BR /&gt;
 /// Summary description for Form1.&lt;BR /&gt;
 /// &lt;/SUMMARY&gt;&lt;BR /&gt;
 public class Form1 : System.Windows.Forms.Form&lt;BR /&gt;
 {&lt;BR /&gt;
  /// &lt;SUMMARY&gt;&lt;BR /&gt;
  /// Required designer variable.&lt;BR /&gt;
  /// &lt;/SUMMARY&gt;&lt;BR /&gt;
  private System.ComponentModel.Container components = null;&lt;BR /&gt;
&lt;BR /&gt;
  public Form1()&lt;BR /&gt;
  {&lt;BR /&gt;
   //&lt;BR /&gt;
   // Required for Windows Form Designer support&lt;BR /&gt;
   //&lt;BR /&gt;
   InitializeComponent();&lt;BR /&gt;
&lt;BR /&gt;
   //&lt;BR /&gt;
   // TODO: Add any constructor code after InitializeComponent call&lt;BR /&gt;
   //&lt;BR /&gt;
  }&lt;BR /&gt;
&lt;BR /&gt;
  /// &lt;SUMMARY&gt;&lt;BR /&gt;
  /// Clean up any resources being used.&lt;BR /&gt;
  /// &lt;/SUMMARY&gt;&lt;BR /&gt;
  protected override void Dispose( bool disposing )&lt;BR /&gt;
  {&lt;BR /&gt;
   if( disposing )&lt;BR /&gt;
   {&lt;BR /&gt;
    if(components != null)&lt;BR /&gt;
    {&lt;BR /&gt;
     components.Dispose();&lt;BR /&gt;
    }&lt;BR /&gt;
   }&lt;BR /&gt;
   base.Dispose( disposing );&lt;BR /&gt;
  }&lt;BR /&gt;
&lt;BR /&gt;
  #region Windows Form Designer generated code&lt;BR /&gt;
  /// &lt;SUMMARY&gt;&lt;BR /&gt;
  /// Required method for Designer support - do not modify&lt;BR /&gt;
  /// the contents of this method with the code editor.&lt;BR /&gt;
  /// &lt;/SUMMARY&gt;&lt;BR /&gt;
  private void InitializeComponent()&lt;BR /&gt;
  {&lt;BR /&gt;
   this.components = new System.ComponentModel.Container();&lt;BR /&gt;
   this.Size = new System.Drawing.Size(300,300);&lt;BR /&gt;
   this.Text = "Form1";&lt;BR /&gt;
  }&lt;BR /&gt;
  #endregion&lt;BR /&gt;
&lt;BR /&gt;
  #region AutoCAD-specific functionality&lt;BR /&gt;
&lt;BR /&gt;
  private static Form1 s_ThisForm = null;&lt;BR /&gt;
  &lt;BR /&gt;
  // singleton form object is created the&lt;BR /&gt;
  // first time this property is referenced.&lt;BR /&gt;
&lt;BR /&gt;
  private static Form1 ThisForm&lt;BR /&gt;
  {&lt;BR /&gt;
   get&lt;BR /&gt;
   {&lt;BR /&gt;
    if( s_ThisForm == null || s_ThisForm.IsDisposed )&lt;BR /&gt;
     s_ThisForm = new Form1();&lt;BR /&gt;
    return s_ThisForm;&lt;BR /&gt;
   }&lt;BR /&gt;
  }&lt;BR /&gt;
&lt;BR /&gt;
  [CommandMethod("MODALFORM")]&lt;BR /&gt;
  static public void FormShowCommandMethod()&lt;BR /&gt;
  {&lt;BR /&gt;
   AcadApp.ShowModalDialog(ThisForm);&lt;BR /&gt;
  }&lt;BR /&gt;
  #endregion&lt;BR /&gt;
 }&lt;BR /&gt;
}&lt;BR /&gt;
&lt;BR /&gt;
/////////////// end Form1.cs /////////////////&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&lt;BR /&gt;
http://www.acadxtabs.com&lt;BR /&gt;
&lt;BR /&gt;
"Homer Simpson" &lt;HOMER&gt; wrote in message news:4897447@discussion.autodesk.com...&lt;BR /&gt;
Hi Everyone,&lt;BR /&gt;
&lt;BR /&gt;
I've been working with CommandMethod to create some AutoCAD commands that &lt;BR /&gt;
interact with the user through prompts and messagebox display. Next, I want &lt;BR /&gt;
to start using Winforms but I can't find any examples and the "trial and &lt;BR /&gt;
error" approach has been failing me. I have the forms designed but can't &lt;BR /&gt;
display them. I'm using AutoCAD 2006 and VS2005 Beta 2 on Windows XP SP2.&lt;BR /&gt;
&lt;BR /&gt;
Any suggestions?&lt;BR /&gt;
&lt;BR /&gt;
Thanks,&lt;BR /&gt;
&lt;BR /&gt;
Scott&lt;/HOMER&gt;</description>
      <pubDate>Mon, 11 Jul 2005 21:26:26 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/displaying-winform-with-commandmethod/m-p/1375686#M84407</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2005-07-11T21:26:26Z</dc:date>
    </item>
    <item>
      <title>Re: Displaying WinForm with CommandMethod</title>
      <link>https://forums.autodesk.com/t5/net-forum/displaying-winform-with-commandmethod/m-p/1375687#M84408</link>
      <description>"Bobby C. Jones" &lt;BJONES&gt; wrote:&lt;BR /&gt;
&lt;BR /&gt;
&amp;gt;&amp;gt; To display a form simply create an instance of it and &lt;BR /&gt;
&amp;gt;&amp;gt; call its .Show or .ShowDialog method.&lt;BR /&gt;
&lt;BR /&gt;
In AutoCAD you do not call Show() or ShowDialog()&lt;BR /&gt;
&lt;BR /&gt;
The interop Application class has methods for displaying &lt;BR /&gt;
forms, and they should be used instead. &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&lt;BR /&gt;
http://www.acadxtabs.com&lt;BR /&gt;
&lt;BR /&gt;
-- &lt;BR /&gt;
Bobby C. Jones&lt;BR /&gt;
http://www.acadx.com&lt;/BJONES&gt;</description>
      <pubDate>Mon, 11 Jul 2005 21:29:59 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/displaying-winform-with-commandmethod/m-p/1375687#M84408</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2005-07-11T21:29:59Z</dc:date>
    </item>
    <item>
      <title>Re: Displaying WinForm with CommandMethod</title>
      <link>https://forums.autodesk.com/t5/net-forum/displaying-winform-with-commandmethod/m-p/1375688#M84409</link>
      <description>Thanks Tony, Nice info.&lt;BR /&gt;
"Tony Tanzillo" &lt;TONY.TANZILLO&gt; wrote in message &lt;BR /&gt;
news:4898376@discussion.autodesk.com...&lt;BR /&gt;
Here's a C# example.&lt;BR /&gt;
&lt;BR /&gt;
Create a new solution with a c# project, add references to&lt;BR /&gt;
System.Windows.Forms, and the AutoCAD managed DLLS,&lt;BR /&gt;
then add a new Form to the project using the default name&lt;BR /&gt;
"Form1".&lt;BR /&gt;
&lt;BR /&gt;
Then, replace the entire Form1.cs file generated by the IDE&lt;BR /&gt;
with the code below.  Then, build the project and NETLOAD&lt;BR /&gt;
into AutoCAD, and issue the MODALFORM command.&lt;BR /&gt;
&lt;BR /&gt;
//////////// Form1.cs /////////////////&lt;BR /&gt;
using System;&lt;BR /&gt;
using System.Drawing;&lt;BR /&gt;
using System.Collections;&lt;BR /&gt;
using System.ComponentModel;&lt;BR /&gt;
using System.Windows.Forms;&lt;BR /&gt;
using Autodesk.AutoCAD.Runtime;&lt;BR /&gt;
using AcadApp = Autodesk.AutoCAD.ApplicationServices.Application;&lt;BR /&gt;
&lt;BR /&gt;
namespace AcadModalFormSample&lt;BR /&gt;
{&lt;BR /&gt;
 /// &lt;SUMMARY&gt;&lt;BR /&gt;
 /// Summary description for Form1.&lt;BR /&gt;
 /// &lt;/SUMMARY&gt;&lt;BR /&gt;
 public class Form1 : System.Windows.Forms.Form&lt;BR /&gt;
 {&lt;BR /&gt;
  /// &lt;SUMMARY&gt;&lt;BR /&gt;
  /// Required designer variable.&lt;BR /&gt;
  /// &lt;/SUMMARY&gt;&lt;BR /&gt;
  private System.ComponentModel.Container components = null;&lt;BR /&gt;
&lt;BR /&gt;
  public Form1()&lt;BR /&gt;
  {&lt;BR /&gt;
   //&lt;BR /&gt;
   // Required for Windows Form Designer support&lt;BR /&gt;
   //&lt;BR /&gt;
   InitializeComponent();&lt;BR /&gt;
&lt;BR /&gt;
   //&lt;BR /&gt;
   // TODO: Add any constructor code after InitializeComponent call&lt;BR /&gt;
   //&lt;BR /&gt;
  }&lt;BR /&gt;
&lt;BR /&gt;
  /// &lt;SUMMARY&gt;&lt;BR /&gt;
  /// Clean up any resources being used.&lt;BR /&gt;
  /// &lt;/SUMMARY&gt;&lt;BR /&gt;
  protected override void Dispose( bool disposing )&lt;BR /&gt;
  {&lt;BR /&gt;
   if( disposing )&lt;BR /&gt;
   {&lt;BR /&gt;
    if(components != null)&lt;BR /&gt;
    {&lt;BR /&gt;
     components.Dispose();&lt;BR /&gt;
    }&lt;BR /&gt;
   }&lt;BR /&gt;
   base.Dispose( disposing );&lt;BR /&gt;
  }&lt;BR /&gt;
&lt;BR /&gt;
  #region Windows Form Designer generated code&lt;BR /&gt;
  /// &lt;SUMMARY&gt;&lt;BR /&gt;
  /// Required method for Designer support - do not modify&lt;BR /&gt;
  /// the contents of this method with the code editor.&lt;BR /&gt;
  /// &lt;/SUMMARY&gt;&lt;BR /&gt;
  private void InitializeComponent()&lt;BR /&gt;
  {&lt;BR /&gt;
   this.components = new System.ComponentModel.Container();&lt;BR /&gt;
   this.Size = new System.Drawing.Size(300,300);&lt;BR /&gt;
   this.Text = "Form1";&lt;BR /&gt;
  }&lt;BR /&gt;
  #endregion&lt;BR /&gt;
&lt;BR /&gt;
  #region AutoCAD-specific functionality&lt;BR /&gt;
&lt;BR /&gt;
  private static Form1 s_ThisForm = null;&lt;BR /&gt;
&lt;BR /&gt;
  // singleton form object is created the&lt;BR /&gt;
  // first time this property is referenced.&lt;BR /&gt;
&lt;BR /&gt;
  private static Form1 ThisForm&lt;BR /&gt;
  {&lt;BR /&gt;
   get&lt;BR /&gt;
   {&lt;BR /&gt;
    if( s_ThisForm == null || s_ThisForm.IsDisposed )&lt;BR /&gt;
     s_ThisForm = new Form1();&lt;BR /&gt;
    return s_ThisForm;&lt;BR /&gt;
   }&lt;BR /&gt;
  }&lt;BR /&gt;
&lt;BR /&gt;
  [CommandMethod("MODALFORM")]&lt;BR /&gt;
  static public void FormShowCommandMethod()&lt;BR /&gt;
  {&lt;BR /&gt;
   AcadApp.ShowModalDialog(ThisForm);&lt;BR /&gt;
  }&lt;BR /&gt;
  #endregion&lt;BR /&gt;
 }&lt;BR /&gt;
}&lt;BR /&gt;
&lt;BR /&gt;
/////////////// end Form1.cs /////////////////&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&lt;BR /&gt;
http://www.acadxtabs.com&lt;BR /&gt;
&lt;BR /&gt;
"Homer Simpson" &lt;HOMER&gt; wrote in message &lt;BR /&gt;
news:4897447@discussion.autodesk.com...&lt;BR /&gt;
Hi Everyone,&lt;BR /&gt;
&lt;BR /&gt;
I've been working with CommandMethod to create some AutoCAD commands that&lt;BR /&gt;
interact with the user through prompts and messagebox display. Next, I want&lt;BR /&gt;
to start using Winforms but I can't find any examples and the "trial and&lt;BR /&gt;
error" approach has been failing me. I have the forms designed but can't&lt;BR /&gt;
display them. I'm using AutoCAD 2006 and VS2005 Beta 2 on Windows XP SP2.&lt;BR /&gt;
&lt;BR /&gt;
Any suggestions?&lt;BR /&gt;
&lt;BR /&gt;
Thanks,&lt;BR /&gt;
&lt;BR /&gt;
Scott&lt;/HOMER&gt;&lt;/TONY.TANZILLO&gt;</description>
      <pubDate>Mon, 11 Jul 2005 21:34:02 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/displaying-winform-with-commandmethod/m-p/1375688#M84409</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2005-07-11T21:34:02Z</dc:date>
    </item>
    <item>
      <title>Re: Displaying WinForm with CommandMethod</title>
      <link>https://forums.autodesk.com/t5/net-forum/displaying-winform-with-commandmethod/m-p/1375689#M84410</link>
      <description>I posted the example without seeing your code, and&lt;BR /&gt;
a bit of explaination about the example may be helpful.&lt;BR /&gt;
&lt;BR /&gt;
If a member function marked with the CommandMethod&lt;BR /&gt;
attribute is not static, then AutoCAD is going to create&lt;BR /&gt;
one instance of the containing class, for each drawing in &lt;BR /&gt;
which the command is issued. &lt;BR /&gt;
&lt;BR /&gt;
That means that if you have three drawings open in the&lt;BR /&gt;
AutoCAD editor, and you issue the CheckProfile command&lt;BR /&gt;
in each of them, then there will be three instances of your&lt;BR /&gt;
getData class, one for each open document. Hence, there&lt;BR /&gt;
will be three instances of your dataGatheringForm created&lt;BR /&gt;
as well.&lt;BR /&gt;
&lt;BR /&gt;
That scheme can be extremely useful in cases where the &lt;BR /&gt;
form binds or couples to document-specific data. If the form &lt;BR /&gt;
does not couple to document specific data, you may not &lt;BR /&gt;
want to have multiple document-specific forms, and rather &lt;BR /&gt;
have a single form that is used in all documents. &lt;BR /&gt;
&lt;BR /&gt;
The choice of which way to go is largely dependent on the &lt;BR /&gt;
nature of the form and the application it is a part of.&lt;BR /&gt;
&lt;BR /&gt;
Just so that everyone knows, the sample I posted shows &lt;BR /&gt;
how to display a single modal form that is used in every&lt;BR /&gt;
open document, rather than use multiple document-specific &lt;BR /&gt;
forms.&lt;BR /&gt;
&lt;BR /&gt;
Lastly, Bobby's advice regarding showing the form, is not&lt;BR /&gt;
correct for forms in managed applications loaded into the&lt;BR /&gt;
AutoCAD process.&lt;BR /&gt;
&lt;BR /&gt;
Instead of calling ShowDialog() or Show() to display your&lt;BR /&gt;
form, in AutoCAD you would call the ShowModalDialog()&lt;BR /&gt;
method of the Apolication object. For a modeless dialog,&lt;BR /&gt;
there is the ShowModelessDialog() method.  There are&lt;BR /&gt;
several things that these methods do, which are desireable&lt;BR /&gt;
in the case of AutoCAD-hosted winforms. So, you should&lt;BR /&gt;
use those in lieu of the aforementioned Form methods.&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&lt;BR /&gt;
http://www.acadxtabs.com&lt;BR /&gt;
&lt;BR /&gt;
"Homer Simpson" &lt;HOMER&gt; wrote in message news:4897738@discussion.autodesk.com...&lt;BR /&gt;
I've been trying to do that but the intellisense won't display the &lt;BR /&gt;
showdialog or show methods for the instance. The code is inserted below. I &lt;BR /&gt;
also have one form named 'dataGatheringForm' in the project. Any suggestions &lt;BR /&gt;
are greatly appreciated.&lt;BR /&gt;
&lt;BR /&gt;
Thanks,&lt;BR /&gt;
Scott&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
using System;&lt;BR /&gt;
&lt;BR /&gt;
using System.Collections.Generic;&lt;BR /&gt;
&lt;BR /&gt;
using System.Text;&lt;BR /&gt;
&lt;BR /&gt;
using System.Windows.Forms;&lt;BR /&gt;
&lt;BR /&gt;
using Autodesk.AutoCAD.DatabaseServices;&lt;BR /&gt;
&lt;BR /&gt;
using Autodesk.AutoCAD.Runtime;&lt;BR /&gt;
&lt;BR /&gt;
using Autodesk.AutoCAD.Geometry;&lt;BR /&gt;
&lt;BR /&gt;
using Autodesk.AutoCAD.ApplicationServices;&lt;BR /&gt;
&lt;BR /&gt;
using Autodesk.AutoCAD.EditorInput;&lt;BR /&gt;
&lt;BR /&gt;
using Autodesk.AutoCAD.Windows;&lt;BR /&gt;
&lt;BR /&gt;
namespace ProfileChecking&lt;BR /&gt;
&lt;BR /&gt;
{&lt;BR /&gt;
&lt;BR /&gt;
public class getData&lt;BR /&gt;
&lt;BR /&gt;
{&lt;BR /&gt;
&lt;BR /&gt;
[CommandMethod("CheckProfile")]&lt;BR /&gt;
&lt;BR /&gt;
public void ShowForm();&lt;BR /&gt;
&lt;BR /&gt;
{&lt;BR /&gt;
&lt;BR /&gt;
Form dataForm = new dataGatheringForm();&lt;BR /&gt;
&lt;BR /&gt;
// dataform. intellisense not working as expected...&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
}&lt;BR /&gt;
&lt;BR /&gt;
}&lt;BR /&gt;
&lt;BR /&gt;
}&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
"Bobby C. Jones" &lt;BJONES&gt; wrote in message &lt;BR /&gt;
news:4897582@discussion.autodesk.com...&lt;BR /&gt;
Hi Scott,&lt;BR /&gt;
To display a form simply create an instance of it and call its .Show or&lt;BR /&gt;
.ShowDialog method.&lt;BR /&gt;
-- &lt;BR /&gt;
Bobby C. Jones&lt;BR /&gt;
http://www.acadx.com&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
"Homer Simpson" &lt;HOMER&gt; wrote in message&lt;BR /&gt;
news:4897447@discussion.autodesk.com...&lt;BR /&gt;
Hi Everyone,&lt;BR /&gt;
&lt;BR /&gt;
I've been working with CommandMethod to create some AutoCAD commands that&lt;BR /&gt;
interact with the user through prompts and messagebox display. Next, I want&lt;BR /&gt;
to start using Winforms but I can't find any examples and the "trial and&lt;BR /&gt;
error" approach has been failing me. I have the forms designed but can't&lt;BR /&gt;
display them. I'm using AutoCAD 2006 and VS2005 Beta 2 on Windows XP SP2.&lt;BR /&gt;
&lt;BR /&gt;
Any suggestions?&lt;BR /&gt;
&lt;BR /&gt;
Thanks,&lt;BR /&gt;
&lt;BR /&gt;
Scott&lt;/HOMER&gt;&lt;/BJONES&gt;&lt;/HOMER&gt;</description>
      <pubDate>Mon, 11 Jul 2005 22:50:54 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/displaying-winform-with-commandmethod/m-p/1375689#M84410</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2005-07-11T22:50:54Z</dc:date>
    </item>
    <item>
      <title>Re: Displaying WinForm with CommandMethod</title>
      <link>https://forums.autodesk.com/t5/net-forum/displaying-winform-with-commandmethod/m-p/1375690#M84411</link>
      <description>You are correct Tony.  Thanks for pointing that out.&lt;BR /&gt;
-- &lt;BR /&gt;
Bobby C. Jones&lt;BR /&gt;
http://www.acadx.com&lt;BR /&gt;
&lt;BR /&gt;
"Tony Tanzillo" &lt;TONY.TANZILLO&gt; wrote in message&lt;BR /&gt;
news:4898361@discussion.autodesk.com...&lt;BR /&gt;
"Bobby C. Jones" &lt;BJONES&gt; wrote:&lt;BR /&gt;
&lt;BR /&gt;
&amp;gt;&amp;gt; To display a form simply create an instance of it and&lt;BR /&gt;
&amp;gt;&amp;gt; call its .Show or .ShowDialog method.&lt;BR /&gt;
&lt;BR /&gt;
In AutoCAD you do not call Show() or ShowDialog()&lt;BR /&gt;
&lt;BR /&gt;
The interop Application class has methods for displaying&lt;BR /&gt;
forms, and they should be used instead.&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&lt;BR /&gt;
http://www.acadxtabs.com&lt;BR /&gt;
&lt;BR /&gt;
-- &lt;BR /&gt;
Bobby C. Jones&lt;BR /&gt;
http://www.acadx.com&lt;/BJONES&gt;&lt;/TONY.TANZILLO&gt;</description>
      <pubDate>Tue, 12 Jul 2005 11:55:14 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/displaying-winform-with-commandmethod/m-p/1375690#M84411</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2005-07-12T11:55:14Z</dc:date>
    </item>
    <item>
      <title>Re: Displaying WinForm with CommandMethod</title>
      <link>https://forums.autodesk.com/t5/net-forum/displaying-winform-with-commandmethod/m-p/1375691#M84412</link>
      <description>What are the advantages of using AutoCAD winforms?</description>
      <pubDate>Wed, 13 Jul 2005 10:38:18 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/displaying-winform-with-commandmethod/m-p/1375691#M84412</guid>
      <dc:creator>Mikko</dc:creator>
      <dc:date>2005-07-13T10:38:18Z</dc:date>
    </item>
    <item>
      <title>Re: Displaying WinForm with CommandMethod</title>
      <link>https://forums.autodesk.com/t5/net-forum/displaying-winform-with-commandmethod/m-p/1375692#M84413</link>
      <description>If you build a managed assembly that's loaded with&lt;BR /&gt;
NETLOAD, the point is moot. In that case, any Form&lt;BR /&gt;
derivative is running in AutoCAD, so you can say they&lt;BR /&gt;
are all 'AutoCAD winforms'.&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&lt;BR /&gt;
http://www.acadxtabs.com&lt;BR /&gt;
&lt;BR /&gt;
&lt;MIKKO&gt; wrote in message news:4899861@discussion.autodesk.com...&lt;BR /&gt;
What are the advantages of using AutoCAD winforms?&lt;/MIKKO&gt;</description>
      <pubDate>Wed, 13 Jul 2005 19:33:32 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/displaying-winform-with-commandmethod/m-p/1375692#M84413</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2005-07-13T19:33:32Z</dc:date>
    </item>
  </channel>
</rss>

