Exemplo n.º 1
0
        // A static method to close the SplashScreen
        // UPDATE : http://www.codeproject.com/KB/cs/prettygoodsplashscreen.aspx?df=100&forumid=26207&mpp=50&noise=1&fr=51&select=2073339&fid=26207#xx2073339xx
        //A static method to close the SplashScreen
        static public void CloseForm(Form in_parentForm)
        {
            // Update the owner a thread safe fashion!
            MethodInvoker SetOwner = delegate
            {
                ms_frmSplash.Owner = in_parentForm;
            };

            if (ms_frmSplash != null)
            {
                // Make it start going away.
                ms_frmSplash.m_dblOpacityIncrement = -ms_frmSplash.m_dblOpacityDecrement;

                if (ms_frmSplash.InvokeRequired)
                {
                    ms_frmSplash.Invoke(SetOwner);
                }
                else
                {
                    SetOwner();
                }
            }
            ms_oThread.Abort();
            ms_oThread   = null; // we do not need these any more.
            ms_frmSplash = null;
        }