I have a ScrollView with several B4XComboBox objects on it. I'd like to loop through them and get the selected text. I'm trying:
Both cmb.SelectedItem and cmb.cmbBox.SelectedItem cause errors. I'm think that the first two lines of the code (obj and cmb) are incorrect somehow. Any ideas?
fyi - here's how the comboboxes are initially created:
B4X:
Dim obj As Object = ScrollView1.Panel.GetView((i*5)+4)
Dim cmb As B4XComboBox = obj
Dim X,Y As String
X = cmb.SelectedItem
Y = cmb.cmbBox.SelectedItem
Both cmb.SelectedItem and cmb.cmbBox.SelectedItem cause errors. I'm think that the first two lines of the code (obj and cmb) are incorrect somehow. Any ideas?
fyi - here's how the comboboxes are initially created:
B4X:
Dim cmb As B4XComboBox
cmb.Initialize("cmb", Null)
cmb.Tag = "cmb_" & i
cmb.cmbBox.Initialize("cmbBox")
cmb.cmbBox.Tag = "cmbBox_" & i
cmb.cmbBox.TextSize = 12
cmb.cmbBox.Add("None")
cmb.cmbBox.Add("Test")
cmb.SelectedIndex = 0
ScrollView1.Panel.AddView(cmb.cmbBox, 65%x, ItemHeight * i, ScrollView1.Width, ItemHeight - 1dip)
Last edited: