Add Strings to Various Components using .Items
By Muhammad Azizul Hakim May 12, 2021
In previous examples, we already use .Items several times (see Для просмотра ссылки Войдиили Зарегистрируйся). We use it in ListBox, ComboBox, and RadioGroup. Items contain the strings that appear in the ListBox, ComboBox, and RadioGroup.
Use Items to add, insert, delete and move items. By default, the items in a list box are of type Strings. Use this item type to access its methods or properties to manipulate the items in the list.
Here is the working example of the implementation of .Items in the list box:
The result:
Here is the working example of the implementation of .Items in combo box:
The result:
Here is the working example of the implementation of .Items in radio group:
The result:
Для просмотра ссылки Войдиили Зарегистрируйся
By Muhammad Azizul Hakim May 12, 2021
In previous examples, we already use .Items several times (see Для просмотра ссылки Войди
Use Items to add, insert, delete and move items. By default, the items in a list box are of type Strings. Use this item type to access its methods or properties to manipulate the items in the list.
Here is the working example of the implementation of .Items in the list box:
Python:
# Items in list box
lboxCountry = ListBox(pgOne)
lboxCountry.SetProps(Parent=pgOne)
lboxCountry.SetBounds(145,88,121,60)
lboxCountry.Items.Add('RUSSIA')
lboxCountry.Items.Add('USA')
lboxCountry.Items.Add('INDIA')
lboxCountry.Items.Add('AUSTRALIA')
Here is the working example of the implementation of .Items in combo box:
Python:
# Combo box
cbxCity = ComboBox(pgOne)
cbxCity.SetProps(Parent=pgOne,Name='ComboBox')
cbxCity.SetBounds(145,206,121,60)
cbxCity.Items.Add('New York')
cbxCity.Items.Add('Sydney')
cbxCity.Items.Add('Banglore')
cbxCity.Items.Add('Tokyo')
Here is the working example of the implementation of .Items in radio group:
Python:
# Radio group Creation
rbgRadioBox = RadioGroup(pgOne)
rbgRadioBox.SetProps(Parent=pgOne,Caption='Gender')
rbgRadioBox.SetBounds(20,250,242,90)
rbgRadioBox.Items.Add('Male')
rbgRadioBox.Items.Add('Female')
Для просмотра ссылки Войди