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. Fade in control in C#

Fade in control in C#

Scheduled Pinned Locked Moved C#
csharpwinformsquestion
9 Posts 4 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.
  • C Offline
    C Offline
    Chazzysb
    wrote on last edited by
    #1

    Hi, VS2005 Winforms. Im creating a form which has a panel which can hold a number of different user controls. The user control to display is decided at runtime. To give a more professional look I want the user controls to fade into view. Ive seen how this is possible on winforms using the opacity property. Is there any way of achieving this on user controls also? Many thanks, Chas

    realJSOPR D C 3 Replies Last reply
    0
    • C Chazzysb

      Hi, VS2005 Winforms. Im creating a form which has a panel which can hold a number of different user controls. The user control to display is decided at runtime. To give a more professional look I want the user controls to fade into view. Ive seen how this is possible on winforms using the opacity property. Is there any way of achieving this on user controls also? Many thanks, Chas

      realJSOPR Offline
      realJSOPR Offline
      realJSOP
      wrote on last edited by
      #2

      Maybe you could create a bitmap that has the background color of the form, position it over the control, and fade the bitmap off (instead of fading the control on).

      "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

      1 Reply Last reply
      0
      • C Chazzysb

        Hi, VS2005 Winforms. Im creating a form which has a panel which can hold a number of different user controls. The user control to display is decided at runtime. To give a more professional look I want the user controls to fade into view. Ive seen how this is possible on winforms using the opacity property. Is there any way of achieving this on user controls also? Many thanks, Chas

        D Offline
        D Offline
        Dave Kreskowiak
        wrote on last edited by
        #3

        The Opacity property only works for an entire form, not individual controls.

        A guide to posting questions on CodeProject[^]
        Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
             2006, 2007, 2008

        P 1 Reply Last reply
        0
        • C Chazzysb

          Hi, VS2005 Winforms. Im creating a form which has a panel which can hold a number of different user controls. The user control to display is decided at runtime. To give a more professional look I want the user controls to fade into view. Ive seen how this is possible on winforms using the opacity property. Is there any way of achieving this on user controls also? Many thanks, Chas

          C Offline
          C Offline
          Chazzysb
          wrote on last edited by
          #4

          Ok I found I need to use WPF to do this correctly... However i managed to simulate what I want by doing the following: Create a tiny fading form with A FormBorderStyle property set to None and a ControlBox property set to False. When user control is placed on the screen, calculate the position and size and display the fading form on top which fades out of existence and closes. The only issue is that the current form looses focus - but this isnt too much of a problem as the user control fills out most of the form.

          1 Reply Last reply
          0
          • D Dave Kreskowiak

            The Opacity property only works for an entire form, not individual controls.

            A guide to posting questions on CodeProject[^]
            Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
                 2006, 2007, 2008

            P Offline
            P Offline
            perryf_00
            wrote on last edited by
            #5

            I would think there's a way to get opacity to work at a control level. I use Infragistics controls and I've never had a problem on any controls I've used to get the form background to show thru. I just did a quick google, and this shows one way to do it: http://www.longhorncorner.com/UploadFile/sowba/108252005014532AM/1.aspx?ArticleID=317c80c6-8656-4635-bd7f-39b896768467[^]

            D 1 Reply Last reply
            0
            • P perryf_00

              I would think there's a way to get opacity to work at a control level. I use Infragistics controls and I've never had a problem on any controls I've used to get the form background to show thru. I just did a quick google, and this shows one way to do it: http://www.longhorncorner.com/UploadFile/sowba/108252005014532AM/1.aspx?ArticleID=317c80c6-8656-4635-bd7f-39b896768467[^]

              D Offline
              D Offline
              Dave Kreskowiak
              wrote on last edited by
              #6

              That works in WPF, not Windows Forms. There's a (huge) difference...

              A guide to posting questions on CodeProject[^]
              Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
                   2006, 2007, 2008

              P 1 Reply Last reply
              0
              • D Dave Kreskowiak

                That works in WPF, not Windows Forms. There's a (huge) difference...

                A guide to posting questions on CodeProject[^]
                Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
                     2006, 2007, 2008

                P Offline
                P Offline
                perryf_00
                wrote on last edited by
                #7

                Like I said it was a quick search. Here's a link where WPF is not even mentioned. And it is not easy to do, but I know there is a way since several 3rd party control libraries do support transparent controls: https://dotnetcentral.net/Weblog/posts/247977.aspx[^]

                D 1 Reply Last reply
                0
                • P perryf_00

                  Like I said it was a quick search. Here's a link where WPF is not even mentioned. And it is not easy to do, but I know there is a way since several 3rd party control libraries do support transparent controls: https://dotnetcentral.net/Weblog/posts/247977.aspx[^]

                  D Offline
                  D Offline
                  Dave Kreskowiak
                  wrote on last edited by
                  #8

                  Oh I know it can be done, just not without writing your own drawing code for each control you want to be transparent. That's quite a lot of work for something that's rarely a functional requirement.

                  A guide to posting questions on CodeProject[^]
                  Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
                       2006, 2007, 2008

                  P 1 Reply Last reply
                  0
                  • D Dave Kreskowiak

                    Oh I know it can be done, just not without writing your own drawing code for each control you want to be transparent. That's quite a lot of work for something that's rarely a functional requirement.

                    A guide to posting questions on CodeProject[^]
                    Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
                         2006, 2007, 2008

                    P Offline
                    P Offline
                    perryf_00
                    wrote on last edited by
                    #9

                    True. But in our case we need something wizbang as we are a startup in an established niche industry. Taking advantage of some of the drawing capabilities that a 3rd party library offers gives us a nice visual impact on startup of the app. Hopefully we will be able to match impact with the rest of the app.

                    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