blist item value to string object

rls456

Member
Licensed User
Longtime User
Listview2_Click
dim VoiceNo as int
dim My value as string

VoiceNo = Listview2.LastClickedIndex
MyValue = Listview2.LastClicked

When I click an item in the list the VoiceNo gets a Index No
but Myvalue = ""

Thanks
 

mjcoon

Well-Known Member
Licensed User
Listview2_Click
dim VoiceNo as int
dim My value as string

VoiceNo = Listview2.LastClickedIndex
MyValue = Listview2.LastClicked

When I click an item in the list the VoiceNo gets a Index No
but Myvalue = ""

I cannot find a "LastClicked" member of bList. Also you are missing the "Sub" in front of Listview2_Click, so you have not quoted your code exactly.

I have never used bList, and the Help is not in the usual format (which would distinguish methods from properties and input and output properties.

However it seems to me that there are no properties of the bList itself that would yield a useful string and maybe you have to get the indexed bListItem if you really need to get the string value (if indeed the Text property can be "got" - the Help does not say "gets" or "sets"!).

HTH, Mike.

And, trying to assist rls456 further, I see that the description of bListItem.Value says "Gets the a reference to the underlying value of the item" whereas, as the example usage makes clear, it is more use to set the value.
 
Last edited:

rls456

Member
Licensed User
Longtime User
Sorry the code for MyValue should read
MyValue = Listview2.ClickedItem

thanks
 

mjcoon

Well-Known Member
Licensed User
Sorry the code for MyValue should read
MyValue = Listview2.ClickedItem

Yes, that was what I was referring to when I wrote
...maybe you have to get the indexed bListItem ...

The method/property ClickedItem returns an object (of type bListItem) whereas you are trying to assign this returned object to a string variable.

Assuming that you have included and New'ed such an object, then you are missing (I'm still guessing; I haven't done any of this myself!):
B4X:
BListItem1.Value = Listview2.ClickedItem
MyValue = BListItem1.Text

Mike.
 
Top