How to trigger a combobox "Execute action" event

I would like to know exactly what action or macro code would trigger an “Execute action” event in a combobox in a Calc dialog object. I know selecting a different value from the value list in a listbox will trigger this event, but what would trigger this event in a combobox?

Hello,

Events in a combo box are nearly identical to that of a list box.

Description of events can be found here → Events.

It may help if you were to state what you are looking to accomplish.

Edit 2018-06-04:

To accomplish your request, the macro should be attached to the Key pressed event. This will call the macro for each keystroke:

Sub KeyHandler_KeyPressed(oEvent)
    If oEvent.Source.SelectedText = oEvent.Source.Text Then
        Print "Selection is from list"
    	Exit sub
    End If
    If oEvent.KeyCode = com.sun.star.awt.Key.RETURN OR oEvent.KeyCode = com.sun.star.awt.Key.TAB Then
        EnterPressed(oEvent)
    End If
End Sub

Sub EnterPressed(oEvent)
    iItems = oEvent.Source.ItemCount
    sText = oEvent.Source.Text
    For x = 0 to iItems -1
       If oEvent.Source.getItem(x) = sText Then
          Print "Entered item IS in list."
          Exit sub
       End if
    Next
    Print "Entered item is NOT in list!"
End Sub

First checked is SelectedText vs Text & if equal the an item was selected from list. If not equal check if RETURN key was pressed. If not, allow further entry to proceed. Once the enter key is pressed the entry may be one in the list but entered manually ( in other words not selected ). The entered text must then be checked against the list to see if there was a match. This second check is necessary because there was nothing actually selected (entry completely typed in) but still may be in the list already (short entry ie: red)

To answer you other question, the “Item Status Changed” event is triggered when a different item is selected from the list - triggered without ENTER key being used.

If this answers your question please tick the :heavy_check_mark: (upper left area of answer). It helps others to know there was an accepted answer.
the “Item Status Changed” event

Thanks for the info.

What I want to do is:

If I choose an entry from the value list, execute a block of code, but if I type a string into the combobox that does not match an entry in the value list, execute a different block of code. The “Text modified” event would work but it would cycle the code for every character change.

As as side-note: I have not been able to find info re. the “Item Status Changed” event. What is defined as the “status”?

Any info would be appreciated.

Because of space will add edit in answer.

Thank you. This is the info I needed.

You are quite welcome. Keep in mind that you will probably get more appropriate answers if you describe what you are trying to do rather than to ask how something works.