473,396 Members | 1,860 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Label Transparancy

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!!
Nov 21 '05 #1
2 1423
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

"Tym" <no*****@Ictis.net> wrote in message
news:mq********************************@4ax.com...
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!!

Nov 21 '05 #2
Tym
It is rumoured that on Fri, 5 Aug 2005 09:25:15 -0500, "Patrick
Sullivan" <ps****@eatel.net> spake word of wisdom thus:
' 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!!
Nov 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: dan glenn | last post by:
(PHP4.3.4, GD2) How can I save a PNG using GD2 and insure that it saves as a palette-based (8-bit, 256-color) single-color transparancy?? Saving this way, I could be sure that an image loaded from...
2
by: Xerxes | last post by:
Hi, can you tell me how I can make a <label> hidden? I have hidden the field after the label: var M_Hide = isNS4?'hide':'hidden'; var M_Show = isNS4?'show':'visible'; ..... <label...
4
by: Keon | last post by:
Hoi Do someone know how i can make the background of a iframe transparancy? I already tried it with filter: Alpha(Opacity=50,); but it also make the text transperancy. do someone know how to...
1
by: pnp | last post by:
Hi all, I'm developing a win app in C# and I am drawing by myself the icons that I'm going to use in Corel Draw 11, then turn them to icons by using Axialis and then use them from an imagelist in...
0
by: Tym | last post by:
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...
1
by: Manoj Mittal | last post by:
I have created the Dynamic control in asp.net c# like for (int i = 1; i <= 5; i++) { Label label = new Label(); label.ID = "Label" + i; label.Text = "Label"+i; form1.Controls.Add(label); }
0
by: Kevin McKinley | last post by:
Below i've put the code for a program that i wrote. I need help on lines 384-403. If you run this program you will notice on the first tab when have it produce an answer the $ is surrounded with...
0
by: Guilherme Polo | last post by:
On Wed, Sep 3, 2008 at 8:57 PM, Kevin McKinley <kem1723@yahoo.comwrote: Come on.. "help on lines 384-403", that is not a good way to look for help. You are supposed to post some minimal code that...
9
by: =?Utf-8?B?RnJhbmsgVXJheQ==?= | last post by:
Hi all I have a MDI Container Form, with one label control on the Background of this container form. When I now open a child form, this form is behind the label ... and this looks ugly ... :-))...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.