Hi!
The ActiveControl property of the form drills down to the containers already. Grid is just interprete as a solid control, thus it requires special processing. Page frames and containers are already processed when value is prepared for ActiveCOntrol property.
Yes, you're right - most frameworks already include this kind of routine.
>>This is just a sample. To make it generic, you have to add checking for ActiveX controls, OLEBoundControl (you cannot compare field of General type) etc.
>
>One other thought: you checked for the possibility of a grid, but anyone who uses pageframes would also have to check for a pageframe, and a grid within it ... in fact, you might need a form method like "RealActiveCtrl" which "drills down" through any active container objects into the lowest active non-container object.
>
>To be really generic.
>
>I bet the commercial frameworks all have something like this.
Vlad Grynchyshyn, Project Manager, MCP
vgryn@yahoo.comICQ #10709245
The professional level of programmer could be determined by level of stupidity of his/her bugs
It is not appropriate to say that question is "foolish". There could be only foolish answers. Everybody passed period of time when knows nothing about something.