0

My problem is that my licensing form doesn't want to disappear when the license is already active on the system, so it does work because it does proceed to the next form, but it it further doesn't hide itself. So nou my login and License form is shown, is here any way someone can help me please?

Problem between ** ** I do believe.


    public partial class frmLicensing : Form
    {
        public static frmLicensing instance;
        public frmLicensing()
        {
            InitializeComponent();
            instance = this;

        }


        private void frmLicensing_Load(object sender, EventArgs e)
        {
            using (IsolatedStorageFile isolatedStorageFile = IsolatedStorageFile.GetStore(IsolatedStorageScope.User | IsolatedStorageScope.Assembly, null, null))
            {
                

                    using (IsolatedStorageFileStream isolatedStorageFileStream = new IsolatedStorageFileStream("Setting.txt", System.IO.FileMode.Open, isolatedStorageFile))
                    {
                        using (System.IO.StreamReader sr = new System.IO.StreamReader(isolatedStorageFileStream))
                        {
                            var Activated = Activation.isactive(sr.ReadLine());
                            if (!Activated)
                            {
                                this.Show();
                            }
                            else if(Activated == true)
                            {
                               

                             **   this.Hide();
                               FrmLogin form = new FrmLogin();
                                form.Show();  **
                              

                               

                            }


                        }
                    }
                

           

            }

  • Why Hide? Just Close it – Steve Nov 02 '22 at 08:49
  • However, better move the close logic in the Shown event to avoid flickering – Steve Nov 02 '22 at 08:50
  • Please take a look at this [thread](https://stackoverflow.com/questions/5548746/c-sharp-open-a-new-form-then-close-the-current-form). One of the answers has a great example with a Login window which is closed and afterwards the main window is shown which is what you should implement as well. –  Nov 02 '22 at 11:50

0 Answers0