Perfect way to show a splash screen
-
I think, there is no need for comment :)
private static void DoSplash() { SplashScreen sp = new SplashScreen(); sp.ShowDialog(); while (true) { Thread.Sleep(200); } }
-
I think, there is no need for comment :)
private static void DoSplash() { SplashScreen sp = new SplashScreen(); sp.ShowDialog(); while (true) { Thread.Sleep(200); } }
-
I think, there is no need for comment :)
private static void DoSplash() { SplashScreen sp = new SplashScreen(); sp.ShowDialog(); while (true) { Thread.Sleep(200); } }
What was someone thinking putting that while loop together. :doh: :doh: :doh: Splash screen or not, that code has found it's rightful home. :)
Chris Meech I am Canadian. [heard in a local bar] In theory there is no difference between theory and practice. In practice there is. [Yogi Berra] posting about Crystal Reports here is like discussing gay marriage on a catholic church’s website.[Nishant Sivakumar]
-
I think, there is no need for comment :)
private static void DoSplash() { SplashScreen sp = new SplashScreen(); sp.ShowDialog(); while (true) { Thread.Sleep(200); } }
-
I think, there is no need for comment :)
private static void DoSplash() { SplashScreen sp = new SplashScreen(); sp.ShowDialog(); while (true) { Thread.Sleep(200); } }
-
I think, there is no need for comment :)
private static void DoSplash() { SplashScreen sp = new SplashScreen(); sp.ShowDialog(); while (true) { Thread.Sleep(200); } }
Intuitive design, isn't it? You have to close the splash screen manually, and afterwards nothing happens, though the process still "lives" in TaskManager. Wonderful! By the way, haven't you found further gems in the SplashScreen class, e.g. showing the main window of the application?
-
Intuitive design, isn't it? You have to close the splash screen manually, and afterwards nothing happens, though the process still "lives" in TaskManager. Wonderful! By the way, haven't you found further gems in the SplashScreen class, e.g. showing the main window of the application?
SplashScreen class does not contain any user code, only Visual Studio generated stuff (i.e. only constructor with
InitializeComponent
). This splash screen is launched in some sort of background thread and is terminated later by callingThread.Abort
. Surely it doesn't quite work. Splash screen hangs in front of main window until you move a mouse. I'm just too ignorant to understand deep logic which is embedded inside all that :) . -
SplashScreen class does not contain any user code, only Visual Studio generated stuff (i.e. only constructor with
InitializeComponent
). This splash screen is launched in some sort of background thread and is terminated later by callingThread.Abort
. Surely it doesn't quite work. Splash screen hangs in front of main window until you move a mouse. I'm just too ignorant to understand deep logic which is embedded inside all that :) .There's really not much logic in this one. Just a simple trap for next developer. The idea is, when the next developer spot the use of
Thread.Abort
and replace it with aTimer
andClose()
, the process will be caught inwhile
loop. [edit]Why would someone downvote that? Have a 5 to counter it.Oxfords English < Official CCC Players Dictionary Excuse me for my improper grammar and typos. It's because English is my primary language, not my first language. My first languages are C# and Java. VB, ASP, JS, PHP and SQL are my second language. Indonesian came as my third language. My fourth language? I'm still creating it, I'll let you know when it's done! :-D
-
SplashScreen class does not contain any user code, only Visual Studio generated stuff (i.e. only constructor with
InitializeComponent
). This splash screen is launched in some sort of background thread and is terminated later by callingThread.Abort
. Surely it doesn't quite work. Splash screen hangs in front of main window until you move a mouse. I'm just too ignorant to understand deep logic which is embedded inside all that :) .So not only does it display a splash screen in a very bad way it also creates and displays a UI control on a non-UI thread. Classic.
-
That will definitely show a splash screen and make sure it stays around long enough for people to see it. ;) :laugh:
Just because the code works, it doesn't mean that it is good code.
Ohhh... but that we don't know. We can't see what the other threads, if any, are doing with windows popping up... :^)
Time you enjoy wasting is not wasted time - Bertrand Russel
-
I think, there is no need for comment :)
private static void DoSplash() { SplashScreen sp = new SplashScreen(); sp.ShowDialog(); while (true) { Thread.Sleep(200); } }