G
Guest
I'm using VS 2003, C#.Net 2003.
I built a simple windows form app. with the following attributes:
- has a BackgroundImage set to a jpeg
I built a very simple user control that contains a picture box set to an
icon. The UserControl constructor sets
SetStyle( ControlStyles.SupportTransparentBackColor, true);
this.BackColor = Color.Transparent;
The control does nothing except display the icon.
In the main windows form, on formload event, I declare and instantiate 30
user controls and give them various locations on the main form.
The Problem: When the main form loads, displays or becomes active, there
are transparent (to the desktop) rectangles in locations where the user
controls are to be displayed. The transparent rectangles then fill in with
the mainform background image and the icons in the usercontrol.
I have identified this issue to be linked the BackColor = Color.Transparent.
If I set the BackColor to a color, this issue goes away. Offcourse, I now
have a solid box around my control
Is there a way keep the usercontrol backgroud transparent while eliminating
this annoying transparent rectangle issue?
I built a simple windows form app. with the following attributes:
- has a BackgroundImage set to a jpeg
I built a very simple user control that contains a picture box set to an
icon. The UserControl constructor sets
SetStyle( ControlStyles.SupportTransparentBackColor, true);
this.BackColor = Color.Transparent;
The control does nothing except display the icon.
In the main windows form, on formload event, I declare and instantiate 30
user controls and give them various locations on the main form.
The Problem: When the main form loads, displays or becomes active, there
are transparent (to the desktop) rectangles in locations where the user
controls are to be displayed. The transparent rectangles then fill in with
the mainform background image and the icons in the usercontrol.
I have identified this issue to be linked the BackColor = Color.Transparent.
If I set the BackColor to a color, this issue goes away. Offcourse, I now
have a solid box around my control
Is there a way keep the usercontrol backgroud transparent while eliminating
this annoying transparent rectangle issue?