-2

I'm trying to make an application using C++/CLI and being new, I found out that there's not much of an article about C++/CLI splash screens. Question is, how do you make/implement a splash screen in your C++/CLI code?

Joey
  • 53
  • 1
  • 9
  • You can do the as described here: [Splash Screen waiting until thread finishes](https://stackoverflow.com/a/393870/7444103) (same thing). Or, you can build your own class, inherit `ApplicationContext`, replace the methods you see in that answer with your own and, in `Main`, instead of running a new instance of a starting Form, you run your ApplicationContext. See the example in [Application.Run(System::Windows::Forms::ApplicationContext^ context)](https://learn.microsoft.com/en-us/dotnet/api/system.windows.forms.application.run) – Jimi Jun 15 '21 at 07:55

1 Answers1

-1

You could try the following code to implement splash screen in c++/cli.

Mainform:

public:
        MyForm(void)
        {
            Thread^ t = gcnew Thread(gcnew ThreadStart(this,&MyForm::StartForm));
            t->Start();
            Thread::Sleep(5000);
            InitializeComponent();
            t->Abort();
            
        
        }
    public:void StartForm()
    {
        Project1::SplashScreen form;
        Application::Run(% form);
    }

Result:

enter image description here

Jack J Jun
  • 5,633
  • 1
  • 9
  • 27