sort properties alphabetically in variable preview not working
4 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Hello
As I preview for example ListBox handle and I try to sort properties by name then displayed order is bizarre. Or do I do something wrong or misunderstand something?

3 commentaires
Christopher Deng
le 29 Juin 2023
Well, nearly none of the users I know want this kind of list. Why cant we have an alphabetically sorted property names?
Réponses (1)
Matt J
le 21 Avr 2023
Modifié(e) : Matt J
le 21 Avr 2023
You cannot change the order in which properties are displayed in the variable editor (other than to reverse it). If you want an alphabetized list of the properties, however, you can generate one at the command line.
>> string(sort(properties(lb)))
ans =
29×1 string array
"BackgroundColor"
"BeingDeleted"
"BusyAction"
"ContextMenu"
"CreateFcn"
"DeleteFcn"
"Enable"
"FontAngle"
"FontColor"
"FontName"
"FontSize"
"FontWeight"
"HandleVisibility"
"InnerPosition"
"Interruptible"
"Items"
"ItemsData"
"Layout"
"Multiselect"
"OuterPosition"
"Parent"
"Position"
"Tag"
"Tooltip"
"Type"
"UserData"
"Value"
"ValueChangedFcn"
"Visible"
2 commentaires
Jordan B
le 21 Avr 2023
It's a little rediculous that you have to do this. They should just make the sort button actually work properly.
Matt J
le 21 Avr 2023
Modifié(e) : Matt J
le 21 Avr 2023
It cannot work the way you might be used to from Windows Explorer because the sort button in Windows Explorer only has 2 states: forward and reverse alphabetical order. There are users, however, who sometimes want the order you currently see, the order in which the properties are defined in the ListBox class definition, which is a 3rd and 4th state altogether.
Voir également
Catégories
En savoir plus sur Shifting and Sorting Matrices dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!