Re: DBGrid1.OnDrawColumnCell goes into infinite loop



Hi Alan,

It does not help in my case. When I move the column with the CheckBox
floating over it, you can still see the CheckBox being redrawn continuously
after the move.

However, it's good to know this information.

Chris

<alanglloyd@xxxxxxx> wrote in message
news:1138343113.276693.60460@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> > 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
>


.



Relevant Pages

  • Re: DBGrid1.OnDrawColumnCell goes into infinite loop
    ... but obviously the OnDrawColumnCell is being called ... via some other external code. ... Then the ODCC code will not be called by external events while the ODCC ...
    (comp.lang.pascal.delphi.misc)
  • Re: Changing a JCheckBox without activating ItemListeners
    ... by the user clicking the checkbox, or from other external events). ... don't want to invoke the ItemListener when the program changes the state, ... programatic change method and checking it in the ItemListener? ...
    (comp.lang.java.gui)
  • Changing a JCheckBox without activating ItemListeners
    ... by the user clicking the checkbox, or from other external events). ... because I sometimes end up in a state where the user hits the checkbox a ... programatic change method and checking it in the ItemListener? ...
    (comp.lang.java.gui)