[0.9.26.2] StringGrid : Explication comportement
Bonjour,
Je me bats toujours avec les StringGrids de Lazarus.
J'utilise l'IDE pour construire les colonnes de StringGrid1.
1er code : RAS
http://www.selzig.com/0908061100/code1.jpg
2ème code : Je déclare dans les évènements de la table un OnDrawCell "vide"
http://www.selzig.com/0908061100/code2.jpg
Et là, les titres des colonnes n'apparaissent plus. Pourquoi ?
StringGrid1 --> Option : DefaultDrawing := true;
En false, avec un code identique, la table est vide (et grisée si OnDrawcell "déclaré") mais là aussi dès que OnDrawCell est déclaré les titres sont effacés.
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
| LCLVersion = '0.9.26.2'
object StringGrid1: TStringGrid
Left = 16
Height = 100
Top = 160
Width = 472
ColCount = 7
Columns = <
item
Title.Caption = 'Col1'
end
item
Title.Caption = 'Col2'
end
item
Title.Caption = 'Col3'
end
item
Title.Caption = 'Col4'
end
item
Alignment = taCenter
Title.Alignment = taCenter
Title.Caption = 'Sel'
end
item
Title.Caption = 'Tri'
end>
Options = [goFixedVertLine, goFixedHorzLine, goVertLine, goHorzLine, goRangeSelect, goRowSelect, goAlwaysShowEditor, goSmoothScroll]
TabOrder = 0
OnDrawCell = StringGrid1DrawCell
end |
Merci d'avance. Gilles