|
nbsp; End If
Return returnVal
End Function
//C#
public int Compare(object x, object y)
{
int returnVal;
// Determine whether the type being compared is a date type.
try
{
// Parse the two objects passed as a parameter as a DateTime.
System.DateTime firstDate =
DateTime.Parse(((ListViewItem)x).SubItems[col].Text);
System.DateTime secondDate =
DateTime.Parse(((ListViewItem)y).SubItems[col].Text);
// Compare the two dates.
returnVal = DateTime.Compare(firstDate, secondDate);
}
// If neither compared object has a valid date format, compare
// as a string.
catch
{
// Compare the two items as a string.
returnVal = String.Compare(((ListViewItem)x).SubItems[col].Text,
((ListViewItem)y).SubItems[col].Text);
}
// Determine whether the sort order is descending.
if (order == SortOrder.Descending)
// Invert the value returned by String.Compare.
returnVal *= -1;
return returnVal;
}
上一页 [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] 下一页 [系统软件]windows下Apache+php+mysql的安装与配置图解 [Web开发]VB的窗体布局窗口为什么找不到窗体的Form1小图标 [电脑技术]UNformAT恢复格式化命令介绍 [操作系统]在Windows中玩转Linux操作系统 [操作系统]死马还当活马医:6种方法挽救Windows系统 [聊天工具]四大更新 Windows Live Msn 8.1评测 [聊天工具]Windows Live Messenger最新0683版亮相_联络工具_… [聊天工具]Windows Live Mail招人爱的N个理由_联络工具_Wind… [聊天工具]Windows Live Mail Desktop多图欣赏_联络工具_Win… [聊天工具]OE老了 微软开发新邮件客户端取而代之_联络工具
|