1
Answer

Exit application

Hi all,

I have a winform project, and I would like to call the application, and have it exit when the code has executed. Somehow Application.Exit does not work for me. Here is my code

        public void Print()
        {
          
           
            object empty = null;

            axW.Navigate("http://localhost:2124/Studiebogservice/_Ankomst/LabelPrint.aspx?id=" + "20201", ref empty, ref empty, ref empty, ref empty);

            for (; axW.ReadyState != SHDocVw.tagREADYSTATE.READYSTATE_COMPLETE; )
            {
                System.Windows.Forms.Application.DoEvents();
            }
            axW.ExecWB(SHDocVw.OLECMDID.OLECMDID_PRINT, SHDocVw.OLECMDEXECOPT.OLECMDEXECOPT_DONTPROMPTUSER, ref empty, ref empty);

            Application.Exit();
        }
Answers (1)