Creating A Transparent Label UserControl
Using VB6, can I make a UserControl Form (OCX) transparent?
I want to make put a label on it too.
I am making (trying to anyways) a transparent label OCX that I can convert to .NET that will work on picturebox and panels that have pictures in them.
And if I can make the UserControl transparent... will it work with Win9x. I know transparency work on XP.
Thanks
Re: Transparent UserControl??
There is a transparency Property available on any new ActiveX Control.
1 Attachment(s)
Re: Creating A Transparent Label UserControl
Okay... I have an OCX going in VB6.
I can set the caption text... that works.
Problem..
But the text does not show when I set the control to transparency. But it shows when the control has an opaque backstyle.
This is how I have made the OCX...
I put label on UserControl with the setting of transparency.
Ran OCX wizard.
I allowed the UC to handle the backstyle (transparent - opaque.)
I assume the label will always be transparent cause I set it that way
Why is my text not showing when the control (UserControl) is set to transparceny in design and run time mode??
.
Re: Creating A Transparent Label UserControl
Just a few feet away from solving this...
I found out what is wromg with the control, but don't know how to fix or even why it is doing this...
The Usercontrol (ocx form) stays transparent... that's cool
But when the Label's (which is on the UC) BackStyle is set to "Transparency" it makes the entire label transparent... text and all.
But when the label is set to Opaque... you can see backcolor and text.
I only want to see the text ... no back color.
So something is wrong with the BackStyle property.
I tried various configurations with borderstyle, Appearance etc,..
But it is that Backstyle that is the problem.
Anyone know why?
Thanks
Re: Creating A Transparent Label UserControl
Well... I have dicovered more...
When you put a label on a UserControl (UC) and set it to transparency, the UC has to redraw the label because it is a lightweight ctrl. Therefore the text gets wiped out and then redraw on the UC.
But the only way this will work is to use TrueTypeFonts for the label. MS SanSerif will not show up on the control. It's a system text.
So, I got it to work!!! Yeepie!
Hold on... not so fast.
Another problem....
When the UC redraws the TTFont it appears jaggie with white pixels here and there around the font.
The only way to make the white pixels disappear is to set the Label forecolor and UC backcolor the same....
Great... that works!
But... they only thing that bugs me now is the entire text looks jaggie still... kinda like the text was put on with PaintBrush or something. No anti-Alias text.
What a bummer!!
Now what do I do?
I got the control to work but it dosn't look good!
AARRRRHHHHHHH
:mad:
.
Re: Creating A Transparent Label UserControl
If you are porting this to .net (using the project convertor?? Good luck with that buddy :)) then you may be able to use the Graphics.SmoothingMode = AntiAlias and compositing modes to produce nicer text output.
Re: Creating A Transparent Label UserControl
I am making this control in VB6. A transparent label can not be made in .NET. Doesn't support transparent lables on other controls... only forms
I am going to wrap the OCX in a DLL using aximp.exe (from the framework SDK)
Is this method available in vb6?
Re: Creating A Transparent Label UserControl
Well...
Woosname has let me know that a transparent label is possible in .NET
He is working on it
Re: Creating A Transparent Label UserControl
Here ia transparent label that Wossname and RobDogg are working on..
http://www.vbforums.com/showthread.php?t=330311