7

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?

axvo
  • 829
  • 2
  • 12
  • 25

2 Answers2

20

You can use LinkBehavior:

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

enter image description here

KyleMit
  • 30,350
  • 66
  • 462
  • 664
Kamal Gupta
  • 201
  • 2
  • 3
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)
Jeremy Thompson
  • 61,933
  • 36
  • 195
  • 321
  • 1
    Actually, even in runtime, LinkLabekl is still blue and underlined... However, now I can't test on device, I test on desktop. Maybe it will be correct on device? – axvo Dec 30 '13 at 08:55
  • @axvo Is the issue resolved on the device or is further troubleshooting required? – Jeremy Thompson Dec 30 '13 at 22:30
  • I can't test on the device because I don't have it yet. Not sure I'll get it before 5 or 6 days. When I will able to test, I'll tell you if it's resolved – axvo Dec 31 '13 at 08:34
  • It finally works. On device, LinkLabel has the expected design. So it's just a desktop issue. Thanks Jeremy – axvo Jan 13 '14 at 10:44