问题描述
假设组合框已链接到枚举ABC。其中的元素是A,B C和D.
Suppose the combobox is linked to enum "ABC". The elements in it are A, B C and D.
现在我需要在组合框中只获取A和C,而不是B和D?
Now I need to get only A and C in the combobox and not B and D?
这是否可能?
推荐答案
枚举值或组合框值。
您可以复制枚举,然后删除元素或更改顺序(而不是枚举值)。
You can duplicate the enum, then delete elements or change the order (but not the enum value). It will be your responsability to maintain both enum types synchronized with future changes.
要将枚举指定给另一个不兼容的枚举,只需向其中添加零即可!
To assign an enum to another incompatible enum, just add zero to it!
abc = myAbc + 0;
或者你可以使用编程更新你的组合框(使用组合框而不指定枚举类型):
Or you can update your combobox using programming (using a combobox without specifying an enum type):
YourComboBox.add("A");
YourComboBox.add("C");
See also Enum as a Parameter in Dynamics AX about adding new values to a combobox.
这篇关于如何在运行时隐藏组合框上的枚举值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!