From: Mauro =?iso-8859-1?Q?Pati=F1o?= Subject: Re: TStringGrid Appearance. Date: 20 Jul 2000 00:00:00 GMT Message-ID: <39777178.A62695CA@govst.edu> Content-Transfer-Encoding: 7bit References: <3977643a@dnews> X-Accept-Language: en Content-Type: text/plain; charset=us-ascii Organization: Another Netscape Collabra Server User Mime-Version: 1.0 Newsgroups: borland.public.delphi.vcl.components.using Tom Alexander wrote: > How do I make the fixed row font and text centering different than the > remainder of the rows in a TStringGrid component? Just handle the OnDrawCell event, procedure TForm1.StringGrid1DrawCell(Sender: TObject; ACol, ARow: Integer; Rect: TRect; State: TGridDrawState); var Format: integer; begin if ARow = 0 then Format := DT_SINGLELINE or DT_VCENTER or DT_CENTER else Format := DT_SINGLELINE or DT_VCENTER or DT_RIGHT; StringGrid1.Canvas.FillRect(Rect); DrawText(StringGrid1.Canvas.Handle, PChar(StringGrid1.Cells[ACol,ARow]), -1, Rect, Format); end; Visit http://www.govst.edu/users/gsmpati/delphi for an example of a nicely formatted TStringGrid. Good Luck.