[B4X] [XUI] AS TextFieldAdvanced - Title, Information, Counter, Password, Button, Prefix, Suffix, Icons, Multiline
With this view you can quickly and easily add good looking text fields, with title and or bottom text. Additionally you can make the TextField a button, so that you can open menus, but still keep the design of the text fields. The view speeds up development because you don't have to worry about...
www.b4x.com
In this example I will show you how to quickly and easily turn the TextField into a ComboBox.
1. Set the Mode to "ComboBox" in the designer
2. Add Items to it
B4X:
Dim lst_Items As List
lst_Items.Initialize
lst_Items.Add("Item #1")
lst_Items.Add("Item #2")
lst_Items.Add("Item #3")
lst_Items.Add("Item #4")
lst_Items.Add("Item #5")
AS_TextFieldAdvanced1.SetItems(lst_Items)
SelectedIndex
To select a specific item, there is the SelectedIndex property.
B4X:
AS_TextFieldAdvanced1.SelectedIndex = 2
Events
if an item has changed, the ComboBoxSelectedIndexChanged event is triggered.
B4X:
Private Sub AS_TextFieldAdvanced1_ComboBoxSelectedIndexChanged(Index As Int)
Log("Selected Item Text: " & AS_TextFieldAdvanced1.Text)
End Sub