views:

49

answers:

0
private nForm_Load (_ : object,  _ : System.EventArgs) : void
{
        mutable procent : double = 0;
        SplashScreen.BeginDisplay();
        for (mutable i : int = 0; i <= 100; i++)
        {
            procent = i;
            SplashScreen.SetTitle("Загрузка");
            SplashScreen.SetCurrentTitle("Loading : " + Math.Ceiling(procent).ToString() + "%");
            Application.DoEvents();
            Thread.Sleep(50);
        } 
        Thread.Sleep(100);
        SplashScreen.EndDisplay();
}

This way I load splash screen but it fails in drawing after ~20% so I think I need to make it in separated thread ?

it's Nemerle but it's easy convert to C#

Sure I found some example

Thread th = new Thread(new ThreadStart(DoSplash));
th.Start();
Thread.Sleep(3000);
th.Abort();

but what is my "DoSplash" ?

Maybe ThreadStart(SplashScreen.BeginDisplay()); ?