Example #1
0
        /// <summary>
        /// Base constructor
        /// </summary>
        public SplashScreenForm(SplashScreenOptions options)
        {
            if (options != null)
                this.options = options;
            else
                this.options = new SplashScreenOptions();
            InitializeComponent();
            this.label1.Parent = this.pictureBox1;
            this.label1.BackColor = Color.Transparent;
            label1.ForeColor = options.SuccessColor;
            this.TransparencyKey = options.TransparencyColor;
            this.BackColor = options.BackgroundColor;
            this.label1.Text = options.StartingText;
            this.Text = "Loading... ";
            if (options.SplashScreenImage != null)
            {
                this.pictureBox1.Image = options.SplashScreenImage;
            }
            if(this.pictureBox1.Image != null)
            {
                Size size = this.pictureBox1.Image.Size;
                size.Height += this.progressBar1.Height;
                this.Size = size;
            }

            progressBar1.Show();
        }
Example #2
0
        /// <summary>
        /// Base constructor
        /// </summary>
        public SplashScreenForm(SplashScreenOptions options)
        {
            if (options != null)
            {
                this.options = options;
            }
            else
            {
                this.options = new SplashScreenOptions();
            }
            InitializeComponent();
            this.label1.Parent    = this.pictureBox1;
            this.label1.BackColor = Color.Transparent;
            label1.ForeColor      = options.SuccessColor;
            this.TransparencyKey  = options.TransparencyColor;
            this.BackColor        = options.BackgroundColor;
            this.label1.Text      = options.StartingText;
            this.Text             = "Loading... ";
            if (options.SplashScreenImage != null)
            {
                this.pictureBox1.Image = options.SplashScreenImage;
            }
            if (this.pictureBox1.Image != null)
            {
                Size size = this.pictureBox1.Image.Size;
                size.Height += this.progressBar1.Height;
                this.Size    = size;
            }

            progressBar1.Show();
        }
Example #3
0
 public static void StartSplashScreen(Form mainForm, SplashScreenOptions options)
 {
     callingForm = mainForm;
     formTitle = callingForm.Text;
     callingForm.Hide();
     Thread splashthread = new Thread(new ParameterizedThreadStart(SplashScreen.ShowSplashScreen));
     splashthread.IsBackground = true;
     splashthread.Start(options);
     Thread.Sleep(100);
     callingForm.Activate();
 }
Example #4
0
        public static void StartSplashScreen(Form mainForm, SplashScreenOptions options)
        {
            callingForm = mainForm;
            formTitle   = callingForm.Text;
            callingForm.Hide();
            Thread splashthread = new Thread(new ParameterizedThreadStart(SplashScreen.ShowSplashScreen));

            splashthread.IsBackground = true;
            splashthread.Start(options);
            Thread.Sleep(100);
            callingForm.Activate();
        }
Example #5
0
 /// <summary>
 /// Displays the splashscreen
 /// </summary>
 static void ShowSplashScreen(object param)
 {
     if (sf == null)
     {
         SplashScreenOptions options;
         if (param is SplashScreenOptions)
         {
             options = param as SplashScreenOptions;
         }
         else
         {
             options = new SplashScreenOptions();
         }
         sf = new SplashScreenForm(options);
         sf.ShowSplashScreen();
     }
 }
Example #6
0
 /// <summary>
 /// Displays the splashscreen
 /// </summary>
 static void ShowSplashScreen(object param)
 {
     if (sf == null)
     {
         SplashScreenOptions options;
         if (param is SplashScreenOptions)
             options = param as SplashScreenOptions;
         else
             options = new SplashScreenOptions();
         sf = new SplashScreenForm(options);
         sf.ShowSplashScreen();
     }
 }