Label Transparancy

T

Tym

How on earth does one set the background property of a label to
transparant, a la VB6?

I have a label which overlays a picturebox, and I don't want the
horrible grey background - I just want the text over the picturebox.
The text dynamically moves around too.

Effectivly, its a "You are Here" sort of thing, so I'm putting a red
"X" in a label and moving it around.

Is there a control that I can use which has a transparency?


---


Tym

Please do not adjust your brain, there is a fault with reality

Email - Domain is valid - user is not - I'm sure you can work it out though!

However, there is an agressive spam trap here, so you'll get blacklisted until I
white list you. If you've emailed and asked for a reply and not got one - please
post a message in here and I'll re-check the black hole!

A plague of Jonathan Ross a thousand fold on the spammers!!
 
P

Patrick Sullivan

from VS 2003 docs:

-- MaskColor Changes in Visual Basic .
In Visual Basic 6.0, the MaskColor property of a CheckBox, CommandButton, or
OptionButton control was used to define a color that would become
transparent, allowing a background image to show through. In order to use
this property, the Style property had to be set to Graphical, the
UseMaskColor property had to be set to true, and a bitmap had to be assigned
to the Picture property.

In Visual Basic .NET, there is no direct equivalent for the MaskColor
property. You can, however, set transparency on a control using code similar
to the following:

' Assumes a picture has been assigned to the BackgroundImage property.

Dim g As New System.Drawing.Bitmap(Button1.BackGroundImage)
g.MakeTransparent(System.Drawing.Color.White)
Button1.BackgroundImage = g


Patrick Sullivan, AA-BA, BA-IT
 
T

Tym

It is rumoured that on Fri, 5 Aug 2005 09:25:15 -0500, "Patrick
Sullivan said:
' Assumes a picture has been assigned to the BackgroundImage property.

Dim g As New System.Drawing.Bitmap(Button1.BackGroundImage)
g.MakeTransparent(System.Drawing.Color.White)
Button1.BackgroundImage = g


Patrick Sullivan, AA-BA, BA-IT

Thanks for that - though I'm afraid I feel I have missed out some
important information...

I am writing for PocketPC2002 - and so the cotrols are not "as normal"

I cannot set a bacground image to a button, and fell I am stuck with
the grey background to my label... ~sigh~

Sorry for missing this important piece of info out of the original
question


---


Tym

Please do not adjust your brain, there is a fault with reality

Email - Domain is valid - user is not - I'm sure you can work it out though!

However, there is an agressive spam trap here, so you'll get blacklisted until I
white list you. If you've emailed and asked for a reply and not got one - please
post a message in here and I'll re-check the black hole!

A plague of Jonathan Ross a thousand fold on the spammers!!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top