For understanding.
Writes that the Object has no text property.
Here, for some reason, is the object data type, but it is not universal
All classes in the c # language are inherited from the System.Object class (you can just write object ). It defines literally two or three methods - and all descendants of this class have them (read, all classes in your project). These are ToString , Equals , GetType and ... some more.
This class has no fields and properties. Totally.
Therefore, your attempt to access some property is expected to cause an error at the compilation stage, namely at the stage of accessing the property. Due to the fact that any class is a descendant of System.Object it can be reduced to a base type and passed to a method.
Therefore, the decision in the comments you were offered a completely natural and logical: correctly specify the name of the class that you pass.
Object_Namespecify its real type (which, in particular, has theTextproperty). AndSystem.Objectreally does not have such a property - VS doesn't lie to you. - RegentObject_Nameis aTextBox, and not just some abstractobject. - RegentControl- the parent for all components - will do. By the way, is it WinForms or WPF? Add a tag. - Alexander PetrovControl ObjectName. At least you will have access to.Text. - Regent