Then I find out that it really isnt the specific control that implements the event, it is a control further up in the hiearchy. I keep going up the inheritance tree, to find that System.Windows.Forms.Control has a property named Text (and a bunch of events for text manipulations). That is odd I think, why would a base Control class have a text property when the deriving classes are not necessary text orientated controls.
- What happens if I change the Text property on a PictureBox? Would it show the text on top of the picture?
- What happens if I do it on a SplitContainer?
- Or on a NumericUpDown control?
The MSDN will of course answer the question if the Text property actually works or not. On those controls that do not support them, it will say "This property supports the .NET Framework infrastructure and is not intended to be used directly from your code.". Sheeesh, that makes we want to think twice before using the Text property on a Label or Button. Perhaps the Text property is not intended to be used directly in my code on a button? The best explaination is (of course all these overriden properties have different wording) "The Text has no affect on the appearance of the NumericUpDown control; therefore, it is hidden in the designer and from IntelliSense.".. I would like to see that code in the IntelliSense.
if (control is SplitContainer) || (control is NumbericUpDown)
Or is there any valid reason that every Control has a Text property?