用法:改变2个数字参数的值来改变角的弧度,大家可以根据控件的大小自己测试规律
Dim x As New changetextbox(Me.TextBox4, 2, 3, Color.Blue)
Dim y As New changetextbox(Me.TextBox5, 13, 18, Color.Brown)
Class changetextbox
Dim t As TextBox
'Dim d As Integer = 13
'Dim tj As Integer = 18
Dim d As Integer = 13
Dim tj As Integer = 18
Dim cor As Color
Sub New(ByVal t As Control, ByVal d As Integer, ByVal tj As Integer, ByVal cor As Color)
Me.t = t
Me.d = d
Me.tj = tj
Me.cor = cor
Dim p As Control = t.Parent
Me.t.BorderStyle = BorderStyle.None
t.BackColor = p.BackColor
AddHa

该博客介绍了如何在VB.NET中将TextBox和Label控件的边框转变为圆弧形,并展示如何修改边框颜色。通过创建自定义类`changetextbox`,并调整参数来改变角的弧度和颜色,利用Graphics对象绘制线条和弧形,实现了圆角效果。
最低0.47元/天 解锁文章
2656

被折叠的 条评论
为什么被折叠?



