Get value from ComboBox?

12.3k views Asked by At

I have in MyForm a ComboBox (myComboBox ) with EnumType myEnumType .

In the modified method , I want to get the value.

I used the code looklike:

if (myComboBox.enumTypeValue() == myEnumType::Value1 )
{
//action
}

Or anothe way

if (myComboBox.enumType(myEnumType::Value1) )
{
//action
}

In both cases I can not take the value.

What is the way? Thanks, all!

Enjoy!

2

There are 2 answers

0
Brodie On BEST ANSWER

To get the value of the ComboBox use the selection method,

if(myComboBox.selection() == myEnumType::Value1) {
   //action
}
0
Mouna Hmimed On

I used the code looklike:

public boolean modified()
{
   boolean ret;
   if(btMailTxt.valueStr()== 'FR')
   {
      btMailSubject.text('ooox');
      btMailBody.text('Bonjouro');
   }
   if(btMailTxt.valueStr()== 'NL')
   {
       btMailSubject.text('assigntest');
       btMailBody.text('Bonjour');
   }

   ret = super();
   return ret;
}