09-07-2013, 03:05 PM
09-07-2013, 07:30 PM
استعملت في هذا الكود StringGrid1
كود :
Var petit, i, j : Integer;
Str: String;
Begin
For i := 1 to StringGrid1.RowCount -1 Do
Begin
petit := i;
For j := i to StringGrid1.RowCount -1 Do
Begin
If StringGrid1.Cells[1,j] > StringGrid1.Cells[1,petit]
then petit := j;
End;
Str := StringGrid1.Cells[1,i]; //
StringGrid1.Cells[1,i] := StringGrid1.Cells[1,petit];
StringGrid1.Cells[1,petit] := Str;
End;
End;