Custom Control - Public Overrides Property Text

CodyB

Active member
Joined
Jul 23, 2007
Messages
26
Programming Experience
3-5
First, I'm not sure the best forum for this question. So any moderator out there, please feel free to move this to the right forum.

I have a custom control with a group box, 3 labels, and 3 text boxes. I created 3 brand new properties to read/write the textbox.text properties, and they work fine. I want the text property of my control to read/write the text property of the group box. But after making it "Public Overrides Property Text" it won't show up in the properties window.

VB.NET:
Expand Collapse Copy
    '*** Properties ***
    <System.ComponentModel.Category("Appearance"), _
    System.ComponentModel.Description("The text associated with the control.")> _
   Public Overrides Property Text() As String
        Get
            Return grpOverrides.Text
        End Get
        Set(ByVal Value As String)
            grpOverrides.Text = Value
        End Set
    End Property

    <System.ComponentModel.Category("Axis Overrides"), _
    System.ComponentModel.Description("Sets/Reads the X axis offset value that is to be reported to the post processor.")> _
    Public Property AxisX() As Double
        Get
            Return CDbl(txtX.Text)
        End Get
        Set(ByVal Value As Double)
            txtX.Text = DecimalPlaces(Value)
        End Set
    End Property

VB.NET:
Expand Collapse Copy
    <System.ComponentModel.Category("Axis Overrides"), _
    System.ComponentModel.Description("Sets/Reads the Y axis offset value that is to be reported to the post processor.")> _
    Public Property AxisY() As Double
        Get
            Return CDbl(txtY.Text)
        End Get
        Set(ByVal Value As Double)
            txtY.Text = DecimalPlaces(Value)
        End Set
    End Property

    <System.ComponentModel.Category("Axis Overrides"), _
    System.ComponentModel.Description("Sets/Reads the Z axis offset value that is to be reported to the post processor.")> _
    Public Property AxisZ() As Double
        Get
            Return CDbl(txtZ.Text)
        End Get
        Set(ByVal Value As Double)
            txtZ.Text = DecimalPlaces(Value)
        End Set
    End Property

These are all 4 of the properties I mentioned. What am I missing?
 
Since that name conflicts with the hidden Text property of UserControl class it may be easier to name it for example GroupText.
But it is possible decorating it with attributes that undo the default:
VB.NET:
Expand Collapse Copy
<EditorBrowsable(EditorBrowsableState.Always), Browsable(True), Bindable(True), _
DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)> _
 
Back
Top