从 ComboBox 中获取价值?

uli*_*ses 2 enums combobox x++ axapta dynamics-ax-2012

我在MyForm 中有一个ComboBox ( myComboBox ) 和 EnumType myEnumType

modified方法中,我想获取值。

我使用的代码如下:

if (myComboBox.enumTypeValue() == myEnumType::Value1 )
{
//action
}
Run Code Online (Sandbox Code Playgroud)

或者另一种方式

if (myComboBox.enumType(myEnumType::Value1) )
{
//action
}
Run Code Online (Sandbox Code Playgroud)

在这两种情况下,我都无法取值。

方法是什么?谢谢大家!

享受!

Bro*_*die 5

要获取 ComboBox 的值,请使用该selection方法,

if(myComboBox.selection() == myEnumType::Value1) {
   //action
}
Run Code Online (Sandbox Code Playgroud)