제목 타이틀바는 분명히 form create 할때 선언을 했거든요..
그런데 다른 stringgrid를 클릭했을 경우 제목 타이블바가 날짜값으로 보이게 변경이 되네요...
지금 현재는 셀의 0,1번째인 물품코드,물품명 이름이 날짜 값이 있는 셀의 12번째 값으로 바뀌는거 같아요...
제가 생각하기엔 stringgrid에서 drawcell 이벤트에서 먼가 바꾸는거 같은데요..
님들의 조언을 부탁드립니다...
소스는 아래와 같습니다...
procedure FormCreate(Sender: TObject);
begin
with sgd_1 do
begin
Cells[0,0] := '물품코드';
Cells[1,0] := '물품명';
Cells[2,0] := '청구량';
Cells[3,0] := '불출량';
Cells[4,0] := '완료여부';
Cells[5,0] := '정수량';
Cells[6,0] := '전일재고';
Cells[7,0] := '현재고량';
Cells[8,0] := '물품구분';
Cells[9,0] := '비고';
Cells[10,0] := 'mtr_type';
Cells[11,0] := '청구자';
Cells[12,0] := '청구시간';
Cells[13,0] := '반납자';
Cells[14,0] := '반납시간';
Cells[15,0] := '반납확인량';
ColWidths[0]:= 70;
ColWidths[1]:= 200;
ColWidths[2]:= 74;
ColWidths[3]:= 74;
ColWidths[4]:= -1;
ColWidths[5]:= -1;
ColWidths[6]:= 74;
ColWidths[7]:= 74;
ColWidths[8]:= 70;
ColWidths[9]:= 200;
ColWidths[10]:= -1;
ColWidths[11]:= 70;
ColWidths[12]:= 150;
ColWidths[13]:= 70;
ColWidths[14]:= 150;
ColWidths[15]:= 74;
end;
procedure sgd_1DrawCell(Sender: TObject; ACol, ARow: Integer;
Rect: TRect; State: TGridDrawState);
begin
if ARow < 1 then exit;
if ACol = 1 then
gp_MakeGridLine(sgd_1, ARow, ACol, 10, clBlack, $00ECDFD0);
if (ACol = 0) or (ACol = 5) or (ACol = 6) or
(ACol = 7) or (ACol = 8) then
gp_MakeGridLine(sgd_1, ARow, ACol, 10, clBlack, $00E4E4E4);
if ACol = 2 then
gp_MakeGridLine(sgd_1, ARow, ACol, 10, clBlack, $00E1F0E2);
if ACol = 3 or ACol = 4 then
gp_MakeGridLine(sgd_1, ARow, ACol, 10, clBlack, sgd_1.Color);
if ARow = sgd_1.Row then
gp_MakeGridLine(sgd_1, ARow, ACol, 10, clHighLightText, clHighLight);
end;
procedure gp_MakeGridLine(sgd_name:TStringGrid; iLine,iCol,iFsize: Integer;FColor,BColor:TColor);
var
rRect: TRect;
begin
sgd_name.Canvas.Font.Name := '굴림체';
sgd_name.Canvas.Brush.Color:= BColor;
sgd_name.Canvas.Font.Color:= FColor;
sgd_name.Canvas.Font.Size := iFsize;
rRect:= sgd_name.CellRect(iCol,iLine);
sgd_name.Canvas.FillRect(rRect);
sgd_name.Canvas.TextOut(rRect.Left+2,rRect.Top+2,sgd_name.Cells[iCol,iLine]);
end;
procedure sg_1.Click();
var
i, j : Integer;
begin
if sgd_1.Row < 1 then Exit;
j := 1;
for i := 1 to sgd_2.Rowcount - 1 do
begin
if sgd_2.Cells[5,i] = 'S' then
begin
sgd_2.Cells[5,i] := '';
j := i;
end;
end;
for i := 0 to sgd_1.Colcount do
begin
if i = 1 then
gp_MakeGridLine(sgd_1, j, i, 10, clBlack, $00ECDFD0);
if (i = 4) or (i = 9) then
gp_MakeGridLine(sgd_1, j, i, 10, clBlack, sgd_1.Color);
if (i = 0) or (i = 5) or (i = 6) or
(i = 7) or (i = 8) then
gp_MakeGridLine(sgd_1, j, i, 10, clBlack, $00E4E4E4);
if i = 2 then
gp_MakeGridLine(sgd_1, j, i, 10, clBlack, $00E1F0E2);
if i = 3 then
gp_MakeGridLine(sgd_1, j, i, 10, clBlack, sgd_1.Color);
end;
sgd_2.Cells[5,sgd_1.Row] := 'S';
for i := 0 to sgd_1.Colcount - 2 do
gp_MakeGridLine(sgd_1, sgd_1.Row, i, 10, clHighLightText, clHighLight);
end;
어떻게 된건지?
아시겠나요?? ㅡㅡ;;