画DBGRID,DBGRIDEH中文帐簿金额栏
来源:互联网 发布:炫踪网络红杉 编辑:程序博客网 时间:2024/06/06 02:46
procedure TformBuy.DBGrid1DrawDataCell(Sender: TObject; const Rect: TRect;
Field: TField; State: TGridDrawState);
var
S: String;
i, x, y, iTextWidth: Integer;
begin
// if Field.DataType <> ftBCD then Exit;
if Field.FieldName <> 'jxdmoney' then Exit;
with TDBGrideh(Sender).Canvas do
begin
iTextWidth := TextWidth('8') + 4;
y := Rect.Top + (Rect.Bottom - Rect.Top - TextHeight('8')) div 2;
S := StringReplace(FormatFloat('0.00', Field.AsCurrency), '.', '', []);
if Field.AsCurrency < 0 then Font.Color := clRed;
FillRect(Rect);
i := (Rect.Right - Rect.Left) div iTextWidth;
repeat
x := Rect.Right - iTextWidth * i;
if i <= Length(S) then
TextOut(x+3, y, S[Length(S)-i+1]);
if i = 2 then
Pen.Color := clRed
else if (i = 0) or ( (i>2) and (((i-2) mod 3) = 0) ) then
Pen.Color := clGreen
else
Pen.Color := clSilver;
MoveTo(x, Rect.Top);
LineTo(x, Rect.Bottom);
Dec(i);
until (i<0)
end;
end;
- 画DBGRID,DBGRIDEH中文帐簿金额栏
- DBGridEh和dbgrid导出
- DBGrid、DBGrideh专题总结
- DBGrid和DBGridEH
- DBGridEh,DBGrid点击标题排序
- DBGridEh,DBGrid点击标题排序
- Delphi 同时使用 dbgrid ,dbgrideh 的冲突
- DBGridEh, DBGrid显示如何按指定合适显示日期时间
- DBGRIDEh
- dbgrideh
- 金额转为中文
- EXCEL中文金额转换
- 中文大写金额转换
- 金额转中文大写
- 金额转中文大写
- 金额转化中文算法
- 小写金额转换成中文大写金额
- 小写金额转换成中文大写金额
- android应用如何启动另外一个apk应用
- OVS上创建了一个vlan
- [leetcode] Word Ladder
- python如何打印日志
- English Game
- 画DBGRID,DBGRIDEH中文帐簿金额栏
- POJ 2752 Seek the Name, Seek the Fame
- 拓扑排序(栈)——POJ 1094
- hdu 4893 Wow! Such Sequence!
- [Linux]scp 命令远程复制
- 循环报数问题
- 一步一步教你怎样给Apache Spark贡献代码
- Button cannot be resolved to a type报错
- Mmap的实现原理和应用