|
-
Dec 2nd, 2002, 04:50 PM
#1
Thread Starter
Addicted Member
transparent labels really gone?**resolved**
I am upgrading an app from vb6 to .net and found that all labels were converted to images because there is no transparent property anymore. Is there no way around this?
Last edited by Halon; Dec 3rd, 2002 at 11:50 AM.
Soylent Green tastes like chicken
-
Dec 2nd, 2002, 04:55 PM
#2
Member
Set the BackColor property to Transparent.
-
Dec 2nd, 2002, 04:59 PM
#3
Originally posted by wyrd
Set the BackColor property to Transparent.
no that doesnt work. That will just change the backcolor of the label to match the backcolor of the form.....
I have a picturebox in my form which is supposed to be the background of the form, and I have some labels on my form. Since they;re not transparent, it looks kinda ugly
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!!
-
Dec 2nd, 2002, 05:07 PM
#4
Thread Starter
Addicted Member
Actually it worked like a charm ... i have a custom skin that the imagebox sits on and you can see right through it just like the old labels did. Thanks for the tip wyrd
Mr. Polite ... Prob doesn't work for labels...i stuck with the imagebox's
Soylent Green tastes like chicken
-
Dec 2nd, 2002, 05:10 PM
#5
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!!
-
Dec 2nd, 2002, 05:18 PM
#6
Member
MrPolite:
I just added a background image to my form, then added a label with BackColor set to Transparent. It worked fine.
Note: The Transparent option is under the Web tab.
-
Dec 2nd, 2002, 11:00 PM
#7
Junior Member
Hello MrPolite,
Ok I found a this at the MSDN site.
Giving Your Control a Transparent Background
In the Public Sub New section of your form add the following line after the "InitializeComponent()"
VB Code:
SetStyle(ControlStyles.SupportsTransparentBackColor, True)
Like below:
VB Code:
#Region " Windows Form Designer generated code "
Public Sub New()
MyBase.New()
'This call is required by the Windows Form Designer.
InitializeComponent()
'Add any initialization after the InitializeComponent() call
SetStyle(ControlStyles.SupportsTransparentBackColor, True)
End Sub
Then in the constructor section of the label add the following line.
VB Code:
Me.Label1.BackColor = System.Drawing.Color.Transparent
Which will look like this:
VB Code:
'
'Label1
'
Me.Label1.BackColor = System.Drawing.Color.Transparent
Me.Label1.Location = New System.Drawing.Point(28, 40)
Me.Label1.Name = "Label1"
Me.Label1.Size = New System.Drawing.Size(220, 68)
Me.Label1.TabIndex = 0
Me.Label1.Text = "Label1"
Once you have all that done the label will be transparent from then on.
Hope this helps a little...
Best,
Roger
VB6.0 SR5 & VB.Net Pro
-----------------------------------------------
Do or do not, there is no try!
-
Dec 3rd, 2002, 10:31 AM
#8
Thread Starter
Addicted Member
hmmm .. seemed a lot easier to just set the backcolor to transparent like wyrd was mentioning. Is there a reason to do it the other way?
Soylent Green tastes like chicken
-
Dec 3rd, 2002, 12:12 PM
#9
Member
He was just telling you how to make images transparent.
-
Dec 7th, 2002, 05:19 PM
#10
I did that, but it's not working:
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!!
-
Dec 8th, 2002, 07:10 PM
#11
Addicted Member
Try this:
Set the labels background property to this: 0,255,0,0
Jeremy
-
Dec 9th, 2002, 05:07 PM
#12
yay gay
why not just put the label above the button? or can't it be done?
\m/  \m/
-
Dec 9th, 2002, 05:19 PM
#13
Are you setting the image in the form's BackgroundImage property? It doesn't work otherwise.
I tried stretching an image in a pciturebox over the form but all the 'transparent' controls then had the background that matched the form still. So they really aren't transparent, they just draw the form in the background.
-
Dec 9th, 2002, 10:14 PM
#14
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!!
-
Dec 9th, 2002, 10:36 PM
#15
Can you set the picture as the form backgroundimage instead of in the picturebox? Is it just me or does it seem like MS took a step backwards on this one?
-
Dec 9th, 2002, 11:25 PM
#16
Originally posted by Edneeis
Can you set the picture as the form backgroundimage instead of in the picturebox? Is it just me or does it seem like MS took a step backwards on this one?
I think they did take a step backwards
well I'm making a program, and the whole program is like a WIZARD, kinda like the way you burn CD's in nero. So I thought the best way to do something like this is to put each step of my program in a tabpage. So I have a tabcontrol, with some tabpages which contain the different steps of the program.... Each one has it's own background. I dont know if there is a better way besides using a tabcontrol for this
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!!
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
|