Hi, Joaquim.
JH> Is there a way to change the alignment of data that appears in a
JH> TStringGrid cell? I'm using a TSG (instead of a Listbox) to display a
numbe
JH> of records from a binary file and want to right-align the display of some
o
JH> the cells.. ?
I do it by setting the style to OwnerDraw, then in the OnDrawCell
event I have
if Col in [0, 2, 3, 5..10] then
Left := Rect.Right -
Entrant.Canvas.TextWidth (Entrant.Cells[Col, Row]) - 2
else
Left := Rect.Left + 2;
Entrant.Canvas.TextOut (Left, Rect.Top, Entrant.Cells[Col, Row]);
Which right-justifies the specified columns and left-justifies the rest,
allowing 2 pixels from the border in each case.
Regards, fIM.
---
þ * þ þ It's time for SCREAMING WITH BINKY!
---
---------------
* Origin: Pedants Inc. (3:712/610.24)
|