Précédent   Forum du club des développeurs et IT Pro > Environnements de développement > Delphi > Composants VCL
Composants VCL Utilisation des différents composants VCL (Visual Component Library)
Partagez cette discussion sur d'autres réseaux sociaux : Viadeo Twitter Google Facebook Digg Delicious MySpace Yahoo
Réponse
 
Outils de la discussion
Publicité
'
Vieux 31/12/2012, 19h26   #1
jer64
Nouveau Membre du Club
 
Inscription : mai 2002
Messages : 163
Détails du profil
Informations forums :
Inscription : mai 2002
Messages : 163
Points : 31
Points : 31
Par défaut Sélection et déselection de lignes ds un stringgrid/Delphi 7

Bonjour,

Avec un bouton je souhaite sélectionner ou déselectionner toutes les ligne d'un stringgrid.

Cela marche pour la sélection, mais pas pour la désélection.

Voici mon code :

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
33
34
35
 
 
procedure TFlistfact.Button5Click(Sender: TObject);
 
var
  i:integer;
 
 
begin
 
if button5.Caption='&Tout Sélectionner' then
begin
 
for i:=1 to stringgrid1.RowCount-1 do
begin
rowsselected.Add(i);
stringgrid1.Invalidate;
button5.Caption:='&Tout Désélectionner';
end;
end
else
 
begin
for i:=1 to stringgrid1.RowCount-1 do
begin
rowsselected.Delete(i);
stringgrid1.Invalidate;
 
button5.Caption:='&Tout Sélectionner';
end;
 
 
 
 
end;
Merci d'avance pour votre aide et bonnes fêtes.
jer64 est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 01/01/2013, 14h31   #2
Charly910
Membre chevronné
 
Avatar de Charly910
 
Homme Charly
Ingénieur TP
Inscription : décembre 2006
Messages : 582
Détails du profil
Informations personnelles :
Nom : Homme Charly
Localisation : France

Informations professionnelles :
Activité : Ingénieur TP
Secteur : Bâtiment Travaux Publics

Informations forums :
Inscription : décembre 2006
Messages : 582
Points : 664
Points : 664
Bonjour et bonnes fêtes à toi aussi,

essaye ceci :

Code :
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
Procedure TForm1.Button5Click(Sender: TObject);
var
  myRect : TGridRect ;
begin
   if (button5.Caption='&Tout Sélectionner') then
      begin
           myRect.Left := 1 ;
           myRect.Top  := 1 ;
           myRect.Right := stringgrid1.ColCount ;
           myRect.Bottom := Stringgrid1.RowCount ;
           StringGrid1.Selection := myRect ;
           Button5.Caption:='&Tout Désélectionner';
      end
   else
      begin
           myRect.Left := -1 ;
           myRect.Top  := -1 ;
           myRect.Right := -1 ;
           myRect.Bottom := -1 ;
           StringGrid1.Selection := myRect ;
           Button5.Caption:='&Tout Sélectionner';
      end;
End ;
A+

Charly
Charly910 est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 01/01/2013, 20h07   #3
jer64
Nouveau Membre du Club
 
Inscription : mai 2002
Messages : 163
Détails du profil
Informations forums :
Inscription : mai 2002
Messages : 163
Points : 31
Points : 31
Bonjour,

Merci pour ton code, cela marche mais le problème c'est que la sélection n'est pas maintenue si je click dans le stringgrid alors que je veux que ma déselection se fasse uniquement par mon bouton car j'ai un autre bouton qui doit déselectionner ligne par ligne.

Merci d'avance.
jer64 est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 02/01/2013, 09h23   #4
Charly910
Membre chevronné
 
Avatar de Charly910
 
Homme Charly
Ingénieur TP
Inscription : décembre 2006
Messages : 582
Détails du profil
Informations personnelles :
Nom : Homme Charly
Localisation : France

Informations professionnelles :
Activité : Ingénieur TP
Secteur : Bâtiment Travaux Publics

Informations forums :
Inscription : décembre 2006
Messages : 582
Points : 664
Points : 664
tu peux mettre la propriété Enabled à False.

Alors tu ne pourras plus éditer la grille, mais tu peux ajouter un bouton "Editer" qui bascule cette propriété à True ?

A+

Charly
Charly910 est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 02/01/2013, 10h14   #5
Charly910
Membre chevronné
 
Avatar de Charly910
 
Homme Charly
Ingénieur TP
Inscription : décembre 2006
Messages : 582
Détails du profil
Informations personnelles :
Nom : Homme Charly
Localisation : France

Informations professionnelles :
Activité : Ingénieur TP
Secteur : Bâtiment Travaux Publics

Informations forums :
Inscription : décembre 2006
Messages : 582
Points : 664
Points : 664
Sinon, tu mets gère toi même un tableau de booleen ISElect pour indiquer la sélection ou non de la ligne i et tu dessines la grille avec DrawCell :

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
33
34
35
36
37
38
39
40
41
42
43
procedure TForm1.Button2Click(Sender: TObject);
var
  i : Integer ;
begin
   if (button2.Caption='&Tout Sélectionner') then
      begin
         For i := 1 To StringGrid1.RowCount-1 Do
            ISelect[i] := True ;
         StringGrid1.Invalidate ;
         Button2.Caption:='&Tout Désélectionner';
       end
   else
      begin
         For i := 1 To StringGrid1.RowCount-1 Do
            ISelect[i] := False ;
         StringGrid1.Invalidate ;
         Button2.Caption:='&Tout Sélectionner';
      end;
End ;
 
procedure TForm1.StringGrid1DrawCell(Sender: TObject; ACol, ARow: Integer;
  Rect: TRect; State: TGridDrawState);
Begin  
  With Sender As TStringGrid Do With Canvas Do
  Begin
    { sélection de la couleur de fond }
    If (ACol > 0 ) Then
    If ISelect[ARow] Then
       Begin
          Brush.Color := clBlue ;
          Font.Color := clWhite ;
       End
    Else
       Begin
          Brush.Color := clBtnFace ;
          Font.Color :=  ClBlack ;
       End ;   
    { Dessin du fond }
    FillRect(Rect);
    { Dessin du texte }
    TextOut(Rect.Left,Rect.Top,Cells[ACol,ARow]);
  End;
end;
Charly
Charly910 est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 02/01/2013, 12h21   #6
jer64
Nouveau Membre du Club
 
Inscription : mai 2002
Messages : 163
Détails du profil
Informations forums :
Inscription : mai 2002
Messages : 163
Points : 31
Points : 31
Bonjour Charly,

Merci pour ton code mais Iselect n'est pas déclaré. Je ne sais pas en quoi je dois le déclarer.

Merci d'avance.
jer64 est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 02/01/2013, 14h56   #7
Charly910
Membre chevronné
 
Avatar de Charly910
 
Homme Charly
Ingénieur TP
Inscription : décembre 2006
Messages : 582
Détails du profil
Informations personnelles :
Nom : Homme Charly
Localisation : France

Informations professionnelles :
Activité : Ingénieur TP
Secteur : Bâtiment Travaux Publics

Informations forums :
Inscription : décembre 2006
Messages : 582
Points : 664
Points : 664
par exemple comme ceci (mais cela dépend du nombre maxi de lignes de ton TStringGrid) :

Code :
1
2
3
var
  Form1: TForm1;
  ISelect : Array[0.. 100] of Boolean ;
ISelect doit être visible dans toute la fiche
Charly910 est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 02/01/2013, 16h52   #8
jer64
Nouveau Membre du Club
 
Inscription : mai 2002
Messages : 163
Détails du profil
Informations forums :
Inscription : mai 2002
Messages : 163
Points : 31
Points : 31
Merci beaucoup le code marche mais ne cohabite pas du tout avec le reste de mon code. En plus avec Array je suis coincé car je ne connais pas le nombre de ligne de mon stringgrid à l'avance et il est variable.

En fait j'ai un bouton pour "Tout sélectionner/désélectionner" et un bouton pour "sélectionner/déselectioner" les lignes que j'ai sélectionnées au préalable par un double click avec la souris.

J'ai mis en place un code qui est boiteux par moment, j'arrive à faire fonctionner mon bouton "Tout sélectionner/Désélectionner" si ce n'est que lorsque je sélectionne ou désélectionne ligne par ligne, le bouton "Tout désélectionner" ne déselectionne pas les dernières lignes de mon stringgrid le nombre correspondant aux nombres de lignes que j'ai déselectionné avant.

Voici le code :

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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
 
 
procedure TFlistfact.StringGrid1DrawCell(Sender: TObject; ACol, ARow: Integer;
  Rect: TRect; State: TGridDrawState);
 
begin
 
 
 
with stringgrid1 do
begin
if gdselected in state then
begin
 
stringgrid1.Canvas.Brush.Color:=clactivecaption;
end
else
if gdfixed in state then
stringgrid1.Canvas.Brush.Color:=clbtnface
else
begin
if (arow div 2)=(arow/2) then
stringgrid1.Canvas.Brush.Color:=clwindow
else
stringgrid1.Canvas.Brush.Color:=clyellow;
 
 
 
end;
 
stringgrid1.Canvas.TextRect(rect,rect.Left,rect.Top,stringgrid1.Cells[acol,arow]);
 
if gdfocused in state then
stringgrid1.Canvas.DrawFocusRect(rect);
end;
 
 
 
 With Sender As TStringGrid Do With Canvas Do
  Begin
 
 
    //Dessin du fond
    FillRect(Rect);
 
    //Sélection de la couleur de texte
    If gdSelected In State Then
      SetTextColor(Canvas.Handle,clwhite)
    Else SetTextColor(Canvas.Handle,clblack);
 
    //Dessin du texte en utilisant la fonction API
 
    If Arow>0 Then
Begin
  if ACol in [3..8] then
    DrawText(Canvas.Handle, PChar(Cells[ACol,ARow]), -1, Rect ,
              DT_RIGHT or DT_NOPREFIX or DT_VCENTER or DT_SINGLELINE  )
  else
    DrawText(Canvas.Handle, PChar(Cells[ACol,ARow]), -1, Rect ,
             DT_center or DT_NOPREFIX or DT_VCENTER or DT_SINGLELINE  );
End
Else
  DrawText(Canvas.Handle, PChar(Cells[ACol,ARow]),-1, Rect ,
              DT_center or DT_NOPREFIX or DT_VCENTER or DT_SINGLELINE  );
 
  End;
 
 
 
if RowsSelected.IndexOf(ARow)>-1 then
  begin
    StringGrid1.Canvas.Brush.Color:=clRed;
    stringgrid1.canvas.fillrect(rect);
    stringgrid1.canvas.TextOut(Rect.Left,Rect.Top,stringgrid1.Cells[ACol,ARow]);
  end;
 
end;
 
 
procedure TFlistfact.Button3Click(Sender: TObject); //Cest mon bouton pour sélectionner ou désélectionner ligne par ligne
Var
index:integer;
Begin
if (stringgrid1.Selection.Left>=stringgrid1.FixedCols) and (stringgrid1.Selection.Right>(stringgrid1.ColCount-1)) then
begin
if stringgrid1.Row > 0 then
begin
 
 
 
  if LastRowClicked=-1 then Exit;
  index:=RowsSelected.IndexOf(LastRowClicked);
  if index>-1
  then RowsSelected.Delete(index)
  else RowsSelected.Add(LastRowClicked);
  StringGrid1.Invalidate;
  stringgrid1.col:=1;
  try
  stringgrid1.Row:=stringgrid1.Row+1;
  except
  stringgrid1.row:=stringgrid1.row-1;
  end;
 
 
end;
end;
 
 
 
end;
 
 
procedure TFlistfact.Button5Click(Sender: TObject);
 
var
  i:integer;
 
 
begin
 
if button5.Caption='&Tout Sélectionner' then
begin
 
for i:=1 to stringgrid1.RowCount-1 do
 
begin
rowsselected.Add(i);
stringgrid1.Invalidate;
button5.Caption:='&Tout Désélectionner';
end;
end
else
 
begin
 
 
for i:=stringgrid1.RowCount-2 downto 0 do //Alors ici je ne comprends pas pourquoi cela marche que comme cela ??????
begin
 
rowsselected.Delete(i);
stringgrid1.Invalidate;
 
button5.Caption:='&Tout Sélectionner';
end;
 
 
 
 
end;
 
 
end;
Je pense que j'ai du mettre des incohérences dans mon code.

Merci encore pour ton aide.
jer64 est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 02/01/2013, 17h07   #9
Charly910
Membre chevronné
 
Avatar de Charly910
 
Homme Charly
Ingénieur TP
Inscription : décembre 2006
Messages : 582
Détails du profil
Informations personnelles :
Nom : Homme Charly
Localisation : France

Informations professionnelles :
Activité : Ingénieur TP
Secteur : Bâtiment Travaux Publics

Informations forums :
Inscription : décembre 2006
Messages : 582
Points : 664
Points : 664
Pour le tableau de Booleen ISelect, tu peux utiliser un tableau dynamique. Ains tu pourras augmenter sa taille comme tu veux
Charly910 est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 02/01/2013, 17h25   #10
Charly910
Membre chevronné
 
Avatar de Charly910
 
Homme Charly
Ingénieur TP
Inscription : décembre 2006
Messages : 582
Détails du profil
Informations personnelles :
Nom : Homme Charly
Localisation : France

Informations professionnelles :
Activité : Ingénieur TP
Secteur : Bâtiment Travaux Publics

Informations forums :
Inscription : décembre 2006
Messages : 582
Points : 664
Points : 664
Chez moi ton code ne compile pas (sous D7) car rowsselected est inconnu.

Je pense que tu devrais quand même gérer les sélections et déselections par un tableau de booléens, car cela me semble être la méthode la plus simple.
Charly910 est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 02/01/2013, 17h49   #11
jer64
Nouveau Membre du Club
 
Inscription : mai 2002
Messages : 163
Détails du profil
Informations forums :
Inscription : mai 2002
Messages : 163
Points : 31
Points : 31
Pour ce qui manque :

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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
 
 
public
    { Déclarations publiques }
    RowsSelected:TIntegerList;
    LastRowClicked:integer;
 
 
end;
 
var
  Flistfact: TFlistfact;
  Ligne:longint=-1;
 
 
implementation
 
uses shellapi,Strutils,chemin, Unit2, UnitIntro,db, UnitListeCourriers,
  Rglt;
 
{$R *.dfm}
 
procedure TFlistfact.StringGrid1MouseDown(Sender: TObject;
  Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
var
        select:tgridrect;
        c,r:longint;
 
begin
stringgrid1.MouseToCell(x,y,c,r);
 
 
 
if ssdouble in shift then with stringgrid1 do if (c=0) and (r>=fixedrows) then
begin
 
        perform(wm_killfocus,0,0);
        select.Top:=r;
        select.Bottom:=r;
        select.Left:=fixedcols;
        select.Right:=colcount;
        selection:=select;
 
 
 
end;
 
end;
 
procedure TFlistfact.StringGrid1SelectCell(Sender: TObject; ACol,
  ARow: Integer; var CanSelect: Boolean);
begin
LastRowClicked:=ARow;
end;

Je vais regarder pour le tableau dynamique. Dans mon code, j'ai besoin d'un bouton pour tout sélectionner ou désélectionner (les lignes), d'un bouton pour sélectionner ou déselectionner les lignes de mon choix (je choisis la ligne par un double click), et d'un bouton pour vider mon stringgrid en ne gardant que les lignes désélectionner.

Il faut aussi que les couleurs de mes lignes soit différente une fois sur 2 (chez moi jaunes et blanches) pour une meilleur lisibilité.

Il faut vraiment que je revois ma copie car c'est plein de bug et compliqué pour l'utilisateur final.

A plus tard.
jer64 est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 02/01/2013, 23h53   #12
jer64
Nouveau Membre du Club
 
Inscription : mai 2002
Messages : 163
Détails du profil
Informations forums :
Inscription : mai 2002
Messages : 163
Points : 31
Points : 31
Re-bonjour,

J'ai modifié mon code et cela marche à part les carractères de ma colonne 0 qui sont cachés lors de la sélection de façon complétement aléatoire.

Par contre je n'arrive plus à avoir une ligne sur deux de couleurs différente par exemple les lignes paires en blanc et les lignes impaires en jaune. Ceci pour une meilleur lisibilité de mon stringgrid.

Voici mon code actuel :


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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
 
 
var
    Iselect:array of boolean;
 
procedure TFlistfact.StringGrid1DrawCell(Sender: TObject; ACol, ARow: Integer;
  Rect: TRect; State: TGridDrawState);
 
begin
 
 
 
  With Sender As TStringGrid Do With Canvas Do
  Begin
 
   setlength(ISelect,stringgrid1.RowCount);
 
    { sélection de la couleur de fond }
    If (ACol > 0 ) Then
    If ISelect[ARow] Then
       Begin
          Brush.Color := clRED ;
          Font.Color := clwhite ;
       End
    Else
       Begin
          Brush.Color := clBtnFace ;
          Font.Color :=  ClBlack ;
       End ;
    { Dessin du fond }
    FillRect(Rect);
    { Dessin du texte }
    TextOut(Rect.Left,Rect.Top,Cells[ACol,ARow]);
  End;
 
procedure TFlistfact.Button6Click(Sender: TObject);
var
  i:integer;
 
begin
 
   setlength(ISelect,stringgrid1.RowCount);
   if (button5.Caption='&Tout Sélectionner') then
      begin
 
 
         For i := 1 To StringGrid1.RowCount-1 Do
            ISelect[i] := True ;
         StringGrid1.Invalidate ;
         Button5.Caption:='&Tout Désélectionner';
       end
   else
      begin
         For i := 1 To StringGrid1.RowCount-1 Do
            ISelect[i] := False ;
         StringGrid1.Invalidate ;
         Button5.Caption:='&Tout Sélectionner';
      end;
 
end;
Merci d'avance pour votre aide.
jer64 est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 03/01/2013, 10h06   #13
Charly910
Membre chevronné
 
Avatar de Charly910
 
Homme Charly
Ingénieur TP
Inscription : décembre 2006
Messages : 582
Détails du profil
Informations personnelles :
Nom : Homme Charly
Localisation : France

Informations professionnelles :
Activité : Ingénieur TP
Secteur : Bâtiment Travaux Publics

Informations forums :
Inscription : décembre 2006
Messages : 582
Points : 664
Points : 664
Bonjour,

avec ceci tu récupères tes couleurs de lignes paires et impaires ;

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
{ ================================================================ }
procedure TForm1.StringGrid1DrawCell(Sender: TObject; ACol, ARow: Integer;
  Rect: TRect; State: TGridDrawState);
Begin
 
  With Sender As TStringGrid Do With Canvas Do
  Begin
 
    { sélection de la couleur de fond }
    If (ACol > 0 ) Then
       If ISelect[ARow] Then
          Begin
             Brush.Color := clRED ;
             Font.Color := clwhite ;
          End
       Else
          Begin
             if not Odd(ARow) then
                Canvas.Brush.Color:=clwindow
             Else
                Canvas.Brush.Color:=clyellow;
             Font.Color :=  ClBlack ;
          End  ;
    { Dessin du fond }
    FillRect(Rect);
    { Dessin du texte }
    TextOut(Rect.Left,Rect.Top,Cells[ACol,ARow]);
   End ;
 
End;
{ ================================================================ }
A+

Charly
Charly910 est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 04/01/2013, 16h17   #14
jer64
Nouveau Membre du Club
 
Inscription : mai 2002
Messages : 163
Détails du profil
Informations forums :
Inscription : mai 2002
Messages : 163
Points : 31
Points : 31
Bonjour Charly,

Ton code marche très bien, merci beaucoup.

Par contre je n'arrive plus à changer la couleur d'une cellule que je sélectionne et je n'arrive plus à sélectionner une ligne en double cliquant sur une cellule de la colonne 0.

J'ai ajouté ce code dans OnDrawCell qui déjà me permet de me positionner sur la cellule de mon choix. Mais pour le reste....

Code :
1
2
3
4
5
 
 
if gdfocused in state then
 
    stringgrid1.Canvas.DrawFocusRect(rect);
Merci d'avance.
jer64 est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 04/01/2013, 18h30   #15
Charly910
Membre chevronné
 
Avatar de Charly910
 
Homme Charly
Ingénieur TP
Inscription : décembre 2006
Messages : 582
Détails du profil
Informations personnelles :
Nom : Homme Charly
Localisation : France

Informations professionnelles :
Activité : Ingénieur TP
Secteur : Bâtiment Travaux Publics

Informations forums :
Inscription : décembre 2006
Messages : 582
Points : 664
Points : 664
Bon alors, tu créés 2 variables Col1 et Row1 de type LongInt et tu complètes comme ceci (en affectant les fonctions StringGrid1DblClick et StringGrid1MouseDown à la grille)

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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
{ ================================================================ }
procedure TForm1.StringGrid1DrawCell(Sender: TObject; ACol, ARow: Integer;
  Rect: TRect; State: TGridDrawState);
Begin
  With Sender As TStringGrid Do With Canvas Do
  Begin

    { sélection de la couleur de fond }
    If (ACol > 0 ) Then
       If ISelect[ARow] Then
          Begin
             Brush.Color := clRED ;
             Font.Color := clwhite ;
          End
       Else
          Begin
             if not Odd(ARow) then
                Canvas.Brush.Color:=clwindow
             Else
                Canvas.Brush.Color:=clyellow;
             Font.Color :=  ClBlack ;
          End  ;
    { couleur de la cellule sélectionnée }
    If gdfocused in state then
       Begin
          Canvas.Brush.Color:=clblue;
          Font.Color :=  ClWhite ;
       End ;
    { Dessin du fond }
    FillRect(Rect);
    { Dessin du texte }
    TextOut(Rect.Left,Rect.Top,Cells[ACol,ARow]);
   End ;

end;
{ ================================================================ }
procedure TForm1.StringGrid1MouseDown(Sender: TObject;
  Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
   Stringgrid1.MouseToCell(X, Y, Col1, Row1);
end;
{ ================================================================ }
procedure TForm1.StringGrid1DblClick(Sender: TObject);
begin
   If (Row1 > 0) Then
   If (Col1 = 0) Then
      Begin
         ISelect[Row1] := Not ISelect[Row1] ;
         StringGrid1.Invalidate ;
      End ;
end;
{ ================================================================ }
Charly910 est déconnecté   Envoyer un message privé Réponse avec citation 00
Réponse
Outils de la discussion

Navigation rapide


Fuseau horaire GMT +2. Il est actuellement 22h09.


 
 
 
 
Partenaires

Hébergement Web