There are two forms: one - the main work area, the second - splash screen. The code is as follows (main functions: timer and constructor of the main form):

Main form constructor:

this->Hide(); SimpleReplacment::SplashScreen^ splashScreen = gcnew SimpleReplacment::SplashScreen(); splashScreen->Show(); if (splashScreen->Opacity <= 0) { delete splashScreen; this->Show(); } 

Timer splash screen:

  this->Opacity -= 0.05; if (this->Opacity <= 0) { timer_loading->Enabled = false; this->Enabled = false; this->Close(); } 

The problem is that when loading the main form, it appears immediately, because the condition is one-time, but if I loop over the code block with the condition, then the code of the side form will not be executed. What should be done?

    1 answer 1

    Why do not you immediately open the splash screen when you start the application, which (upon completion of the timer ...) will open the main form? Splash screen:

      this->Opacity -= 0.05; if (this->Opacity <= 0) { timer_loading->Enabled = false; MainForm->Show(); // like this this->Enabled = false; this->Close(); } 

    And in the project settings, specify that the launch was from another form.