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. General Programming
  3. C#
  4. How to make screen become gray/dark slowly?

How to make screen become gray/dark slowly?

Scheduled Pinned Locked Moved C#
csharptutorialquestion
12 Posts 5 Posters 0 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.
  • D Offline
    D Offline
    daveice
    wrote on last edited by
    #1

    For a WinForm application using C#, how to make the form become gray/dark slowly when pop up a dialog? Like XP does when user is going to shut down computer. Thanks in advance.

    A J 2 Replies Last reply
    0
    • D daveice

      For a WinForm application using C#, how to make the form become gray/dark slowly when pop up a dialog? Like XP does when user is going to shut down computer. Thanks in advance.

      A Offline
      A Offline
      Abhishek Sur
      wrote on last edited by
      #2

      Just open a form maximized with no Titlebar. Make the background of the form black. Use Opacity of the form below 50, and show the dialog above the form. I think you will find the same effect. ;)

      Abhishek Sur **Don't forget to click "Good Answer" if you like this Solution.


      My Latest Articles-->** Simplify Code Using NDepend
      Basics of Bing Search API using .NET
      Microsoft Bing MAP using Javascript

      1 Reply Last reply
      0
      • D daveice

        For a WinForm application using C#, how to make the form become gray/dark slowly when pop up a dialog? Like XP does when user is going to shut down computer. Thanks in advance.

        J Offline
        J Offline
        J a a n s
        wrote on last edited by
        #3

        Check this article A modal dialog that fades the background to gray-scale imitating the XP shutdown screen[^]

        "Never put off until run time what you can do at compile time." - David Gries, in "Compiler Construction for Digital Computers", circa 1969.

        A 1 Reply Last reply
        0
        • J J a a n s

          Check this article A modal dialog that fades the background to gray-scale imitating the XP shutdown screen[^]

          "Never put off until run time what you can do at compile time." - David Gries, in "Compiler Construction for Digital Computers", circa 1969.

          A Offline
          A Offline
          Abhishek Sur
          wrote on last edited by
          #4

          Is it at all required to produce Grayscale using Bitmap when you can do this easily using Opacity of a form ?? :doh:

          Abhishek Sur **Don't forget to click "Good Answer" if you like this Solution.


          My Latest Articles-->** Simplify Code Using NDepend
          Basics of Bing Search API using .NET
          Microsoft Bing MAP using Javascript

          D 1 Reply Last reply
          0
          • A Abhishek Sur

            Is it at all required to produce Grayscale using Bitmap when you can do this easily using Opacity of a form ?? :doh:

            Abhishek Sur **Don't forget to click "Good Answer" if you like this Solution.


            My Latest Articles-->** Simplify Code Using NDepend
            Basics of Bing Search API using .NET
            Microsoft Bing MAP using Javascript

            D Offline
            D Offline
            dan sh
            wrote on last edited by
            #5

            How can you turn other windows gray by setting opacity of the form?

            50-50-90 rule: Anytime I have a 50-50 chance of getting something right, there's a 90% probability I'll get it wrong...!!

            A 1 Reply Last reply
            0
            • D dan sh

              How can you turn other windows gray by setting opacity of the form?

              50-50-90 rule: Anytime I have a 50-50 chance of getting something right, there's a 90% probability I'll get it wrong...!!

              A Offline
              A Offline
              Abhishek Sur
              wrote on last edited by
              #6

              Just place the transparent form(with black background) over all other window and set opacity to a value less than 50%... maybe it could animate the opacity from 0 to 50.... It will be done automatically... :)

              Abhishek Sur **Don't forget to click "Good Answer" if you like this Solution.


              My Latest Articles-->** Simplify Code Using NDepend
              Basics of Bing Search API using .NET
              Microsoft Bing MAP using Javascript

              T D 2 Replies Last reply
              0
              • A Abhishek Sur

                Just place the transparent form(with black background) over all other window and set opacity to a value less than 50%... maybe it could animate the opacity from 0 to 50.... It will be done automatically... :)

                Abhishek Sur **Don't forget to click "Good Answer" if you like this Solution.


                My Latest Articles-->** Simplify Code Using NDepend
                Basics of Bing Search API using .NET
                Microsoft Bing MAP using Javascript

                T Offline
                T Offline
                Tom Deketelaere
                wrote on last edited by
                #7

                Abhishek Sur wrote:

                It will be done automatically...

                Actually no. Just tested it and you can still see the colors of the underlaying windows. All this does is put a grayish 'film' over it but the colors of any window behind it are still very visible.

                A 1 Reply Last reply
                0
                • A Abhishek Sur

                  Just place the transparent form(with black background) over all other window and set opacity to a value less than 50%... maybe it could animate the opacity from 0 to 50.... It will be done automatically... :)

                  Abhishek Sur **Don't forget to click "Good Answer" if you like this Solution.


                  My Latest Articles-->** Simplify Code Using NDepend
                  Basics of Bing Search API using .NET
                  Microsoft Bing MAP using Javascript

                  D Offline
                  D Offline
                  dan sh
                  wrote on last edited by
                  #8

                  No. That wont turn the title bar of the windows behind to gray. Background windows will still be olive green (as per my system settings). You need to use similar mechanism as what XP uses or digg in to Nish's article. Since it is in C++, I don't get much out of it.

                  50-50-90 rule: Anytime I have a 50-50 chance of getting something right, there's a 90% probability I'll get it wrong...!!

                  A 1 Reply Last reply
                  0
                  • T Tom Deketelaere

                    Abhishek Sur wrote:

                    It will be done automatically...

                    Actually no. Just tested it and you can still see the colors of the underlaying windows. All this does is put a grayish 'film' over it but the colors of any window behind it are still very visible.

                    A Offline
                    A Offline
                    Abhishek Sur
                    wrote on last edited by
                    #9

                    Ohh... is it .. Thanks for letting me know this. I didnt tried that. Thought it would be done this way. Cheers.:rose:

                    Abhishek Sur **Don't forget to click "Good Answer" if you like this Solution.


                    My Latest Articles-->** Simplify Code Using NDepend
                    Basics of Bing Search API using .NET
                    Microsoft Bing MAP using Javascript

                    1 Reply Last reply
                    0
                    • D dan sh

                      No. That wont turn the title bar of the windows behind to gray. Background windows will still be olive green (as per my system settings). You need to use similar mechanism as what XP uses or digg in to Nish's article. Since it is in C++, I don't get much out of it.

                      50-50-90 rule: Anytime I have a 50-50 chance of getting something right, there's a 90% probability I'll get it wrong...!!

                      A Offline
                      A Offline
                      Abhishek Sur
                      wrote on last edited by
                      #10

                      d@nish wrote:

                      Since it is in C++, I don't get much out of it.

                      You might look this then http://techneighbour.co.cc/blog/2009/09/dialogbox-imitating-windows-shutdown-dialog/[^] Well... But there is lots of Double buffering, Timers, Bitmaps etc. I think this would be a lots of load for this simple task. :laugh: :laugh: . dont you think ? :^) Anyway, I agree background colors will appear as it is for my solution... ;P

                      Abhishek Sur **Don't forget to click "Good Answer" if you like this Solution.


                      My Latest Articles-->** Simplify Code Using NDepend
                      Basics of Bing Search API using .NET
                      Microsoft Bing MAP using Javascript

                      D 1 Reply Last reply
                      0
                      • A Abhishek Sur

                        d@nish wrote:

                        Since it is in C++, I don't get much out of it.

                        You might look this then http://techneighbour.co.cc/blog/2009/09/dialogbox-imitating-windows-shutdown-dialog/[^] Well... But there is lots of Double buffering, Timers, Bitmaps etc. I think this would be a lots of load for this simple task. :laugh: :laugh: . dont you think ? :^) Anyway, I agree background colors will appear as it is for my solution... ;P

                        Abhishek Sur **Don't forget to click "Good Answer" if you like this Solution.


                        My Latest Articles-->** Simplify Code Using NDepend
                        Basics of Bing Search API using .NET
                        Microsoft Bing MAP using Javascript

                        D Offline
                        D Offline
                        dan sh
                        wrote on last edited by
                        #11

                        Well, if you need replica of XP feature, AFAIK you got two ways: 1. Find how windows does that and maybe P/Invoke the dll. 2. Use what is there in the article. If you can settle with ModalPopUp (Ajax) like background, use a Panel and play with its AlphaGradient. Or use a new form as you suggested.

                        50-50-90 rule: Anytime I have a 50-50 chance of getting something right, there's a 90% probability I'll get it wrong...!!

                        A 1 Reply Last reply
                        0
                        • D dan sh

                          Well, if you need replica of XP feature, AFAIK you got two ways: 1. Find how windows does that and maybe P/Invoke the dll. 2. Use what is there in the article. If you can settle with ModalPopUp (Ajax) like background, use a Panel and play with its AlphaGradient. Or use a new form as you suggested.

                          50-50-90 rule: Anytime I have a 50-50 chance of getting something right, there's a 90% probability I'll get it wrong...!!

                          A Offline
                          A Offline
                          Abhishek Sur
                          wrote on last edited by
                          #12

                          Right... :rose:

                          Abhishek Sur **Don't forget to click "Good Answer" if you like this Solution.


                          My Latest Articles-->** Simplify Code Using NDepend
                          Basics of Bing Search API using .NET
                          Microsoft Bing MAP using Javascript

                          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