'How to get listbox index

This is an item on my listbox. After I press a button, it adds this to my listbox and I want to get the hh:mm index (10:58), but I think this only has one index. How can I do it?

This is the whole item:

Listbox item image



Solution 1:[1]

You could try and create an array with all the items that are inside the listbox, and from there, do whatever you want with it.

Solution 2:[2]

You can use DataGridView instead.

You can add columns (like your time hh:mm) and then get the current selected index time. Or you can get the selected index row string and code an algorithm to extract the hh:mm from your string.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1
Solution 2 Peter Mortensen