App Designer Drop Down "instructional" default value

28 vues (au cours des 30 derniers jours)
Matt le 19 Avr 2020
Is there a way to have the drop down component default to some instructional/non-functional value that forces users to select an option? I want something that tells the user to select something but while it is in that "instructional" state, the menu stays in some non-functional state, for lack of a better term. I'm thinking something like making the first option be "Select a month" with the subsequent options being the 12 months. Does MATLAB have a built-in method of handling this or would you have to monitor everything yourself by putting an if/else statement somewhere to check the value to ensure when you go to perform an operation that it is not still "Select a month?" Do you have to modify the "Items," "ItemsData," and/or "Value" arguments in a certain way?

Réponses (1)

Ganesh Regoti
Ganesh Regoti le 29 Avr 2020
I assume that you are expecting a built-in feature for instructional default value. But as per my knowledge, there is no such feature available as of now. But you can customize it in different ways
Method 1 : During valudation you can check the value of the dropdown element, and if the value is default value then you can throw an error stating "select other values".
Method 2 : You can use ItemData argument to specify the indices of items in the list. During validation, you can check if the selected element index is default then throw an error.
Here is the link which you can refer to
Hope this helps!


En savoir plus sur Simulink Environment Customization 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!

Translated by