var i:integer; begin for i:=0 to dbgrid1.FieldCount-1 do dbgrid1.Fields[i].Alignment:=taRightJustify;
用自画方式“画”出字符。在自画事件的参数中有 Rect 参数,使用 DrawText(Handle,pchar(ShowText),-1,ARect,DT_LEFT or DT_SINGLELINE or DT_VCENTER);//左对齐 DrawText(Handle,pchar(ShowText),-1,ARect,DT_RIGHT or DT_SINGLELINE or DT_VCENTER);//右对齐 DrawText(Handle,pchar(ShowText),-1,ARect,DT_CENTER or DT_SINGLELINE or DT_VCENTER);//居中对齐
align要是有用早就解决了。
i:integer;
begin
for i:=0 to dbgrid1.FieldCount-1 do
dbgrid1.Fields[i].Alignment:=taRightJustify;
用自画方式“画”出字符。在自画事件的参数中有 Rect 参数,使用
DrawText(Handle,pchar(ShowText),-1,ARect,DT_LEFT or DT_SINGLELINE or DT_VCENTER);//左对齐
DrawText(Handle,pchar(ShowText),-1,ARect,DT_RIGHT or DT_SINGLELINE or DT_VCENTER);//右对齐
DrawText(Handle,pchar(ShowText),-1,ARect,DT_CENTER or DT_SINGLELINE or DT_VCENTER);//居中对齐