Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Other Discussions
  3. The Weird and The Wonderful
  4. Perfect way to show a splash screen

Perfect way to show a splash screen

Scheduled Pinned Locked Moved The Weird and The Wonderful
sharepoint
11 Posts 10 Posters 1 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • V Offline
    V Offline
    Vladimir Svyatski
    wrote on last edited by
    #1

    I think, there is no need for comment :)

        private static void DoSplash()
        {
            SplashScreen sp = new SplashScreen();
            sp.ShowDialog();
    
            while (true)
            {
                Thread.Sleep(200);
            }
        }
    
    B C B R B 6 Replies Last reply
    0
    • V Vladimir Svyatski

      I think, there is no need for comment :)

          private static void DoSplash()
          {
              SplashScreen sp = new SplashScreen();
              sp.ShowDialog();
      
              while (true)
              {
                  Thread.Sleep(200);
              }
          }
      
      B Offline
      B Offline
      BobJanova
      wrote on last edited by
      #2

      :thumbsup:

      1 Reply Last reply
      0
      • V Vladimir Svyatski

        I think, there is no need for comment :)

            private static void DoSplash()
            {
                SplashScreen sp = new SplashScreen();
                sp.ShowDialog();
        
                while (true)
                {
                    Thread.Sleep(200);
                }
            }
        
        C Offline
        C Offline
        Chris Meech
        wrote on last edited by
        #3

        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]

        1 Reply Last reply
        0
        • V Vladimir Svyatski

          I think, there is no need for comment :)

              private static void DoSplash()
              {
                  SplashScreen sp = new SplashScreen();
                  sp.ShowDialog();
          
                  while (true)
                  {
                      Thread.Sleep(200);
                  }
              }
          
          B Offline
          B Offline
          BillW33
          wrote on last edited by
          #4

          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.

          J 1 Reply Last reply
          0
          • V Vladimir Svyatski

            I think, there is no need for comment :)

                private static void DoSplash()
                {
                    SplashScreen sp = new SplashScreen();
                    sp.ShowDialog();
            
                    while (true)
                    {
                        Thread.Sleep(200);
                    }
                }
            
            R Offline
            R Offline
            RobCroll
            wrote on last edited by
            #5

            I hope they implemented a "Please wait" message box when the user is forced to interact with the screen and close it :laugh:

            "You get that on the big jobs."

            1 Reply Last reply
            0
            • V Vladimir Svyatski

              I think, there is no need for comment :)

                  private static void DoSplash()
                  {
                      SplashScreen sp = new SplashScreen();
                      sp.ShowDialog();
              
                      while (true)
                      {
                          Thread.Sleep(200);
                      }
                  }
              
              B Offline
              B Offline
              Bernhard Hiller
              wrote on last edited by
              #6

              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?

              V 1 Reply Last reply
              0
              • B Bernhard Hiller

                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?

                V Offline
                V Offline
                Vladimir Svyatski
                wrote on last edited by
                #7

                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 calling Thread.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 :) .

                F M 2 Replies Last reply
                0
                • V Vladimir Svyatski

                  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 calling Thread.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 :) .

                  F Offline
                  F Offline
                  Firo Atrum Ventus
                  wrote on last edited by
                  #8

                  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 a Timer and Close(), the process will be caught in while 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

                  1 Reply Last reply
                  0
                  • V Vladimir Svyatski

                    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 calling Thread.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 :) .

                    M Offline
                    M Offline
                    Member 2053006
                    wrote on last edited by
                    #9

                    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.

                    1 Reply Last reply
                    0
                    • B BillW33

                      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.

                      J Offline
                      J Offline
                      Johann Gerell
                      wrote on last edited by
                      #10

                      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

                      1 Reply Last reply
                      0
                      • V Vladimir Svyatski

                        I think, there is no need for comment :)

                            private static void DoSplash()
                            {
                                SplashScreen sp = new SplashScreen();
                                sp.ShowDialog();
                        
                                while (true)
                                {
                                    Thread.Sleep(200);
                                }
                            }
                        
                        M Offline
                        M Offline
                        micmanos
                        wrote on last edited by
                        #11

                        Better one ... :laugh:

                        private static void DoSplash()
                        {
                        Interaction.Shell(Application.StartupPath + "\\splashscreen.exe", AppWinStyle.MaximizedFocus, true, -1)
                        }

                        .. and God help us all ;P

                        1 Reply Last reply
                        0
                        Reply
                        • Reply as topic
                        Log in to reply
                        • Oldest to Newest
                        • Newest to Oldest
                        • Most Votes


                        • Login

                        • Don't have an account? Register

                        • Login or register to search.
                        • First post
                          Last post
                        0
                        • Categories
                        • Recent
                        • Tags
                        • Popular
                        • World
                        • Users
                        • Groups