TheSwamp
Code Red => .NET => Topic started by: wannabe 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:
{
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.
-
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.
-
Ok. I read the Activate method as activating and providing focus to my form. I'll look into what you suggested.
Thanks :-)
-
That's correct - but you have to show it first :D
-
You = smart. Me = fool. :oops:
Disappointed I missed that one; but grateful for your help.
Cheers again. :-)