StringGrid Titre Colonne

Résolu
louiwahl Messages postés 103 Date d'inscription vendredi 20 février 2004 Statut Membre Dernière intervention 16 mai 2019 - 23 déc. 2005 à 16:53
louiwahl Messages postés 103 Date d'inscription vendredi 20 février 2004 Statut Membre Dernière intervention 16 mai 2019 - 26 déc. 2005 à 15:11
Bjr.



Quelqu'un sait'il comment savoir l'index d'une colonne StringGrid d'apres le titre



Merci d'avance et Boonnnes Fêtes a tous

Louis

2 réponses

cs_MAURICIO Messages postés 2106 Date d'inscription mardi 10 décembre 2002 Statut Modérateur Dernière intervention 15 décembre 2014 5
23 déc. 2005 à 19:06
tu fais une fonction qui parcoure toutes les colonnes et tu compares si c' est le titre que tu veux, c' est pas compliqué.

function FindColumn(aStringGrid: TStringGrid; Title: String): integer;
var c: integer;
begin
RESULT := -1;

for c := 0 to aStringGrid.Colcount - 1 do
if aStringGrid.Cells[C, 0] = Title
then begin
RESULT := c;
Break;
end;
end;

Je sais pas si c' est aStringGrid.Colcount et aStringGrid.Cells[C, 0] car j' ai fait le code de tete
3
louiwahl Messages postés 103 Date d'inscription vendredi 20 février 2004 Statut Membre Dernière intervention 16 mai 2019
26 déc. 2005 à 15:11
Cela marche tres bien



merci beaucoup

Louis
0
Rejoignez-nous