Borrar filtros
Borrar filtros

how to display whole text in dropdownlist?

1 visualización (últimos 30 días)
Muazma Ali
Muazma Ali el 26 de Dic. de 2021
Respondida: Image Analyst el 26 de Dic. de 2021
Hi
I have this code;
S={'NH4Cl'; 'MgCl2'; 'CaCl2'; 'KCl'; 'ZnSO4'; 'NaCl'; 'ZnBr2'; 'CH3CO2K';'HCOOK';'HCOONa'; 'CaBr2'};
str={'Choose salts available, minimum two and maximum three'};
result=listdlg('Promptstring',str, 'ListSize', [100,100], 'ListString', S, 'SelectionMode', 'multiple');
% I dont understand why the str is not showing the whole text on the screen

Respuestas (2)

Voss
Voss el 26 de Dic. de 2021
It is because you specify a 100 pixel by 100 pixel listbox, and str is too long to fit in that amount of space. You can either specify a larger listbox or use a cell array of character vectors or both, e.g.:
S={'NH4Cl'; 'MgCl2'; 'CaCl2'; 'KCl'; 'ZnSO4'; 'NaCl'; 'ZnBr2'; 'CH3CO2K';'HCOOK';'HCOONa'; 'CaBr2'};
str={'Choose salts available,' 'minimum two and' 'maximum three'};
result=listdlg('Promptstring',str, 'ListSize', [150,100], 'ListString', S, 'SelectionMode', 'multiple');

Image Analyst
Image Analyst el 26 de Dic. de 2021
Try increasing the size of the list window:
S={'NH4Cl'; 'MgCl2'; 'CaCl2'; 'KCl'; 'ZnSO4'; 'NaCl'; 'ZnBr2'; 'CH3CO2K';'HCOOK';'HCOONa'; 'CaBr2'};
str={'Choose salts available, minimum two and maximum three'};
result=listdlg('Promptstring',str, 'ListSize', [300,200], 'ListString', S, 'SelectionMode', 'multiple');

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