Re: DBGrid1.OnDrawColumnCell goes into infinite loop
- From: "alanglloyd@xxxxxxx" <alanglloyd@xxxxxxx>
- Date: 26 Jan 2006 22:25:13 -0800
> The drawing of the active column Checkbox going into
> infinite loop and causes the screen to freeze. There is
> no code in OnColumnMoved method.
I can't see where, but obviously the OnDrawColumnCell is being called
by something _in_ its code, via some other external code. So unhitch
whatever is calling the OnDrawColumnCell while _your code_ in it is
executing.
At the beginning of your OnDrawColumnCell code do ...
DBGrid1.OnDrawColumnCell := nil;
.... and at the end do ...
DBGrid1.OnDrawColumnCell := DBGrid1DrawColumnCell;
Then the ODCC code will not be called by external events while the ODCC
code is working.
This is a general solution to recursion problems in OnDraw control
event handlers.
Alan Lloyd
.
- Follow-Ups:
- Re: DBGrid1.OnDrawColumnCell goes into infinite loop
- From: Chris L.
- Re: DBGrid1.OnDrawColumnCell goes into infinite loop
- References:
- DBGrid1.OnDrawColumnCell goes into infinite loop
- From: Chris L.
- DBGrid1.OnDrawColumnCell goes into infinite loop
- Prev by Date: Re: Test if memory pointer is valid?
- Next by Date: Re: Event handlers...
- Previous by thread: DBGrid1.OnDrawColumnCell goes into infinite loop
- Next by thread: Re: DBGrid1.OnDrawColumnCell goes into infinite loop
- Index(es):