Help with listwiev

volvomann

Active Member
Licensed User
Longtime User
Hey. I make an app where I have 3 pages they are managed by scrolling, one side I would have button and when I press the button I want a list to cam up and there I want to choose man or woman. I can`t get that to work. Can anyone help me a little on the way? Maybe a litle code?
 

volvomann

Active Member
Licensed User
Longtime User
The trouble is so simpel how can i get to line one with female and one with male and elect one off them when i hae calle the list? I have trule been blind for sothing simpel :sign0085:
 
Upvote 0

specci48

Well-Known Member
Licensed User
Longtime User
Are you looking for something like this?
B4X:
Sub Button1_Click
   Dim myList As List
   myList.Add("Male")
   myList.Add("Female")
   Dim result As Int
   result = InputList(myList, "Choose", Null)
   Msgbox(myList.Get(result), "Result")
End Sub
If you don't like those radiobuttons, you can use this library for the same feature without them.


specci48
 
Upvote 0

volvomann

Active Member
Licensed User
Longtime User
Are you looking for something like this?
B4X:
Sub Button1_Click
   Dim myList As List
   myList.Add("Male")
   myList.Add("Female")
   Dim result As Int
   result = InputList(myList, "Choose", Null)
   Msgbox(myList.Get(result), "Result")
End Sub
If you don't like those radiobuttons, you can use this library for the same feature without them.


specci48
Today is the day there nothing works if i do like thie ther no list show upp
 
Upvote 0

specci48

Well-Known Member
Licensed User
Longtime User
Sorry volvomann,

I was a little confused typing that quick sample ... shame on me ... :BangHead:

It should be:
B4X:
Sub Button1_Click
   Dim myList As List
   myList.Initialize
   myList.Add("Male")
   myList.Add("Female")
   Dim result As Int
   result = InputList(myList, "Choose", -1)
   Msgbox(myList.Get(result), "Result")
End Sub


Sorry again
specci48
 
Upvote 0

derez

Expert
Licensed User
Longtime User
Try this:
B4X:
Sub Globals
Dim button1 As Button
End Sub

Sub Activity_Create(FirstTime As Boolean)
button1.Initialize("button1")
Activity.AddView(button1, 100,100,70,70)
End Sub

Sub Activity_Resume

End Sub

Sub Activity_Pause (UserClosed As Boolean)

End Sub

Sub Button1_Click
    Dim myList As List
    myList.Initialize
    myList.Add("Male")
    myList.Add("Female")
    Dim result As Int
    result = InputList(myList, "Choose", 0)
    Msgbox(myList.Get(result), "Result")
End Sub
 
Upvote 0

volvomann

Active Member
Licensed User
Longtime User
Tank you all it works now. I figurd out the code like that Specci48 have so now i can take a realy good break :icon_clap: Thanks again.
 
Upvote 0
Top