资讯

精准传达 • 有效沟通

从品牌网站建设到网络营销策划,从策略到执行的一站式服务

关于vb.net文字加边线的信息

vb.net的label怎么在鼠标移动过来时添加下划线?代码是什么?

Label1.Attributes.Add("onmouseover", "this.style.textDecoration='underline'"); //显示下划线

西吉网站建设公司创新互联建站,西吉网站设计制作,有大型网站制作公司丰富经验。已为西吉近1000家提供企业网站建设服务。企业网站搭建\外贸网站建设要多少钱,请找那个售后服务好的西吉做网站的公司定做!

Label1.Attributes.Add("onmouseout", "this.style.textDecoration=''"); //隐藏下划线

vb.net中怎么给label设置下划线

将Label1 改成相应的 label 控件名称。

'鼠标经过时,显示下划线

Private Sub Label1_MouseEnter(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label1.MouseEnter

Dim LabelFont As Font = New Font(Label1.Font.Name, Label1.Font.Size, FontStyle.Underline)

Label1.Font.Dispose()

Label1.Font = LabelFont

End Sub

'鼠标离开时,去除下划线

Private Sub Label1_MouseLeave(ByVal sender As Object, ByVal e As System.EventArgs) Handles Label1.MouseLeave

Dim LabelFont As Font = New Font(Label1.Font.Name, Label1.Font.Size, FontStyle.Regular)

Label1.Font.Dispose()

Label1.Font = LabelFont

End Sub

vb中给文字增大缩小加下划线加删除线粗体斜体代码

'控件一个文本框text1,五个按钮command1至command5

Private Sub Command1_Click() '增大字体

Text1.FontSize = Text1.FontSize + 1

End Sub

Private Sub Command2_Click() '缩小字体

If Text1.FontSize  2 Then Text1.FontSize = Text1.FontSize - 1

End Sub

Private Sub Command3_Click() '变换下划线

Text1.FontUnderline = Not Text1.FontUnderline

End Sub

Private Sub Command4_Click()  '变换粗体

Text1.FontBold = Not Text1.FontBold

End Sub

Private Sub Command5_Click() '变换斜体

Text1.FontItalic = Not Text1.FontItalic

End Sub


当前文章:关于vb.net文字加边线的信息
文章起源:http://cdkjz.cn/article/dodicho.html
多年建站经验

多一份参考,总有益处

联系快上网,免费获得专属《策划方案》及报价

咨询相关问题或预约面谈,可以通过以下方式与我们联系

业务热线:400-028-6601 / 大客户专线   成都:13518219792   座机:028-86922220