[Lazarus-es] DBGrid

francisco prieto fajprieto en gmail.com
Sab Dic 12 14:19:49 CET 2015


Te trascribo una ayuda del foro Delphi...

Use "OnDrawColumnCell" event and put ';' inside the caption of the column
between the two lines:


[DELPHI]procedure TForm2.DBGrid1DrawColumnCell(Sender: TObject; const Rect:
TRect;DataCol: Integer; Column: TColumn; State: TGridDrawState);
var
S1, S2: String;
sCaption : String;
begin
sCaption := Column.Title.Caption;

with DBGrid1 do begin
Canvas.Brush.Style := bsClear;

if Pos(';',sCaption) = 0 then begin
s1 := sCaption;
s2 := '';
end else begin
s1 := Copy(sCaption,1,Pos(';',sCaption)-1);
s2 := Copy(sCaption,Pos(';',sCaption)+1,Length(sCaption)-Length(s1));
end;

Canvas.TextOut(Rect.Left+2, 2, S1);
Canvas.TextOut(Rect.Left+2, 16, S2);
end;
end;[/DELPHI]

Regards,
Abdulaziz Jasser

Saludos,

Pancho
Córdoba
Argentina

2015-12-12 9:37 GMT-03:00 Héctor Fiandor <hfiandor en ceniai.inf.cu>:

> Dear fellows:
>
>
>
> I am using a DBGrid in a form. Some titles are too long and I want to
> write this line in a Multiline type.  I have read the Grids Reference Page,
> but I can’t found how to do this.
>
>
>
> I will appreciate any help.
>
>
>
> Saludos,
>
> Ing. Héctor Fiandor
>
> hfiandor en ceniai.inf.cu
>
>
>
> _______________________________________________
> Lazarus-es mailing list
> Lazarus-es en lists.lazarus.freepascal.org
> http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus-es
>
>
------------ próxima parte ------------
Se ha borrado un adjunto en formato HTML...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus-es/attachments/20151212/d9c8bedb/attachment-0002.html>


More information about the Lazarus-es mailing list