16,718
社区成员
发帖
与我相关
我的任务
分享Public Class CustomControl1
Private mCaption As String = "first"
Private mAge As Integer = 7
<Category("我的分类"), DefaultValue("myname"), Description("设置标题")> _
Property Caption() As String
Get
Return mCaption
End Get
Set(ByVal value As String)
mCaption = value
End Set
End Property
<Category("我的分类"), DefaultValue(10), Description("设置年龄")> _
Property Age() As Integer
Get
Return mAge
End Get
Set(ByVal value As Integer)
mAge = value
End Set
End Property
Protected Overrides Sub OnPaint(ByVal e As System.Windows.Forms.PaintEventArgs)
MyBase.OnPaint(e)
'在此处添加自定义绘制代码
End Sub
End Class ''' <summary>
''' '设置边框颜色
''' </summary>
''' <value></value>
''' <returns></returns>
''' <remarks></remarks>
<Category("我的分类")> Property BorderColor() As Color
Get
Return mborderColor
End Get
Set(ByVal value As Color)
mborderColor = value
Me.Invalidate()
End Set
End Property