delphi - Form OnDeactivate - need to determine which is the new Activated control -
i have code shows search form specific dbgrid placed in another form (the caller form of tsearchgridform):
procedure tsearchgridform.formdeactivate(sender: tobject); begin // pseudo if newactivecontrol <> callerform.dbgrid close; end; the tsearchgridform activated caller form .show (not modal) , when deactivated want close/hide if new active control <> callerform.dbgrid.
only if user clicked on dbgrid on caller form search form should remain visible, otherwise need close it.
how can this?
delphi's tscreen object has events onactivecontrolchange , onactiveformchange. can set event handlers these monitor changes , react them.
see d7 online more info. there delphi vcl code examples of using both events.
Comments
Post a Comment