Azzera filtri
Azzera filtri

how to display whole text in dropdownlist?

1 visualizzazione (ultimi 30 giorni)
Muazma Ali
Muazma Ali il 26 Dic 2021
Risposto: Image Analyst il 26 Dic 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

Risposte (2)

Voss
Voss il 26 Dic 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 il 26 Dic 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');

Categorie

Scopri di più su Migrate GUIDE Apps in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by