Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

LinkLabel no underline - Compact Framework

I am developing a Windows CE app with Microsoft Compact Framework. I have to use a LinkLabel and it has to be white and no underline.

So in the designer, I modified font color by white and unchecked "underline" in the font dialog.

However, when I run the application, the font is still blue and underlined.

Is there a way to remove the underline of a LinkLabel and change its color?

like image 276
axvo Avatar asked Dec 30 '13 08:12

axvo


2 Answers

You can use LinkBehavior:

Me.linkLabel1.LinkBehavior = System.Windows.Forms.LinkBehavior.NeverUnderline;

enter image description here

like image 101
Kamal Gupta Avatar answered Nov 18 '22 15:11

Kamal Gupta


It wont be visible in the designer at Design-Time but will be correct in Runtime.

Otherwise do it in Code (which should be the same as the designers code):

Font f = LinkLabel1.Font; 
LinkLabel1.Font = New Font(f, f.Style && !FontStyle.Underline)
like image 27
Jeremy Thompson Avatar answered Nov 18 '22 16:11

Jeremy Thompson