B4J Question Choicebox Selection List

Zeppah

Member
How do I put choices into the choicebox? There don't appear to be any methods to add items or a setting in the designer for menu items. I am lost!
 

Zeppah

Member
Is the technique to put a label beside (or on top) of the box to describe the purpose? A blank button seems like a guessing game!

This is what I am trying to do:

Sub LoadStates
Private List1 As List
List1.Initialize
List1.AddAll(Array("AL","AK","AZ","AR","CA","CO","CT","DE","DC","FL","GA","HI", _
"ID","IL","IN","IA", "KS","KY","LA","ME","MD","MA","MI","MN","MS","MO","MT","NE", _
"NV","NH","NJ","NM","NY","NC","ND","OH","OK","OR","PA","RI","SC","SD","TN","TX","UT" _
,"VT","VA","WA","WV","WI","WY","PR"))
ChoiceBox1.Initialize("")
ChoiceBox1.Items.AddAll(List1)
End Sub

I just get a blank choicebox.
 
Last edited:
Upvote 0

Zeppah

Member
My Bad. Here is the code:

B4X:
' I'm trying to Load the state abreaveations into a choice box
Sub LoadStates
    Private List1 As List
    List1.Initialize
    ChoiceBox1.Initialize("Action")
    List1.AddAll(Array("AL","AK","AZ","AR","CA","CO","CT","DE","DC","FL","GA","HI", _
    "ID","IL","IN","IA", "KS","KY","LA","ME","MD","MA","MI","MN","MS","MO","MT","NE", _
    "NV","NH","NJ","NM","NY","NC","ND","OH","OK","OR","PA","RI","SC","SD","TN","TX","UT" _
    ,"VT","VA","WA","WV","WI","WY","PR"))
    ChoiceBox1.Initialize("")
    ChoiceBox1.Items.AddAll(List1)
End Sub
 
Upvote 0
Top