如何按...问题对ListView进行排序 [英] How to sort ListView by... problem

查看:91
本文介绍了如何按...问题对ListView进行排序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Public Function sort(ByVal indx As Short) As Object
        theitem = Nothing
        ListView1.Sorting = System.Windows.Forms.SortOrder.Ascending
        ListView1.SortKey = indx
        ListView1.Sort()
    End Function


错误是

错误6未声明名称"theitem".
错误7"SortKey"不是"System.Windows.Forms.ListView"的成员.


我尝试使用此
解决此错误


the error is

Error 6 Name ''theitem'' is not declared.
Error 7 ''SortKey'' is not a member of ''System.Windows.Forms.ListView''.


i tried to solve this error with this

Dim theItem As ListViewItem
If ListView1.SelectedItems.Count > 0 Then
    theItem = ListView1.SelectedItems(0)
Else
    theItem = Nothing
End If


但仍然出现错误
有人帮我

添加了代码标签-LOSMAC [/EDIT]


but its still got error
someone help me

Code tags added - LOSMAC[/EDIT]

推荐答案

http://msdn.microsoft.com/en-us/library/system.windows.forms.listview.listviewitemsorter.aspx [ ^ ]<-示例
http://msdn.microsoft.com/en-us/library/system.windows.forms.listview.sort.aspx[^]
http://msdn.microsoft.com/en-us/library/system.windows.forms.listview.listviewitemsorter.aspx[^] <- examples


这篇关于如何按...问题对ListView进行排序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆