access declarative object from subclass

I’m new. I try using Visual Designer. So how I want to get value of the object from sub class. For example, I have insert a TextField with id=“TxtName”. I have declare TextField TxtName in Sub Class. So, how I want to get the TextField value? I get null when I try get the value.