How I do I have a list box that can get the position of the selected item. So if I have an item selected it would print 1 or what ever. I am told you do this in basic like this:
items = Student.SelectedItems
Print items(0)
but it gives this instead
How I do I have a list box that can get the position of the selected item. So if I have an item selected it would print 1 or what ever. I am told you do this in basic like this:
items = Student.SelectedItems
Print items(0)
but it gives this instead
For example:
doc = ThisComponent
form = doc.DrawPage.Forms.getByName("MainForm")
list = form.getByName("lst_students")
Msgbox list.SelectedValue
But, if you call code from other control in the same form, you can access form with:
Sub cmd_selected_studen(event)
form = event.Source.Model.Parent
list = form.getByName("lst_students")
Msgbox list.SelectedValue
End Sub
Get selected position:
form = event.Source.Model.Parent
list = form.getByName("lst_students")
list_view = ThisComponent.CurrentController.getControl(list)
Msgbox list_view.SelectedItemPos
But I would like to know the position of the name in the list of 5 others. Is it #1, #2, #3, #4, or #5?
add example.