Displaying Modal and Modeless forms in AutoCAD .NET

By Stephen Preston

Another in my occasional series of common beginner mistakes that take forever and a day to debug Smile.

Sometimes what we already know gets in the way. If you want to display a form in .NET, you use Form.ShowDialog. Right?

Wrong! If you do, you’re likely to find AutoCAD hanging or displaying other unexpected behavior – particularly if you’re doing this in conjunction with VBA macros. Instead display your dialogs using the AutoCAD .NET APIs provided for the purpose:

  • Application.ShowModalDialog
  • Application.ShowModelessDialog

And if you’re working with modeless dialogs, consider using a palette instead. Kean Walmsley explains why that’s a good idea here.


Comments

Leave a Reply

Discover more from Autodesk Developer Blog

Subscribe now to keep reading and get access to the full archive.

Continue reading