.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Check form loaded and hidden

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
SRSDS
275 Views, 2 Replies

Check form loaded and hidden

Hi,

 

I am loading a form which is populated with several pictures and controls. 

There is a small delay in it's loading so I would like to hide it and make it visible again.

How do I check if it's loaded?

            If SOMETHING Then
                FormShapes.Show()
            Else
                Application.ShowModalDialog(Application.MainWindow.Handle, FormShapes, False)
            End If

 

 

2 REPLIES 2
Message 2 of 3
_gile
in reply to: SRSDS

Hi,

 

You can use a static (Shared) field to store the form instance that you initialize only once per session if it's null (Nothing).

        static Dialog formShapes = null;

        public static void SomeMethod()
        {
            var doc = Application.DocumentManager.MdiActiveDocument;
            if (formShapes == null)
                formShapes = new Dialog(); // or whatever the form class name
Application.ShowModalDialog(doc.Window.Handle, formShapes, false);
[...] }

 



Gilles Chanteau
Programmation AutoCAD LISP/.NET
GileCAD
GitHub

Message 3 of 3
SRSDS
in reply to: _gile

Thank you.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost