--- In [email protected], Rob Kennedy <rkenn...@...> wrote: > > How does anything know what to _do_ with that field? Where does its > value get read? >
FAlignment is a field of type TAlignment which is a class itself. It was my understanding that Delphi has encapsulated all the general behaviors of a field in the class from which the field is derived. Like when I drop a TButton on a Form, I don't have to re-invent the way my users are going to interact with the TButton object on my form. My TButton object inherits of all the methods, properties, and events that Delphi has already defined in the TButton class. I assumed that it would be the same for a TAlignment object. > You call RecreateWnd. Why? What are you expecting that to do, and how > are you expecting it to do it? > RecreateWnd is intended to update the appearance of the control after its internal structure has been modified. In my case the text value of my TnwEdit object should show the re-alignment reset after a call to RecreateWnd. > You've given the control a property named "Alignment," but that doesn't > magically mean the control does anything related to aligning things any > more than giving a control a property named "Odor" makes the computer > smell bad. You have to write code to make the properties do things, or > else you need to find where previous code was already expecting you to > add something. You are right. But it's not much a matter of object naming as much as it is about the type of an object that will define the pattern of behaviors of that object. If FAlignment is a field of type TAlignment, I was assuming that Delphi would know that the behavior expected would be the horizontal re-position of the text value of a control. My problem is the new added Alignment property is showing on the object inspector, but the actual re-alignment of text inside my TnwEdit object doesn't happen when you change the value of Alignment. My question, now, is: Does the TAlignment class define any behavior associated with any of its preset values? Thank you. EL

