|
-
Nov 12th, 2008, 08:56 PM
#1
Thread Starter
Hyperactive Member
[2005] Making transparent Labels
Hi, I'm working on a project that needs to have transparent labels , since they are going to be on top of a PictureBox, I can make them transparent using this code :
Vb.net Code:
'So this changes the parent of the label, and the background becomes transparent
Label1.BackColor=Transparent
Label1.Parent=Image1
The labels are going to be dragged trough out the form, Being Image1 the control that will host the Labels, when they are being dragged it looks glitchy.
Here's something else i did, to make things go smoother:
Since i'm a WPF Developer i incorporated some WPF components to the app, since WPF controls don't have this kind of problems.
So, using a WPF canvas, the labels look really smooth, no glitch at all, but the problem using that is the background becomes white, the form's color.
Now what i want to know is how can i make truly transparent labels ?
Thanks
-
Nov 12th, 2008, 09:08 PM
#2
Re: [2005] Making transparent Labels
truly transparent labels aren't possible in vb.net - they were in vb6 though
- Coding Examples:
- Features:
- Online Games:
- Compiled Games:
-
Nov 12th, 2008, 09:14 PM
#3
Re: [2005] Making transparent Labels
To qualify .pauls.'s statement, the WinForms Label control doesn't support true transparency. A Label with its BackColor set to Transparent will simply draw its background using the area of its parent that it's covering. If the Label spans two controls then it can't draw the background of both. You'd have to create your own custom control, either by inheriting the Label or from scratch, and then handle drawing its background yourself based on everything behind it. Not a trivial matter.
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
|