B4J Question Help for B4J Code

FabioCrank

Member
Licensed User
Longtime User
Hi to everyone,

I am trying to use the B4J program,
but I can't find the solution for a
VB6 Source Code that I used...

VB6 CODE
Load combo with these data

Private Sub Form_Activate ()
Combo1.AddItem "1-Roma"
Combo1.AddItem "2-Torino"
Combo1.AddItem "3-Milano"
end Sub

It returns the index ... depending on the clicks that do ...
then 1 or 2 or 3
Private Sub Combo1_Click ()
Index = Val (Combo1.Text)
end Sub

Which is the example code in B4J?

Thank you
Fabio
 

inakigarm

Well-Known Member
Licensed User
Longtime User
The view is the combobox
  • Create a Layout that includes that view and Generate Members in Visual Designer
  • Load the layout in AppStart (MainForm.RootPane.LoadLayout(" .."))
  • Add Items to combobox with
B4X:
Cmb.Items.Add("Roma")
Cmb.Items.Add("Torino")
etc..
  • Get the index or value at Combo's Events:
    B4X:
    Sub CmbLang_ValueChanged (Value As Object)
       
    End Sub
    
    Sub Cmb_SelectedIndexChanged(Index As Int, Value As Object)
       
    End Sub
 
Last edited:
Upvote 0
Top