Вопрос

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?

Это было полезно?

Решение 2

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)

Другие советы

You can use LinkBehavior:

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

enter image description here

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top