Fade in control in C#
-
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
-
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
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 -
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
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 -
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
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.
-
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, 2008I 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[^]
-
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[^]
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 -
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, 2008Like 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[^]
-
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[^]
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 -
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, 2008True. 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.