Forum > General

Font draw in customdraw in dbgid

(1/1)

mikutu:
if set color in DBGrid1DrawColumnCell and call DefaultDrawColumnCell font draw another if not use custom draw. In picture attach up - standart draw, down - custom draw.


--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---procedure TfrmMain.DBGrid1DrawColumnCell(Sender: TObject; const Rect: TRect;  DataCol: Integer; Column: TColumn; State: TGridDrawState);var  x, y: integer;  isSelect: boolean;begin  isSelect := ((gdFocused in State) or (gdSelected in State));  if (not isSelect) then begin    TDBGrid(Sender).Canvas.Font.Color := $00C04020;    TDBGrid(Sender).DefaultDrawColumnCell(Rect, DataCol, Column, State);  end;end; 

jamie:
Use "OnPrepairCanvas" to set the font and colors prior to painting.

mikutu:
thank you, it's work

Navigation

[0] Message Index

Go to full version