是否可以将列表框中的所选项目与所有项目分开? [英] Any possible way of dividing selected items in a listbox with all items?
本文介绍了是否可以将列表框中的所选项目与所有项目分开?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
解决方案
你有什么问题?
想象出ListBox中有多少项似乎非常容易。找到所选项目的数量也很容易。现在,你有没有问题让代码将2除以10?尝试将获得这些计数的整数转换为单
,double
甚至小数
,在您尝试划分它们之前,取决于您的要求。另外,请确保您将结果分配给的变量属于同一类型。
Hey everyone! I got a question about a listbox.. Is it possible to divide selected items in the listbox with all of the items in the listbox? Let's say I have 10 items and 2 of them are selected, can I in some way divide 2/10? if so, how can I do this?
解决方案
What part of this are you having a problem with?
It seems incredibly easy to figure out how many items are in the ListBox. It's also very easy to find the number of items Selected. Now, are you having problems getting code to divide 2 by 10? Try converting the integers you got from getting those counts tosingle
,double
or evendecimals
, depending on your requirements, before you try to divide them. Also, make sure the variable you're assigning the result to is of the same type.
这篇关于是否可以将列表框中的所选项目与所有项目分开?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文