如何计算列表框项目? [英] how to count listbox items ?

查看:118
本文介绍了如何计算列表框项目?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的问题是??? -如何计算从索引10到20的列表框"项...像这样=> 10 11 12 13 14 15 16 17 18 19 20

但不喜欢这个0 1 2 3 4 ...... 20

-M使用此代码但未实现....

对于索引为整数= CInt(listbox1.items.count-10)到20下一个

同样,这是一个相同的节目..

对于作为整数的索引= 10到Listbox1.items.count 20 next

索引始终从0到20而不是10到20 ....

我被困在这里,一个人能告诉我在上面给定的代码中我在做什么错....

需要帮助... thnxxs

My Question is ??? - How to count "listbox" items from index 10 to 20 ... like this => 10 11 12 13 14 15 16 17 18 19 20

but not like this one 0 1 2 3 4 ......20

- M Using this code but not achieved ....

For Index As integer = CInt(listbox1.items.count - 10) To 20 next

As Well this one but same prome ..

For Index As integer = 10 To Listbox1.items.count 20 next

index is always running from 0 to 20 but not from 10 to 20 ....

i m stuck over here, can one one plzz tell me what m doing wrong within above given code ....

need help ... thnxxs

推荐答案

如果您需要10到20之间的商品,请使用此类数字,例如
If you need items from 10 to 20 then use such numbers, e.g.
For i as Integer = 10 to 20


另一方面,如果您需要最后11项,请输入:


On the other hand, if you need last 11 items, then write:

Dim last as Integer = listbox1.Items.Count-1
For i as Integer = (last-10) to last 



当然,您必须检查边缘情况.



Of course you have to check for edge cases.


这篇关于如何计算列表框项目?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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