|
-
Apr 5th, 2004, 07:38 AM
#1
Thread Starter
Frenzied Member
how to make a label box transparent
dear all,
I am making my first software application using dot net ( VB) after using old versions of VB for 5 years. so i am a little bit experienced.
what i want to do is very simple, I want to use a label box with transparent background.
We usually do it in vb6 with backstyle property.
Likely it is not found here.
Could anyone tell me how to do it.
THX in advance
-
Apr 5th, 2004, 09:18 AM
#2
Junior Member
click the label control and look in the property sheet, the backcolor property has a transparency setting
www.mod2software.com
Home of the VB.NET Class Builder Utility - Demo and Full versions available now!
-
Jul 26th, 2005, 07:39 PM
#3
Junior Member
Re: how to make a label box transparent
Insert a Panel control in your form having transparent backcolor.
Place a Label inside the panel and the label will be transparent.
-
Jul 26th, 2005, 08:41 PM
#4
Lively Member
Re: how to make a label box transparent
Hi Oreo,
The way you suggest that put the label on one panel seems doesn't work. What I want to do is put one label on one picturebox and same times make the label transparent, not to block the picture.
Thanks for help in advance.
Robert
-
Jul 26th, 2005, 10:11 PM
#5
Re: how to make a label box transparent
search the codebank
wossname made a transparent label control
rate my posts if they help ya!
Extract thumbnail without reading the whole image file: (C# - VB)
Apply texture to bitmaps: (C# - VB)
Extended console library: (VB)
Save JPEG with a certain quality (image compression): (C# - VB )
VB.NET to C# conversion tips!!
-
Jul 26th, 2005, 10:18 PM
#6
Junior Member
Re: Try this
What i did was i set the background image of the form itself with the picture, and added a panel control having the same size of the form - transparent backcolor, then added labels inside the panel.
-
Jul 26th, 2005, 10:51 PM
#7
Re: how to make a label box transparent
 Originally Posted by MrPolite
search the codebank
wossname made a transparent label control
Ahemmm, its was a joint effort. 
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Jul 27th, 2005, 04:48 AM
#8
Re: how to make a label box transparent
I was never satisfied with that transparent label, too jaggy. Irrevocably jaggy in fact, no way to smooth it. Worked better with big fonts.
I don't live here any more.
-
Jul 27th, 2005, 12:38 PM
#9
Re: how to make a label box transparent
rate my posts if they help ya!
Extract thumbnail without reading the whole image file: (C# - VB)
Apply texture to bitmaps: (C# - VB)
Extended console library: (VB)
Save JPEG with a certain quality (image compression): (C# - VB )
VB.NET to C# conversion tips!!
-
Jul 27th, 2005, 12:57 PM
#10
Fanatic Member
Re: how to make a label box transparent
 Originally Posted by wossname
I was never satisfied with that transparent label, too jaggy. Irrevocably jaggy in fact, no way to smooth it. Worked better with big fonts.
Is that because you couldn't use anti-aliasing because the region was limited to the string?
"so just keep in mind that fantasy is not the same as realtiy and make sure u remember that wii sports may be fun but u cant count on it as exercise ok cool bye" - HungarianHuman
-
Jul 27th, 2005, 01:00 PM
#11
Re: how to make a label box transparent
Antialiasing can not be used with the GraphicsPath class, but I believe now that wossy has figured out a way to include antialiasing but not on a label, just direct draw so may be hard for design time viewing.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Jul 27th, 2005, 01:11 PM
#12
Re: how to make a label box transparent
Not entirely correct guys...
* You can use Antialiasing with GraphicsPaths and any kind of drawing (except PathGradientbrushes for some reason).
* You cannot use Antialiasing at the edges of regions because a region is defined by a hard edge of pixels, there is nowhere to put the interpolated pixels.
 Originally Posted by grilkip
Is that because you couldn't use anti-aliasing because the region was limited to the string?
The thing about creating a region form a curvy text outline, is that it takes a smooth curve and makes it jaggy.
You can use antialiasing on graphicspaths, but not when the region you are paint on is the same shape, the antialiased pixels fall off the edges and you can't tell the difference anyway because you are left with the jagged pixel edge of the region.
Rob, have you tried inheriting from the Panel class? That might be easier than using regions. I have not tried it yet. Might be worth a look. If you do, let me know how you get on.
I don't live here any more.
-
Jul 27th, 2005, 01:28 PM
#13
Fanatic Member
Re: how to make a label box transparent
 Originally Posted by wossname
Not entirely correct guys...
You can use antialiasing on graphicspaths, but not when the region you are paint on is the same shape, the antialiased pixels fall off the edges and you can't tell the difference anyway because you are left with the jagged pixel edge of the region.
Maybe I didn't put right but that is in fact what I meant.
"so just keep in mind that fantasy is not the same as realtiy and make sure u remember that wii sports may be fun but u cant count on it as exercise ok cool bye" - HungarianHuman
-
Jul 27th, 2005, 02:01 PM
#14
Re: how to make a label box transparent
wossname, I have done tons of inheriting of the Panel control in classes and I'm sick of it. You remember my Panel usercontrol? Probably will be starting back on it. almost done. But yes, inheriting a panel and then drawing on it may be better since you can make a panel truely transparent.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Jul 27th, 2005, 03:11 PM
#15
Frenzied Member
Re: how to make a label box transparent
I haven't seen the code for the control in the code bank..Is it using an overriden OnPaint method?
-
Jul 27th, 2005, 04:32 PM
#16
Re: how to make a label box transparent
btw have you guys tried setting the Region property of the control to the visible text's region?
rate my posts if they help ya!
Extract thumbnail without reading the whole image file: (C# - VB)
Apply texture to bitmaps: (C# - VB)
Extended console library: (VB)
Save JPEG with a certain quality (image compression): (C# - VB )
VB.NET to C# conversion tips!!
-
Jul 28th, 2005, 03:17 AM
#17
Re: how to make a label box transparent
 Originally Posted by MrPolite
btw have you guys tried setting the Region property of the control to the visible text's region?
Yes, thats what the "joint-effort" was all about. Didn't work well. It was pseudotransparent... The text was solid but the rest of the control simply didn't exist, thus letting the background show through. Not pretty to look at but it was quite cool. Strangely, this made the font a few percent smaller than the original font was declared as, not sure why, couldn't find a way to fix that either.
We also tried hiding the control, taking a screenshot of the underlying pixels, re-showing the control again and blitting back the pixels on top. Then antialiasing our text on top of that! That didn't work either because it flickered like crazy and was dead slow to refresh. Then I got bored of debugging API functions and gave up until now.
I don't live here any more.
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
|