G
Grahammer
Is it possible to set the background of a usercontrol as transparent?
I tried setting the background image of the usercontrol to a transparent
GIF, but that caused MAJOR problems.
I'm making some controls that aren't rectangular and it won't be pretty if I
end up with a grey rectangle behind each one.
http://msdn.microsoft.com/library/e...urControlTransparentBackground.asp?frame=true
This link says that it should be simple to create a usercontrol with a
transparent background, and Herfried has suggested the same, but the control
still has a grey background. Basically I'm creating a button with four
images (normal, mouseover, pushed and disabled) and I want the transparent
parts of the image to show the form/controls/etc. that are below the button.
This will allow for round, oval or any other shaped button that I can draw.
The code is done and working, except for this transparency issue.
To test I've done the following:
- Created a new UserControl
- Added the following two lines to the Public Sub New() subroutine (I'm
assuming that this is the "constructor" that is mentioned in the MSDN
support page)
- Save all files
- Did a build on the control
- Added the control to a Form.
- Ran the project.
....the user control is still "control" grey and is not transparent...
Why is this happening? I didn't have this problem when using VB6. Is there a
work around?
I tried setting the background image of the usercontrol to a transparent
GIF, but that caused MAJOR problems.
I'm making some controls that aren't rectangular and it won't be pretty if I
end up with a grey rectangle behind each one.
http://msdn.microsoft.com/library/e...urControlTransparentBackground.asp?frame=true
This link says that it should be simple to create a usercontrol with a
transparent background, and Herfried has suggested the same, but the control
still has a grey background. Basically I'm creating a button with four
images (normal, mouseover, pushed and disabled) and I want the transparent
parts of the image to show the form/controls/etc. that are below the button.
This will allow for round, oval or any other shaped button that I can draw.
The code is done and working, except for this transparency issue.
To test I've done the following:
- Created a new UserControl
- Added the following two lines to the Public Sub New() subroutine (I'm
assuming that this is the "constructor" that is mentioned in the MSDN
support page)
- Save all files
- Did a build on the control
- Added the control to a Form.
- Ran the project.
....the user control is still "control" grey and is not transparent...
Why is this happening? I didn't have this problem when using VB6. Is there a
work around?