procedure TForm1.DBGrid1DrawColumnCell(Sender: TObject; const Rect: TRect;
DataCol: Integer; Column: TColumn; State: TGridDrawState);
Var
P : array[0..50] of char;
BS : tBlobstream;
S : String;
begin
if Field is TMemoField then
begin
With (Sender as TDBGrid).Canvas do
begin
BS := tBlobstream.Create(Table1Notes,bmRead);
FillChar(P,sizeof(P),#0);
BS.Read(p,50);
BS.Free;
S:= StrPos(p);
While Pos(#13,S) > 0 do
S[pos(#13,s)]:=' ';
while Pos(#10,S) > 0 do
S[pos(#10,S)]:=' ';
FileRect(Rect);
TextOut(Rect.Left.Rect.Top,s);
end;
end;
end;
OnDBGrid1DrawColumnCell를 이용한다..
TMemoField Object를 생성하기 이런에.. TTable을 더블 클릭하여..
Memo Field를 추가한다...(Query로 바꾸어도 상관없을듯)
procedure TForm1.DBGrid1DrawColumnCell(Sender: TObject; const Rect: TRect;
DataCol: Integer; Column: TColumn; State: TGridDrawState);
Var
P : array[0..50] of char;
BS : tBlobstream;
S : String;
begin
if Field is TMemoField then
begin
With (Sender as TDBGrid).Canvas do
begin
BS := tBlobstream.Create(Table1Notes,bmRead);
FillChar(P,sizeof(P),#0);
BS.Read(p,50);
BS.Free;
S:= StrPos(p);
While Pos(#13,S) > 0 do
S[pos(#13,s)]:=' ';
while Pos(#10,S) > 0 do
S[pos(#10,S)]:=' ';
FileRect(Rect);
TextOut(Rect.Left.Rect.Top,s);
end;
end;
end;