如何在运行时隐藏组合框上的枚举值? [英] How to hide enum values on a combo box at runtime?

查看:270
本文介绍了如何在运行时隐藏组合框上的枚举值?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

假设组合框已链接到枚举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.

虽然它是一个参数在动态AX中作为一个参数,不可能在运行时删除枚举值,可以隐藏整个应用程序的枚举值。只需将枚举值的ConfiguratioKey更改为SysDeletedObjects40,并将其作为合法值消失。我将假设此配置键未启用!

While it is not possible do delete enum values at runtime, it is possible to hide enum values for the entire application. Just change the enum value's ConfiguratioKey to "SysDeletedObjects40", and it disappears as a legal value. I will assume that this configuration key is not enabled!

这篇关于如何在运行时隐藏组合框上的枚举值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆