|
-
Feb 27th, 2003, 01:28 PM
#1
Thread Starter
New Member
Transparent User Control
Hi all,
My problem is this, is it possible to set the background colour of the form within a user control to transparent as there is on opacity property and the TransparentKey function doesn't work. Can anyone help.
Thanks In Advance
ICE32 - "Lee"
-
Feb 28th, 2003, 12:01 AM
#2
Frenzied Member
Instead of trying to explain it, take a look at the comments i have in my sample app:
VB Code:
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'Set the Form.TransparencyKey property to the same as the colour you want to disappear.
'This tells the form not to paint any pixels that match the color of the TransparencyKey.
'The BackgroundImage property of the form is set to a Bitmap with a colour you want removed.
'Then the TransparencyKey property is set to the same colour (ie: Color.Lime), then all the pixels in the bitmap
'that are Lime ( RGB(255,0,0)) will be transparent.
End Sub
~Peter

-
Feb 28th, 2003, 02:39 AM
#3
Thread Starter
New Member
The thing is that this method doesn't work with a user control, there is not TransparentKey property.
Any other solution would be great
Thanks In Advance
Lee
-
Feb 28th, 2003, 10:51 AM
#4
Frenzied Member
By user control do you mean a control such as a label? 
There is a transparentcy aspect with controls:
VB Code:
Private Sub btnMakeTransparent_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnMakeTransparent.Click
'This can be set in the properties window by selecting the Web tab of the backColor property
lblMakeTransparent.BackColor = System.Drawing.Color.Transparent
End Sub
~Peter

-
Feb 28th, 2003, 06:26 PM
#5
Thread Starter
New Member
No i mean a user control as in when you go to the project option on the menu and select Add User Control. The web transparence doesn't work either.
the user control is
system.windows.forms.usercontrol
Hope this information helps
lee
-
Mar 2nd, 2003, 10:45 PM
#6
-
Mar 3rd, 2003, 06:29 AM
#7
Thread Starter
New Member
Ok thanks for your attempt. If there is anyone out there that can help please do.
thanks In Advance
Lee
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|