Page 1 of 1

Añadir elementos a listbox

PostPosted: Wed Jun 24, 2015 1:19 am
by djmarkes
Hola amigos.

¿Como puedo añadir elementos a un ListBox?

Gracias y saludos!

Re: Añadir elementos a listbox

PostPosted: Wed Jun 24, 2015 3:24 pm
by Neosoft Support
A listbox's contents are defined with its "items" property, which can be either a static list set at design time or a variable array set at run time. For example, to create a listbox that can be changed at runtime, you would put a single variable name in the items property. For example, in the sample ListExample app, the items property is set to:

[Autos]

You can then initialize the variable array with multiple items like this:

Code: Select all
CreateArray [Autos] "Ford,Toyota,Honda,Jeep,Mazda,Audi,Subaru,Chevrolet,BMW,Chrysler,Fiat,Hyundai,Kia,Lexis,Volkswagen"


A single item can be added to the listbox like this:

Code: Select all
ArrayAddItem [Autos] "Tesla"


An item can be removed like this:

Code: Select all
ArrayDelItem [Autos] 2