领悟旧事
Learned Helplessness
// Compare the items' length.
if ( lb->Items->Strings[ counter ].Length() < lb->Items->Strings[ counter - 1 ].Length() )
{
// Swap the items.
AnsiString temp = lb->Items->Strings[ counter ];
lb->Items->Strings[ counter ] = lb->Items->Strings[ counter - 1 ];
lb->Items->Strings[ counter - 1 ] = temp;
swapped = true;
}
// Decrement the counter.
counter -= 1;
}
}
while ( (swapped == true) );
}
}
//---------------------------------------------------------------------------
//调用未例
void __fastcall TForm1::FileListBox1Change(TObject *Sender)
{
ListBoxSort(FileListBox1);
}
//---------------------------------------------------------------------------