잊지 않겠습니다.

class ListViewItemComparer : System.Collections.IComparer
{
    int _col;
    bool _basc;
    
    public ListViewItemComparer()
    {
        _col=0;
        _basc = true;
    }

    public ListViewItemComparer(int column, bool asc)
    {
        _col=column;
        _basc = asc;
    }

    public int Compare(object x, object y)
    {
        if(_basc)
        {
            return String.Compare(((System.Windows.Forms.ListViewItem) x ).SubItems[_col].Text,
                                              ((System.Windows.Forms.ListViewItem)y).SubItems[_col].Text);
        }
        else
        {
            return String.Compare(((System.Windows.Forms.ListViewItem) y ).SubItems[_col].Text,
                                              ((System.Windows.Forms.ListViewItem) x).SubItems[_col].Text);
        }
    }
}
Posted by Y2K
,