List box, select item
List box, select item
(OP)
I have been very confused with identifying a selected item from a list box generated from blockstyler.. I have sort of idea (see follwong code) Does anybody know how to do this? Isn't it simple to code?
Dim lw As ListingWindow = theSession.ListingWindow
Dim list_box0Props As PropertyList = list_box0.GetProperties()
Dim list_box0Values() As String = {"Item 1", "Item 2", "Item 3"}
list_box0Props.SetStrings("ListItems", list_box0Values)
Dim selected As String() = list_box0Props.SelectedItems
If selected(0) Then
lw = theSession.ListingWindow
lw.Open()
lw.WriteLine("Item 1")
End If





RE: List box, select item
list_box0Props.GetProperties.SetStrings("ListItems", list_box0Values)
Yes, I remember struggling with this part and going nowhere. What I eventually did was this:
Dim myVector() As Integer
myVector = list_box0.GetProperties.GetIntegerVector("SelectedItems")
I hope this helps.
I don't know how to get your item from the list by this vector because I never did that - for my own reasons I simultaneously populated the list and some array of my own, and read my items by that vector from the array.
RE: List box, select item
RE: List box, select item
in this line of code:
myVector = list_box0.GetProperties.GetIntegerVector("SelectedItems")
Where can I find in the API the property name, in this case "SelectedItems"?
Thank you