>I do not know. First, the grid that is a container, at least conceptually does not show the same behaviour (i.e. it can be recognised as an activecontrol). Second, we loose information hiding and polymorfism, as we have to identify candidates of activecontrol individually, in order to be recognized by thisform.keypress, and third, what is the point of having an activecontrol property for the container if it points to the same control as thisform.activecontrol.
>
>As for putting code in the txtboxes of the columns of grids, you would do that only if all other alternatives have been explored, and it is nearly impossible at the abstract level, as you do not know how many columns you are dealing with.
>
>Anyway, Barabara, thanks for you comments.
>
>Marc
We'll have to agree to disagree :-) I think that thisform.activecontrol SHOULD show the actual control. I don't want the answer to be "PageFrame1" or "MyContainer", I want it to tell me which textbox. Concerning information hiding, polymorphism, etc. the container has its own methods and properties which are NOT overwritten by the parent form methods/properties.
As for the grid behaviour, well, grids are NOT OOP designed. If they were we could subclass columns, add multi-line headers, etc. I have very strong feelings on grids not having their own KeyPress, LostFocus and other properties which would make life MUCH easier.
I certainly agree with you about not adding code to the grid textboxes. That would be a last-ditch solution!!
Barbara