Borrar filtros
Borrar filtros

How do I make a growing listbox?

3 visualizaciones (últimos 30 días)
Anthony Gaetani
Anthony Gaetani el 5 de Abr. de 2020
Comentada: Ameer Hamza el 5 de Abr. de 2020
I have a pushbutton that prints a string in Value 1 of the listbox. I want to add more strings to the listbox, but i keep getting this message: Single-selection 'listbox' control requires that 'Value' be an integer within Character vector range. Basically, I want to be able to keep adding strings to my listbox, as in, adding a string as Value 2, Value 3, etc.

Respuestas (1)

Ameer Hamza
Ameer Hamza el 5 de Abr. de 2020
Are you using uilistbox? Try this
u = uilistbox('Items', {'item1', 'item2', 'item3'}); % original uilist have 3 items
% add a new item
u.Items(end+1) = {'item4'};
  2 comentarios
Anthony Gaetani
Anthony Gaetani el 5 de Abr. de 2020
I am not using uilistbox. I have a pushbutton that is supposed to send a value (ex: '2') to the listbox. Instead of adding this value to the next item, it replaces the first one.
Ameer Hamza
Ameer Hamza el 5 de Abr. de 2020
Can you show your current code or a small example of what you are trying to do.

Iniciar sesión para comentar.

Categorías

Más información sobre Migrate GUIDE Apps en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by