Search code examples
c#controlsnumericupdown

Why the NumericUpDown's Text property is not suggested by Intellisense?


I have noticed that all Controls have a Text property. However, the Intellisense doesn't suggest it for NumericUpDown objects. When manually writing it down, it does work and returns the value of the NumericUpDown as a string. Why is that?


Solution

  • The docs show the property defined as:

    [BrowsableAttribute(false)]
    [BindableAttribute(false)]
    public override string Text { get; set; }
    

    The BrowsableAttribute(false) bit (or more likely EditorBrowsableAttribute) is what 'hides' it from Intellisense.

    Why does it hide it?

    This API supports the product infrastructure and is not intended to be used directly from your code.