Subject Re: [IBO] Trouble with TDateTimeEnh
Author Geoff Worboys
> It appears to a random timing thing. I can click the drop
> down button then click a date and the chances of it giving
> the error seem to about 50-50.

Can you pick a difference in the call stack if you put in
a break in the code (at the SetFocus call if you can).

We need to work out the timing of the closeevent call, to
see how it is that the controller has managed to get to
be invisible before the call completes. If you can get the
callstacks from a successful run and a failed run then
perhaps I can try and make sense of it. (I dont do much
grid-based editing here, so have nothing to experiment
with myself.)

It also occurs to me that there may be a call to
Application.ProcessMessages happening within the Change
or CloseUp function calls. If you can use the debug delphi
libs and break in the processmessages call we may see who is
doing it and if there is a way around it.

If all else fails you could stick in some code that tests
whether the controller's parent is based on TIB_CustomGrid
and if so, and controller is not visible, focus the grid
instead. That might work, even if ugly.

> Does the controller have a grid property so something like
> 'if not visible and on a grid then focus the grid'?

Not yet ;-)

--
Geoff Worboys
Telesis Computing