LinkLabel no underline - Compact Framework

痞子三分冷 提交于 2019-12-23 12:53:41

问题


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?


回答1:


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)



回答2:


You can use LinkBehavior:

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



来源:https://stackoverflow.com/questions/20836153/linklabel-no-underline-compact-framework

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!