# ComboBoxString OnSelectionChanged syntax

**URL:** <https://forums.unrealengine.com/t/comboboxstring-onselectionchanged-syntax/368329>\
**Category:** UI\
**Tags:** combobox, unreal-engine, CPP, question, UMG\
**Created:** [August 26, 2016, 10:58am UTC](https://forums.unrealengine.com/t/comboboxstring-onselectionchanged-syntax/368329 "2016-08-26T10:58:23Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![BigaCubensis](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@BigaCubensis](https://forums.unrealengine.com/u/BigaCubensis)\
**Post date:** [August 26, 2016, 10:58am UTC](https://forums.unrealengine.com/t/comboboxstring-onselectionchanged-syntax/368329/1 "2016-08-26T10:58:23Z")

</div>

Hi,

I have trouble with specifying OnSelectionChanged of ComboBoxString event in C++.  
The standard way with AddDynamic seems doesnt work.

```
pTerritorySelector->OnSelectionChanged.AddDynamic(this, &UEditorScreen::OnSelectTerritory);

Severity	Code	Description	Project	File	Line	Suppression State
Error	C2664	'void TBaseDynamicMulticastDelegate<FWeakObjectPtr,void,FString,ESelectInfo::Type>::__Internal_AddDynamic<UEditorScreen>(UserClass *,void (__cdecl UEditorScreen::* )(FString,ESelectInfo::Type),FName)': cannot convert argument 2 from 'void (__cdecl UEditorScreen::* )(void)' to 'void (__cdecl UEditorScreen::* )(FString,ESelectInfo::Type)'	Strategeist	F:\Spirits\SpiritsUEClean\Strategeist\Source\Strategeist\UI\EditorScreen.cpp	38	

```

How I should include this ESelectInfo?  
If I add that, I get another error that AddDynamic has too many parameters.  
Also, this FName should refer to method name instead of method pointer?

Unfortunately the forums still down in this moment and I didnt find any solution and documentation doesnt say anything about correct parameters here.

thanks for the help,  
Gabor

---

<div class="post-metadata">

**Author:** ![BigaCubensis](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@BigaCubensis](https://forums.unrealengine.com/u/BigaCubensis)\
**Post date:** [August 26, 2016, 2:45pm UTC](https://forums.unrealengine.com/t/comboboxstring-onselectionchanged-syntax/368329/2 "2016-08-26T14:45:48Z")

</div>

found the problem. 🙂  
the binded function should include the correct parameters.

```
void myobject::OnSelectTerritory(FString sItem, ESelectInfo::Type seltype)
{
...
}

```

then the AddDynamic works fine with “standard” syntax.

---

<div class="post-metadata">

**Author:** ![DataDisruptor](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/datadisruptor/32/551250_2.png) [@DataDisruptor](https://forums.unrealengine.com/u/DataDisruptor)\
**Post date:** [July 19, 2022, 12:13am UTC](https://forums.unrealengine.com/t/comboboxstring-onselectionchanged-syntax/368329/3 "2022-07-19T00:13:43Z")

</div>

Thank you so much dude from 2016! I was going nuts over this problem!!!
