Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm General / February 2007

Tip: Looking for answers? Try searching our database.

Transparent BackStyle for label

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Elmo Watson - 02 Feb 2007 03:37 GMT
In the 'good old days' of vb6, labels had a 'BackStyle' property - you could
set them Opaque or Transparent.

I have a need for the Transparent attribute - - in VB.Net (2005), how can
this be accomplished?
Ciaran O''Donnell - 02 Feb 2007 08:59 GMT
Transparent is a Color you can pick for the backcolor
Signature

Ciaran O''Donnell
http://wannabedeveloper.spaces.live.com

> In the 'good old days' of vb6, labels had a 'BackStyle' property - you could
> set them Opaque or Transparent.
>
> I have a need for the Transparent attribute - - in VB.Net (2005), how can
> this be accomplished?
Jimmy J. - 02 Feb 2007 15:42 GMT
I initially thought the same thing, however, it doesn't work - it just gives
a white background

> Transparent is a Color you can pick for the backcolor
>
[quoted text clipped - 3 lines]
> > I have a need for the Transparent attribute - - in VB.Net (2005), how can
> > this be accomplished?
ClayB - 05 Feb 2007 11:21 GMT
Label supports a transparent background, but some controls do not (ie,
textbox).
If I set a form's BackgroundImage property and then drop a Label on
the form and set its BackColor as:

              label1.BackColor = Color.Transparent

then the bitmap background of the form shows through the label as
expected.

====================
Clay Burch
Syncfusion, Inc.
ElmoWatson - 05 Feb 2007 20:22 GMT
Totally understood - - -
In this case, the entire form has a fully docked PictureBox with an image.

(I haven't tried setting the Transparency in code) I set the background
color of the label (on top of the picturebox) to transparent, using the
Properties window. I would expect the image (as you say) to show through the
label. However, instead of this, it shows a murky white color as the
background.

could it be because I'm using the picture box, instead of making the image
be the background image of the form?

> Label supports a transparent background, but some controls do not (ie,
> textbox).
[quoted text clipped - 9 lines]
> Clay Burch
> Syncfusion, Inc.
Chris Dunaway - 14 Feb 2007 16:19 GMT
> Totally understood - - -
> In this case, the entire form has a fully docked PictureBox with an image.
[quoted text clipped - 17 lines]
> > then the bitmap background of the form shows through the label as
> > expected.

When you set the background color of the label to Transparent, what
shows through it the Label's container.  It's not a true transparent
label.

When you drag a label on top of a PictureBox, the Label's container is
still the form and not the picturebox.  You need to set the parent
property of the label to the PictureBox then the PictureBox should
show through the label.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.