如何找到组合框的最后一个索引?

如何找到组合框的最后一个索引?

问题描述:

亲爱的朋友们,



i正在开发用于编辑pdf.in的窗口应用程序,我有两个组合框.one用于显示问题名称,另一个用于文章name.how找到组合框的最后一个索引?



i想要在两个组合框达到它的最后一个索引时清除字典。



提前感谢

Dear friends,

i am developing window application for editing pdf.in that i have two combo box .one is for displaying issue name,another one is for article name.how to find the last index of the combo box?

i want to clear the dictionary when the two combobox reached it''s last index.

thanks in advance





我不确定你想要得到什么,但如果你只需要你可以做的最后一个索引:



Hi Jai,

Im not sure on what you are trying to get but if you simply need the last index you could do :

combobox.Items.Count - 1





并定位于:





and to position on that :

last = combobox.items.count - 1

combobox.selectedindex = last







我希望这有帮助,

VG




I hope this helps,
VG


comboBox有一个MaxDropDownI tems属性(也可以在设计时或运行时设置)



例如
comboBox has a MaxDropDownItems property (which can also be set at design time or runtime)

e.g.
this.comboBox1.MaxDropDownItems = 30;