如何将列表框从Z排序到a [英] How to sort listbox from Z to a

查看:114
本文介绍了如何将列表框从Z排序到a的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试使用此代码,但她无法工作

 lstgauche.Sorted =  false ; 



请给我答案



我尝试了什么:



i尝试使用此代码,但她无法工作

 lstgauche.Sorted =  false ; 



请给我答案

解决方案

你应该如尽可能将逻辑与表示分开,因此在将列表绑定到列表框控件之前先对代码进行排序:检查出来:列表(T)。反向方法(System.Collections.Generic) [ ^ ]

将列表框的已排序属性保持为false。 / blockquote>

检查这些类似的线程,各种分拣方法

c# - 对列表框中的项目列表进行排序 [ ^ ]

c# - 如何对列表框中的项目进行排序 [ ^ ]


i try with this code but she doesn't work

lstgauche.Sorted = false;


plese give me the answer

What I have tried:

i try with this code but she doesn't work

lstgauche.Sorted = false;


plese give me the answer

解决方案

You should as far as possible separate the logic from the presentation, so sort the list in code first before binding it to the listbox control: Check this out: List(T).Reverse Method (System.Collections.Generic)[^]
Keep the sorted property of the listbox as false.


check these similar thread,variety of methods for sorting
c# - Sorting a list of items in a list box [^]
c# - How to sort items in listbox [^]


这篇关于如何将列表框从Z排序到a的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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