Bonsoir,
J'ai un StringGrid dans lequel je mets différents coups de tennis joués lors d'un point. Afin d'avoir un aperçu des derniers coups joués, je voudrais que mon StringGrid défile automatiquement à la fin de la "liste".
Voici le code qui gère le StringGrid:
J'espère que vous pourrez m'éclaircir.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23 void __fastcall TFMatch_En_Cours::MesBoutonsCodeClick(TObject *Sender) { TToolButton *BoutonClic = (TToolButton*)Sender; // transforme le pointeur Sender en type Button if (BoutonClic) //Teste si la transformation est reussi { if(AjouterLigne) { SGPoint_Jouer->RowCount=SGPoint_Jouer->RowCount+1; } TQuery *Requete_Coup_Jouer = new TQuery(this); Requete_Coup_Jouer->DatabaseName="Tennis"; Requete_Coup_Jouer->SQL->Clear(); Requete_Coup_Jouer->SQL->Add("Select idT_ListeCoups,S_Symbole,S_Libelle from t_listecoups where idT_ListeCoups="+(AnsiString)BoutonClic->Tag+";"); Requete_Coup_Jouer->Active=true; SGPoint_Jouer->Cells[0][SGPoint_Jouer->RowCount-1]=Requete_Coup_Jouer->FieldByName("idT_ListeCoups")->AsString; SGPoint_Jouer->Cells[1][SGPoint_Jouer->RowCount-1]=Requete_Coup_Jouer->FieldByName("S_Symbole")->AsString; SGPoint_Jouer->Cells[2][SGPoint_Jouer->RowCount-1]=Requete_Coup_Jouer->FieldByName("S_Libelle")->AsString; AjouterLigne=true; SetScrollPos(SGPoint_Jouer->Handle, SB_VERT, 100, TRUE); } }
PS: J'ai lui un topic qui pourrait peut être aidé mais je ne comprends pas trop comment cela fonctionne. Voici le lien
C'est par ici![]()
Partager