We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Making a user control transparent

Hi, I am trying to create a user control and I want to set its background to be transparent; however, when I do this I get an error "This control does not support transparent background colors." I have been looking around for how to enable transparent backgrounds for a user control with no luck. I have tried a number of things by overriding "OnPaintBackground"; however, none of them have worked and I end up with garbage leaking thru from somewhere else even though the control my user control is a child of has a background. The reason I want to do this is I am using the syncfusion tab control and I am using themes. I want to be able to place my user control on the tab page and have the theme background show through behind labels and other controls on my user control. Thank you, Jon

3 Replies

RH Rik Hemsley October 6, 2004 05:24 AM

Try changing the FlatStyle property of your UserControl. I know if you set the FlatStyle of a Label back to Standard when it was System, you can then set a transparent background colour.


AD Administrator Syncfusion Team April 17, 2005 01:04 PM

>Hi, > >I am trying to create a user control and I want to set its background to be transparent; however, when I do this I get an error "This control does not support transparent background colors." I have been looking around for how to enable transparent backgrounds for a user control with no luck. I have tried a number of things by overriding "OnPaintBackground"; however, none of them have worked and I end up with garbage leaking thru from somewhere else even though the control my user control is a child of has a background. > >The reason I want to do this is I am using the syncfusion tab control and I am using themes. I want to be able to place my user control on the tab page and have the theme background show through behind labels and other controls on my user control. > > >Thank you, >Jon


MA Mayank July 13, 2007 09:20 AM

Hi Rik,
I am trying to make background of UserControl transparent, but after trying hard i never found anything which solve it. It seems to me that you are having some clue as per your message like "FlateStyle". Please let me know if you have something which help me to come out from this problem.

Thanks in Advance




>Try changing the FlatStyle property of your UserControl. I know if you set the FlatStyle of a Label back to Standard when it was System, you can then set a transparent background colour.

Loader.
Live Chat Icon For mobile
Up arrow icon