Connecting Tech Pros Worldwide Help | Site Map

How Transparent the background of link label control?

Newbie
 
Join Date: Sep 2009
Posts: 21
#1: 4 Weeks Ago
i am developing smart phone application with VS 2005 using C#.
i am trying to transparent the background of link label control which dynamically added in panel. i try with following code to transparent the background of link label control .
Expand|Select|Wrap|Line Numbers
  1.   LinkLabel lnklbl = new LinkLabel();
  2. lnklbl .Text="Click Me";
  3. lnklbl .BackColor = Color.Transparent;
  4.  
this code not work and background show with white color.
please give me idea to transparent the background of this dynamic control.
thankx
markmcgookin's Avatar
Moderator
 
Join Date: Dec 2006
Location: Northern Ireland / England
Posts: 546
#2: 4 Weeks Ago

re: How Transparent the background of link label control?


Hmm... that is strange I thought it would be transparent by default.

You could always set it to

Expand|Select|Wrap|Line Numbers
  1.  lnklbl.BackColor = this.lnklbl.Parent.BackColor; 
which would set it to it's parent's backcolor, so it would LOOK transparent.
Newbie
 
Join Date: Sep 2009
Posts: 21
#3: 4 Weeks Ago

re: How Transparent the background of link label control?


Thanx mr. markmcgookin ,
this code is not work well because the panel contain image as
background in picture box control and all link label display on image by
"BringToFront()" method.what is way to transparent control in this situation.
if u have a any other idea please share with me.
markmcgookin's Avatar
Moderator
 
Join Date: Dec 2006
Location: Northern Ireland / England
Posts: 546
#4: 3 Weeks Ago

re: How Transparent the background of link label control?


I don't think you can ever get a truely transparant background ontop of an image in the compact framework.

It would require quite a bit of processing power to do this, as the bounds of the lable object would surely have to mimic the colours of the object below it. Why are you placing a link label on an image. Why not just set an onclick event for the image and have this mimic the behaviour of the link?

Mark
Newbie
 
Join Date: Sep 2009
Posts: 21
#5: 3 Weeks Ago

re: How Transparent the background of link label control?


thanx for respons,
How i use bound object to do this?
Reply


Similar Mobile Development bytes