
現有數量跟最大數量和最小數量比較 改變 計劃采購量里面的顏色
uj5u.com熱心網友回復:
procedure TLForm.sGridDrawCell(Sender: TObject; ACol,ARow: Integer; Rect: TRect; State: TGridDrawState);
begin
if (ARow=行) and(ACol=列) then
begin
with sGrid do
begin
//設定顏色
Canvas.Brush.Color := RGB(227,249,248);
Canvas.TextRect(rect,rect.Left+2,rect.Top+2,Cells[acol, arow]);
Canvas.FrameRect(Rect);
end;
end;
end;
uj5u.com熱心網友回復:
procedure TForm_SumBill0.SHDBGridEh1DrawColumnCell(Sender: TObject;
const Rect: TRect; DataCol: Integer; Column: TColumnEh;
State: TGridDrawState);
var
Times1,vMax:Real;
begin
inherited;
if (Column.FieldName='BFCount') or (Column.FieldName='CCCount') then
begin
if (QueryBill1.FieldByName('BFCount').AsFloat=0) or (QueryBill1.FieldByName('CCCount').AsFloat=0) then
Exit;
Times1:=Abs(QueryBill1.FieldByName('BFCount').AsFloat - QueryBill1.FieldByName('CCCount').AsFloat);
vMax:= Max(QueryBill1.FieldByName('BFCount').AsFloat , QueryBill1.FieldByName('CCCount').AsFloat);
if (vMax>0) and (Times1/vMax>0.1) then
begin
SHDBGridEh1.Canvas.Font.Color:=$002209D2;
end;
SHDBGridEh1.DefaultDrawColumnCell(Rect, DataCol, Column, State);
end;
end;
轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/32625.html
標籤:VCL組件開發及應用
上一篇:公司需要做復雜報表,第一次用delphi,搞不定ReportMachine,請問哪位大神能幫忙遠程安裝一下,謝謝
下一篇:Delphi問題
