TIP: Click on subject to list as thread! ANSI
echo: delphi
to: ALL
from: MARTIN MAAT
date: 1997-08-25 19:22:00
subject: Answer to (non)activation problem

Yo, All.
A while ago I asked for help on a strange behaving application. It seemed 
controls (being TCustomGrid descendants) did not receive focus I when clicked 
on, until I alt-tabbed to another application or clicked an icon on the 
desktop and then returned to the application.
Well, I found what caused it today and it appeared to have been all my fault 
(I have mixed feelings about this by the way...).
The trouble was in an overriden TForm.Load procedure. I never saw any point 
in calling inherited for this one since I figured this was only an opputunity 
to "do my thing" at a particular moment, rather than an addition to some 
Delphi actions. However, calling inherited just the same did solve the 
problem.
Checking it out, I found some really significant code in TCustomForm.Loaded, 
like making Windows set focus to TCustomForm.ActiveControl for the first 
me.
So listen up you boys and girls, ALWAYS call inherited, even when it doesn't 
make sense to you!
This seemed to fix the "loss of properties" as well. I'm not sure if it 
solved the access violations I encountered after doing anything to the 
package that had the bad controls in it. The days to come will tell...
Groeten, Martin.
--- FMail/Win32 1.22
---------------
* Origin: -=[ E-mail: m_maat@knoware.nl .......... ]=- (2:286/420.1)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.