1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
| using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Threading;
using System.Timers;
namespace MultiThing
{
public partial class FSplash : Form
{
public Thread chargementFonction;
public FSplash()
{
InitializeComponent();
chargementFonction = new Thread(chargement);
chargementFonction.Start();
}
private delegate void Afficher(string str, int charg);
public void chargement()
{
if (!this.IsHandleCreated) { this.CreateHandle(); }
this.Invoke(new Afficher(Affichertext), "Chargement des librairies...", 0);
Thread.Sleep(2000);
this.Invoke(new Afficher(Affichertext), "Chargement des fichiers...", 20);
Thread.Sleep(2000);
this.Invoke(new Afficher(Affichertext), "Chargement des plugins...", 40);
Thread.Sleep(2000);
this.Invoke(new Afficher(Affichertext), "Chargement des préférences utilisateurs...", 60);
Thread.Sleep(2000);
this.Invoke(new Afficher(Affichertext), "Mise en cache...", 80);
Thread.Sleep(2000);
this.Invoke(new Afficher(Affichertext), "C'est parti !", 100);
chargementFonction.Abort();
}
public void Affichertext(string str, int charg)
{
txtLoad.Text = str;
txtLoad.Refresh();
barLoad.Value = charg;
}
}
} |
Partager