在列表框中添加多个选定的索引

在列表框中添加多个选定的索引

问题描述:

我有一个列表框(选择模式),其中包含n个数据.我将选择的索引(0,1,2,3 ...)转换为(1,2,4,8 ...)分别使用pow()方法并再次使用log2()方法进行解码..

现在,如果我在列表框中选择2个数据说(1,2),那么我应该能够转换为(2 + 4 = 6).请帮助我如何在选择多个数据时进行转换?

Hi,I have listbox(selection mode) that contains n number of data.I`m converting selected index (0,1,2,3...) into (1,2,4,8...) respectively using pow()method and again decoding using log2()method..

Now if i select 2 data in listbox say(1,2) then i should able convert into(2+4=6).Please help me how to convert when multiple data selected??

您可以通过访问 ^ ]属性.
You can retrieve the index values from the ListBox by accessing the SelectedIndices[^] property.