Author Topic: Displaying Forms in a Console Application (Inside Autocad)  (Read 2183 times)

0 Members and 1 Guest are viewing this topic.

wannabe

  • Guest
Displaying Forms in a Console Application (Inside Autocad)
« on: April 15, 2009, 08:22:00 AM »
Another thread from me  :-). Hope you don't mind. I'm doing my best to fathom it out myself but some techniques are currently eluding me. Like this one.

In my console app. I created a form with all my controls on and wanted to test out that it appears when the command is loaded. Here is the code in my class:

Code: [Select]
           
{
    public class Class1
    {
        [CommandMethod("MultiB")]
        public void multiB()
        {
            Form1 form1 = new Form1();
            form1.Activate();
        }

       
    }
}

when debugging in CAD I get no errors, and nor do I get my form to display.

As always, just a nudge in the right direction would be appreciated, but anything additional will be happily absorbed.

Cheers.

Glenn R

  • Guest
Re: Displaying Forms in a Console Application (Inside Autocad)
« Reply #1 on: April 15, 2009, 08:28:08 AM »
It seems to me, that you haven't displayed your dialog yet, therefor, you can't activate it.

If this is running inside AutoCAD, then I would use ShowModalDialog(), if not, then ShowDialog() as normal.

wannabe

  • Guest
Re: Displaying Forms in a Console Application (Inside Autocad)
« Reply #2 on: April 15, 2009, 08:30:58 AM »
Ok. I read the Activate method as activating and providing focus to my form. I'll look into what you suggested.

Thanks :-)

Glenn R

  • Guest
Re: Displaying Forms in a Console Application (Inside Autocad)
« Reply #3 on: April 15, 2009, 08:32:40 AM »
That's correct - but you have to show it first :D

wannabe

  • Guest
Re: Displaying Forms in a Console Application (Inside Autocad)
« Reply #4 on: April 15, 2009, 08:35:24 AM »
You = smart. Me = fool.  :oops:

Disappointed I missed that one; but grateful for your help.

Cheers again. :-)