Board index » delphi » Highlight a row on a StringGrid

Highlight a row on a StringGrid

Hi,
  Could anyone tell me if it is possible to select(Highlight) a row on a
StringGrid??

  I'm tring to write Highlight one row specified by a random number like

procedure  SelectRow(Row: integer);
begin
...
end;

Thank You So Much
Sam Lau

 

Re:Highlight a row on a StringGrid


Sam,

Try setting the stringgrid1.options.gorowselect to true.

...Jim

Quote
Sam Lau wrote:
> Hi,
>   Could anyone tell me if it is possible to select(Highlight) a row on a
> StringGrid??

>   I'm tring to write Highlight one row specified by a random number like

> procedure  SelectRow(Row: integer);
> begin
> ...
> end;

> Thank You So Much
> Sam Lau

Re:Highlight a row on a StringGrid


In article <9f1fte$e...@imsp212.netvigator.com>, "Sam Lau"

Quote
<sam...@itsit.com.hk> writes:
>  Could anyone tell me if it is possible to select(Highlight) a row on a
>StringGrid??

Set the Selection to the rows and cells you want selected. Selection is a
TGridRect, so you must typecast the result of the Rect() function. For
selecting row 2 (the third row) use ...

  with StringGrid1 do
    Selection := TGridRect(Rect(0, 2, ColCount - 1, 2));

Alan Lloyd
alangll...@aol.com

Other Threads