//도움이 되실지 모르겠군요
procedure TY704ANF.StringGrid1DrawCell(Sender: TObject; ACol,
ARow: Integer; Rect: TRect; State: TGridDrawState);
var
mAlign : word;
TW: integer;
begin
with StringGrid1 do
begin
if (ARow = 0) or (ARow = 1) then //첫번쨰칸과 두번쨰칸은 중간에 정렬
begin
mAlign := TA_CENTER;
end
else //나머지는 오른쪽 정렬
begin
mAlign := TA_RIGHT;
end;
if (ARow = 1) or (ARow = 0) then //두칸 색깔은 변경
begin
Canvas.Brush.Color := $00FFEFD2;
Canvas.Font.Style := [fsbold];
end;
if mAlign = TA_RIGHT then
StringGrid1.Canvas.TextRect(Rect,Rect.Right-2,Rect.Top+5,StringGrid1.Cells[ACol,ARow])
else if mAlign = TA_LEFT then //align left
StringGrid1.Canvas.TextRect(Rect,Rect.Left+2,Rect.Top+5,StringGrid1.Cells[ACol,ARow])
else if mAlign = TA_CENTER then //align Center
begin
TW := Rect.Left + Round((Rect.Right - Rect.Left) / 2);
StringGrid1.Canvas.TextRect(Rect,
TW,Rect.Top+5,StringGrid1.Cells[ACol,ARow]);
//도움이 되실지 모르겠군요
procedure TY704ANF.StringGrid1DrawCell(Sender: TObject; ACol,
ARow: Integer; Rect: TRect; State: TGridDrawState);
var
mAlign : word;
TW: integer;
begin
with StringGrid1 do
begin
if (ARow = 0) or (ARow = 1) then //첫번쨰칸과 두번쨰칸은 중간에 정렬
begin
mAlign := TA_CENTER;
end
else //나머지는 오른쪽 정렬
begin
mAlign := TA_RIGHT;
end;
if (ARow = 1) or (ARow = 0) then //두칸 색깔은 변경
begin
Canvas.Brush.Color := $00FFEFD2;
Canvas.Font.Style := [fsbold];
end;
SetTextAlign(StringGrid1.Canvas.Handle, mAlign); //설경
if mAlign = TA_RIGHT then
StringGrid1.Canvas.TextRect(Rect,Rect.Right-2,Rect.Top+5,StringGrid1.Cells[ACol,ARow])
else if mAlign = TA_LEFT then //align left
StringGrid1.Canvas.TextRect(Rect,Rect.Left+2,Rect.Top+5,StringGrid1.Cells[ACol,ARow])
else if mAlign = TA_CENTER then //align Center
begin
TW := Rect.Left + Round((Rect.Right - Rect.Left) / 2);
StringGrid1.Canvas.TextRect(Rect,
TW,Rect.Top+5,StringGrid1.Cells[ACol,ARow]);
end;
end;
end;
도움이 되실지 모르겠습니다
항상 즐코하세요^ㅡ^