static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            VideoScanForm dlg = new VideoScanForm();

            dlg.ShowDialog();
        }
        private void ShowScanPopup()
        {
            this.Hide();

            try
            {
                // this block to create another instance to scan barcodes
                VideoScanForm popup = new VideoScanForm();
                // set new popup position shifted by 20 pixels
                popup.Left = this.Left + 20;
                popup.Top  = this.Top + 20;
                // set the new popup window to close on first found barcpde
                popup.CloseOnFirstBarcodeFound = true;
                // hide the btnTry button on new dialog window
                popup.btnTryPopup.Visible = false;
                popup.btnStop.Visible     = false;
                popup.btnStart.Visible    = false;

                // set the popup title
                popup.Text = "POPUP DIALOG - ONE TIME SCAN";

                // show the dialog
                if (popup.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                {
                    // checking if one time scan dialog found barcodes
                    if (popup.m_foundBarcodes != null && popup.m_foundBarcodes.Length > 0)
                    {
                        MessageBox.Show("Popup scan found the barcode:" + popup.m_foundBarcodes[0].Value, "POPUP RESULT");
                    }
                }
                else
                {
                    MessageBox.Show("Popup canceled! Returning to the main window");
                }

                // close the popup dialog
                popup.Close();
                // set to null
                popup = null;
            }
            finally
            {
                this.Visible = true;
            }
        }