![]() |
|
#1
|
|||
|
|||
|
I have a DBGrid that I need to eliminate the highlight from when an individual cell is being edited. The grid is black and the font is a custom yellow. Looks ugly but that is what the user asked for. Anyway, I have the following code in the program and it works fine but when I start to type new data in a cell it highlights white until you exit the cell. I need to get rid of the white highlight. Can anyone tell me what I am doing wrong or what I am forgetting to do? Thanks in advance.
Rich procedure TForm1.DBGrid1DrawColumnCell (Sender: TObject; const Rect: TRect; DataCol: Integer; Column: TColumn; State: TGridDrawState); begin if gdFocused in State then begin DBGrid1.Canvas.Brush.Color:=clBlack; DBGrid1.Canvas.Font.Color:=$0080FFFF; end else if gdSelected in State then begin DBGrid1.Canvas.Brush.Color:=clBlack; DBGrid1.Canvas.Font.Color:=$0080FFFF; end else if gdFixed in State then begin DBGrid1.Canvas.Brush.Color:=clBlack; DBGrid1.Canvas.Font.Color:=$0080FFFF; end else begin DBGrid1.Canvas.Brush.Color:=clBlack; DBGrid1.Canvas.Font.Color:=$0080FFFF; end; DBGrid1.Canvas.FillRect(Rect); DBGrid1.DefaultDrawDataCell(Rect, Column.Field, State); end; |
|
#2
|
|||
|
|||
|
The white "highlight" is actually the InPlace editor's background.
You will have to override the painting of the IPE in order to do this... |
|
#3
|
|||
|
|||
|
Thanks...that worked great
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|