Answer the question
In order to leave comments, you need to log in
How to add a column (field) to several tables at once?
Good day. I have 7 tables, I need to add the same field to all 7 tables, can I somehow do this with one command or action?
Thank you !
Answer the question
In order to leave comments, you need to log in
You can use TRichEdit.
Or using DrawCellTextOut
, output to TDBGrid like this:
procedure TAlbumDetailFR.grReleaseDrawColumnCell(Sender: TObject; const Rect: TRect;
DataCol: Integer; Column: TColumnEh; State: TGridDrawState);
var iLeft: Integer;
begin
case DataCol of
0: with grRelease.Canvas do begin
FillRect( Rect );
iLeft := 2;
DrawCellTextOut( TDBGridEh(Sender).Canvas, Rect, iLeft, taReleaseYear.Value + ' ' );
Font.Style := [fsBold];
DrawCellTextOut( TDBGridEh(Sender).Canvas, Rect, iLeft, taReleaseNumber.Value + ' ' );
Font.Style := [];
DrawCellTextOut( TDBGridEh(Sender).Canvas, Rect, iLeft, taReleaseFirmName.Value );
end;
end;
end;
DrawCellTextOut
:procedure DrawCellTextOut( Canvas: TCanvas; const Rect: TRect; var Left: Integer; Text: String );
begin
with Canvas do begin
if ( Length( Trim( Text )) > 0 )
and (( Rect.Right - Rect.Left - Left ) > ( TextWidth('…') + 1)) then begin
while (( TextWidth( Text ) + 1 ) > ( Rect.Right - Rect.Left - Left ))
do Text := Copy( Text, 1, Length( Text ) - 2) + '…';
TextOut( Rect.Left + Left, Rect.Top + 1, Text );
Inc( Left, TextWidth( Text ) + 1);
end;
end;
end;
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question