vb.net划线 vb下划线代码

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.Net中画直线问题不想整个重画vb.net划线,最好用单色vb.net划线的背景vb.net划线 , 例如黑色,线条是白色的
用变量把线条的内容备份
当想改变线条的位置或者长度之前,先用存下来的变量以黑色重画一次,覆盖原来的白色线条
然后再画新的白色线条,这种重画方法比较节省资源
假如需要用花哨的背景或者图片当背景,也可以用局部重回的方式 。
代码就不提供了,只提供思路 。
VB.net中如何在picturebox画线,有什么函数?Dim b As New Bitmap(PictureBox1.Width, PictureBox1.Height)
Dim g As Graphics = Graphics.FromImage(b)
g.Clear(Color.White)
Dim p As New Pen(Color.Black)
p.EndCap = Drawing2D.LineCap.ArrowAnchor
g.DrawLine(p, 30, PictureBox1.Height - 30, 30, 30)
g.DrawLine(p, 30, PictureBox1.Height - 30, PictureBox1.Width - 30, PictureBox1.Height - 30)
Dim i As Integer
【vb.net划线 vb下划线代码】Dim bs As New SolidBrush(Color.Green)
Dim po As New Point
po.X = 0
po.Y = PictureBox1.Height - 35
For i = 700 To 1000 Step 50
g.DrawString(i, Me.Font, bs, po.X, po.Y)
g.DrawLine(p, po.X + 28, po.Y + 5, po.X + 30, po.Y + 5)
po.Y -= (PictureBox1.Height - 100) / 6
Next
po.X = 30
po.Y = PictureBox1.Height - 30
For i = 0 To 40 Step 5
g.DrawString(i, Me.Font, bs, po.X, po.Y + 5)
g.DrawLine(p, po.X, po.Y + 2, po.X, po.Y)
po.X += (PictureBox1.Width - 100) / 8
Next
PictureBox1.Image = b
VB.NET 画直线 问题 怎样让直线置顶(就是不被其它控件覆盖) 100分(希望详细些)如较麻烦,会追加分数这个必须用控件的方法解决,VB6有个Line控件很容易解决这个问题,但是VB.NET没有了,幸好微软也想到了这个缺陷,提供免费的Visual Basic PowerPacks控件箱,其中有Line控件 。
Visual Basic PowerPacks下载地址:
使用 LineShape 控件绘制直线:
vb.net划线的介绍就聊到这里吧,感谢你花时间阅读本站内容,更多关于vb下划线代码、vb.net划线的信息别忘了在本站进行查找喔 。

    推荐阅读