qas
asked on
Format StringGrid
Hello guys!
How do I format each unique row of a StringGrid ?
Example: how can I alternate white and gray rows in a list put in a StringGrid (five rows: white, gray, white, gray, white) ?
Also, how can I NOT get the selected blue highlight when I click on the grid ?
At last, how can I align a single cell ?
Thanks!
How do I format each unique row of a StringGrid ?
Example: how can I alternate white and gray rows in a list put in a StringGrid (five rows: white, gray, white, gray, white) ?
Also, how can I NOT get the selected blue highlight when I click on the grid ?
At last, how can I align a single cell ?
Thanks!
You can use TStringGrid's OnDrawCell event. Look Delphi Help to get a pretty good example.
ASKER
well...
I managed to code something near OK with Canvas.FillRect(Rect) stuff but there is a little problem: I can't put text in there since it paints the whole cell...
any help ?
Thanks
I managed to code something near OK with Canvas.FillRect(Rect) stuff but there is a little problem: I can't put text in there since it paints the whole cell...
any help ?
Thanks
ASKER
Let me get you some more precisions...
I want to paint the background of some cells but be able to put some text in it.
Thanks again
I want to paint the background of some cells but be able to put some text in it.
Thanks again
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Why not use the TStringAlignGrid component available free from www.hoerstemeier.com - it allows all of what you have asked and an awful lot more.
Adam
Adam
ASKER
Thanks Steve! Worked fine!
Great! I thought that may help you to suss it out!
Best Wishes,
Steve
Best Wishes,
Steve