如何更改自定义Control的默认属性

时间:2017-11-06 18:00:04

标签: vb.net winforms

我的自定义按钮的默认属性是Text.I想要更改为名为MaximumClicks的自定义属性

Public Property MaximumClicks As Integer
    Get
        Return maxClick
    End Get
    Set(value As Integer)
        maxClick = value
    End Set
End Property

1 个答案:

答案 0 :(得分:2)

您可以将DefaultPropertyAttribute应用于您的班级:

<DefaultProperty("MaximumClicks")> _
Public Class CustomButton
    Inherits Button

    Public Property MaximumClicks As Integer
        Get 
            ' etc