Transparent Link Label, over picturebox control?

S

SStory

I have a picturebox in my About form.

would like to have a link to my company website. Wanted the links
background to be transparent.
It seems that no one knows how to do this.

Have asked many times. VB help says that transparent is possible with a
background image but not above a control. So how can I provide a link (URL)
that is clickable, but transparent, over the picturebox in my about box?

Thanks,

Shane
 
K

Ken Tucker [MVP]

Hi,

LinkLabel1.BackColor = Color.Transparent

LinkLabel1.Parent = PictureBox1

LinkLabel1.Location = New Point(0, 0)


Ken
 
H

Herfried K. Wagner [MVP]

* "SStory said:
would like to have a link to my company website. Wanted the links
background to be transparent.
It seems that no one knows how to do this.

Just add the LinkLabel to the PictureBox and set its 'BackColor'
property to 'Transparent'. Works for me (Windows XP Professional, .NET
1.1).
 
S

SStory

hmm.

Well I just placed the link label on top of the picture box. Is that adding?

or do I need to do as Ken said and add it in code, setting the parent?

I will certainly try both.

Thanks,

Shane
 
H

Herfried K. Wagner [MVP]

* "SStory said:
Well I just placed the link label on top of the picture box. Is that adding?

Drag the LinkLabel into the picturebox.
or do I need to do as Ken said and add it in code, setting the parent?

Placing the control inside the container will set the parent. For me,
everything works inside the IDE too. Just drag a LinkLabel into the
PictureBox and set its 'BackColor' to 'Transparent' (that's on the 2nd
color selection tab).
 
S

SStory

Ok.
One thing is that I was setting the image property of the picturebox and not
the background image property

Either way.
I put a simple picturebox on a form.
Set background image property to a jpg.
drag a link label control to it.
click BackColor property and select Web tab
then click Transparent.
It shows as control Grey for me.

I am using .net 2003

Any ideas?

Thanks,

Shane
 
H

Herfried K. Wagner [MVP]

* "SStory said:
One thing is that I was setting the image property of the picturebox and not
the background image property

Either way.
I put a simple picturebox on a form.
Set background image property to a jpg.
drag a link label control to it.
click BackColor property and select Web tab
then click Transparent.
It shows as control Grey for me.

I am using .net 2003

I tried it again in a blank project and in one picturebox it works, in
the other picturebox it doesn't work. Seems to depend on the image if
it works, but I am not really sure about that.
 
S

SStory

Great! I am glad someone else gets the problem besides me.

Wonder if maybe someone at Microsoft is watching and could enlighten us.
This is a very needed capability.

A bit aggravating to have to paint my text on top of it just to get
transparency. I like seeing it there at designtime.

Danke Herfried.

ps.

If you get any more ideas on it please tell me. I have never gotten it to
work.

Shane
 
H

Herfried K. Wagner [MVP]

* "SStory said:
If you get any more ideas on it please tell me. I have never gotten it to
work.

I don't have an idea. I placed 2 pictureboxes on my form and chose 2
different GIF files. With one of the pictureboxes, it works, but it
doesn't work with the other picturebox (!?). I don't see any big
differences in the images' image formats.
 
S

SStory

hmm..
Do you know an easy way to get this problem before Microsoft for an answer
or should we just hope one of them stumble across this news thread?

Thanks Herfried!
Glad I am not the only one in the twilight zone on this one.

And this is such a common need. I can do the label by Drawstring although
shouldn't have to... but the link control, I don't know how to do Drawstring
and make it hyperlink.... or anything of the kind..

Shane
 
H

Herfried K. Wagner [MVP]

* "SStory said:
Do you know an easy way to get this problem before Microsoft for an answer
or should we just hope one of them stumble across this news thread?

Let's hope that someone from Microsoft reads the thread. I am still not
sure if it's a bug, because it's very hard to repro the case when
transparency works.
And this is such a common need. I can do the label by Drawstring although
shouldn't have to... but the link control, I don't know how to do Drawstring
and make it hyperlink.... or anything of the kind..

You will have to perform hit testing in the control's 'MouseUp' event or
something like that.
 

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