Board index » delphi » TStringGrid selection rectangle
Barney Tyrwhitt-Drake
![]() Delphi Developer |
Sat, 18 Jul 1998 03:00:00 GMT
|
Barney Tyrwhitt-Drake
![]() Delphi Developer |
Sat, 18 Jul 1998 03:00:00 GMT
TStringGrid selection rectangle
I have a problem with the persistence, in the sense that it won't go
away, of the selection rectangle in the TStringGrid component. If the grid is used for displaying results in a tabular form, the default behaviour is for the top left cell to be selected when a StringGrid is displayed. How can it be made to disappear? I've resorted to this code in the OnPaint event, var which gets rid of it, but surely there is a more elegant solution? I |
Barr
![]() Delphi Developer |
Sun, 19 Jul 1998 03:00:00 GMT
Re:TStringGrid selection rectangleQuoteBarney Tyrwhitt-Drake <bar...@tdrake.demon.co.uk> wrote: want in each cell. By ignoring the State variable and always using the default Brush, you can get rid of the selection. An advantage to drawing your own text in each cell is that you can center or right justify the text if you wish. You can find a code example in the freeware VCL component NEWCAL.ZIP located at either Grumpfish or the Delphi Super Page. There are links to each site from my WWW page. Barry. /---------------------------------------------------------------\ |
Mark Jacks
![]() Delphi Developer |
Tue, 21 Jul 1998 03:00:00 GMT
Re:TStringGrid selection rectangleTry this: 1. Disable Default Drawing. MyGrid.Canvas.TextRect Mark. ---------------------------------------------------------- Quotecanal...@vcomm.net (Barry) wrote: want in each cell. By ignoring the State variable and always using the default Brush, you can get rid of the selection. An advantage to drawing your own text in each cell is that you can center or right justify the text if you wish. You can find a code example in the freeware VCL component NEWCAL.ZIP located at either Grumpfish or the Delphi Super Page. There are links to each site from my WWW page. Barry. /---------------------------------------------------------------\ |