Recent

Author Topic: [SOLVED] - TStringGrid - Programmatically highlight a Row  (Read 2791 times)

Zvoni

  • Hero Member
  • *****
  • Posts: 3140
[SOLVED] - TStringGrid - Programmatically highlight a Row
« on: July 31, 2018, 09:14:57 am »
Hi Folks,

i have a TStringGrid, which i'm running through from Bottom to Top, and i want the User to see which row is currently being processed
(The Grid is a list of files which have to be copied to somewhere using CopyFileEx with two Progressbars).

Setting MyGrid.Row:=i causes the Scrollbar to move, but the Row isn't highlighted (and i have the option goRowHighlight switched to True).

I've looked at the Selection-Property, but somehow it escapes me how to Select/Highlight the whole row from code.

Help?
« Last Edit: July 31, 2018, 10:46:33 am by Zvoni »
One System to rule them all, One Code to find them,
One IDE to bring them all, and to the Framework bind them,
in the Land of Redmond, where the Windows lie
---------------------------------------------------------------------
Code is like a joke: If you have to explain it, it's bad

Josh

  • Hero Member
  • *****
  • Posts: 1425
Re: TStringGrid - Programmatically highlight a Row
« Reply #1 on: July 31, 2018, 10:43:06 am »
Hi

Attached Quick StringGrid with DrawCell etc, hopefully may help

The best way to get accurate information on the forum is to post something wrong and wait for corrections.

Zvoni

  • Hero Member
  • *****
  • Posts: 3140
Re: TStringGrid - Programmatically highlight a Row
« Reply #2 on: July 31, 2018, 10:45:45 am »
Heya Josh,

thx, but i got it solved.

Just declared a TGridRect-var which i assigned to Selection,
and then just a MyGrid.Refresh!

Solved!
One System to rule them all, One Code to find them,
One IDE to bring them all, and to the Framework bind them,
in the Land of Redmond, where the Windows lie
---------------------------------------------------------------------
Code is like a joke: If you have to explain it, it's bad

 

TinyPortal © 2005-2018