Re: DBGrid1.OnDrawColumnCell goes into infinite loop
- From: Bjorge Sæther <bjorge@xxxxxxxx>
- Date: Fri, 27 Jan 2006 11:04:35 +0100
Chris L. wrote:
Hi, I use the following code in OnDrawColumnCell to embed DBCheckboxes into a DBGrid. Everything works fine until I move (using mouse drag) a column with a checkbox to another column location. The drawing of the active column Checkbox going into infinite loop and causes the screen to freeze. There is no code in OnColumnMoved method.
Any suggestion will be greatly appreciated.
[...]
if (gdFocused in State) then begin if (Column.Field.FieldName = DBCheckBoxFiled.DataField) then begin //DBCheckBoxFiled.Left := Rect.Right + DBCheckBoxFiled.Width; //Rect.Left + DBGrid1.Left + 2; //DBCheckBoxFiled.Left := 68; //Rect.Left + DBGrid1.Left + DBCheckBoxFiled.Width;//Rect.Right + 6; DBCheckBoxFiled.Left := Round((Rect.Left + Rect.Right - DBCheckBoxFiled.Width)/2) + 5; // the CheckBox "floats" on top of the DBGrid, measured from the same Left starting point DBCheckBoxFiled.Top := Rect.Top + DBGrid1.top + 2; DBCheckBoxFiled.Width := 17; //Rect.Right - Rect.Left; DBCheckBoxFiled.Height := Rect.Bottom - Rect.Top;
DBCheckBoxFiled.Visible := True;
I'd guess there was something here - moving the checkbox around would possibly require another drawing of cells - etc...
Bjoerge .
- References:
- DBGrid1.OnDrawColumnCell goes into infinite loop
- From: Chris L.
- DBGrid1.OnDrawColumnCell goes into infinite loop
- Prev by Date: Re: fix for blinking data-aware controls?
- Next by Date: Re: fix for blinking data-aware controls?
- Previous by thread: Re: DBGrid1.OnDrawColumnCell goes into infinite loop
- Next by thread: Event handlers...
- Index(es):
Relevant Pages
|