Click here to Skip to main content
15,889,865 members
Home / Discussions / C#
   

C#

 
QuestionInvisible Form Labels [modified] Pin
#realJSOP30-Jul-08 6:12
mve#realJSOP30-Jul-08 6:12 
QuestionRe: Invisible Form Labels Pin
Wendelius30-Jul-08 7:07
mentorWendelius30-Jul-08 7:07 
AnswerRe: Invisible Form Labels Pin
#realJSOP30-Jul-08 7:28
mve#realJSOP30-Jul-08 7:28 
GeneralRe: Invisible Form Labels [modified] Pin
Wendelius30-Jul-08 7:39
mentorWendelius30-Jul-08 7:39 
GeneralRe: Invisible Form Labels Pin
#realJSOP30-Jul-08 7:47
mve#realJSOP30-Jul-08 7:47 
GeneralRe: Invisible Form Labels Pin
Wendelius30-Jul-08 8:09
mentorWendelius30-Jul-08 8:09 
AnswerRe: Invisible Form Labels Pin
DaveyM6930-Jul-08 9:35
professionalDaveyM6930-Jul-08 9:35 
GeneralRe: Invisible Form Labels Pin
#realJSOP30-Jul-08 10:43
mve#realJSOP30-Jul-08 10:43 
It's a splash panel that is displayed during program initialization. I use a BackgroundWorker object to instantiate/close the form. Here's the code for the worker thread:

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Xml;
using System.Threading;


namespace DownloadablePlayer
{
	public partial class vPopcornPlayer : Form
	{
		BackgroundWorker m_splashWorker = new BackgroundWorker();

		//--------------------------------------------------------------------------------
		/// <summary>
		/// Shows the splash screen while the program initializes itself.
		/// </summary>
		private void ShowSplashScreen()
		{
			m_splashWorker.WorkerReportsProgress = false;
			m_splashWorker.WorkerSupportsCancellation = true;
			m_splashWorker.DoWork += new System.ComponentModel.DoWorkEventHandler(splashWorker_DoWork);
			m_splashWorker.RunWorkerAsync();
		}

		//--------------------------------------------------------------------------------
		/// <summary>
		/// Closes/disposes the splash screen.
		/// </summary>
		private void HideSplashScreen()
		{
			if (m_splashWorker.IsBusy)
			{
				m_splashWorker.CancelAsync();
				// give the worker a chance to stop
				Thread.Sleep(500);
			}
		}

		//--------------------------------------------------------------------------------
		private void splashWorker_DoWork(object sender,DoWorkEventArgs e)
		{
			BackgroundWorker thisWorker = sender as BackgroundWorker;

			SplashPanel2 splashPanel = new SplashPanel2();
			splashPanel.Show();

			while (!thisWorker.CancellationPending)
			{
				Thread.Sleep(500);
			}

			splashPanel.Close();
			splashPanel.Dispose();
		}

	}
}


I call ShowSplashScreen() and HideSplashScreen() from a function elsewhere in the form. As you can see there's not a lot going on here. I fail to see why it won't work for me.

If I substitute splashPanel.Show() with splashPanel.ShowDialog(), the form is displayed, but then I can't seem to close it.

I hate .Net.


"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
-----
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001


GeneralRe: Invisible Form Labels Pin
DaveyM6930-Jul-08 11:45
professionalDaveyM6930-Jul-08 11:45 
GeneralRe: Invisible Form Labels Pin
#realJSOP30-Jul-08 12:05
mve#realJSOP30-Jul-08 12:05 
GeneralRe: Invisible Form Labels Pin
#realJSOP31-Jul-08 3:37
mve#realJSOP31-Jul-08 3:37 
QuestionHow to Update MDB file? Pin
Admin88730-Jul-08 5:20
Admin88730-Jul-08 5:20 
AnswerRe: How to Update MDB file? Pin
Yusuf30-Jul-08 5:32
Yusuf30-Jul-08 5:32 
AnswerRe: How to Update MDB file? Pin
ElSpinos30-Jul-08 5:33
ElSpinos30-Jul-08 5:33 
QuestionSlides View Control Pin
breandan30-Jul-08 4:40
breandan30-Jul-08 4:40 
AnswerRe: Slides View Control Pin
Simon P Stevens30-Jul-08 5:37
Simon P Stevens30-Jul-08 5:37 
QuestionHow can i save event logs using C# ? Pin
Abhijit Jana30-Jul-08 3:55
professionalAbhijit Jana30-Jul-08 3:55 
AnswerRe: How can i save event logs using C# ? [modified] Pin
ElSpinos30-Jul-08 4:15
ElSpinos30-Jul-08 4:15 
GeneralRe: How can i save event logs using C# ? Pin
Tuwing.Sabado30-Jul-08 4:35
Tuwing.Sabado30-Jul-08 4:35 
GeneralRe: How can i save event logs using C# ? Pin
Abhijit Jana30-Jul-08 5:24
professionalAbhijit Jana30-Jul-08 5:24 
GeneralRe: How can i save event logs using C# ? Pin
ElSpinos30-Jul-08 5:45
ElSpinos30-Jul-08 5:45 
GeneralRe: How can i save event logs using C# ? Pin
Abhijit Jana30-Jul-08 6:56
professionalAbhijit Jana30-Jul-08 6:56 
Questionsetting printer options Pin
cmarmr30-Jul-08 2:48
cmarmr30-Jul-08 2:48 
AnswerRe: setting printer options Pin
DaveyM6930-Jul-08 3:14
professionalDaveyM6930-Jul-08 3:14 
QuestionAfter form load Auto close window Pin
Member 387988130-Jul-08 2:38
Member 387988130-Jul-08 2:38 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.