# Delegate with extra parameters?

**URL:** <https://forums.unrealengine.com/t/delegate-with-extra-parameters/2317503>\
**Category:** C++\
**Tags:** unreal-engine, delegates, CPP, question\
**Created:** [February 4, 2025, 3:33pm UTC](https://forums.unrealengine.com/t/delegate-with-extra-parameters/2317503 "2025-02-04T15:33:39Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![MM\_Fraip](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@MM\_Fraip](https://forums.unrealengine.com/u/MM_Fraip)\
**Post date:** [February 4, 2025, 3:33pm UTC](https://forums.unrealengine.com/t/delegate-with-extra-parameters/2317503/1 "2025-02-04T15:33:40Z")

</div>

Hi!

I recently started using delegates and I find myself in a bit of a situation.

I have a checkbox and Basically I want to uncheck all other checkboxes when one is checked (Only one can be checked at a time)

My thought was to use OnCheckStateChanged.AddDynamic(), however, it seems that I can’t bind any extra parameters like a reference to the checkbox itself?

In my function I planned to loop through the checkboxes and if it’s not the one just clicked (passed via the delegate, bound) then uncheck it.

It seems like you can’t bind any more variables and also can’t use lambda to capture the variable, so I’m very confused as to how I am even supposed to do this?

---

<div class="post-metadata">

**Author:** ![KaidoomDev](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/kaidoomdev/32/977996_2.png) [@KaidoomDev](https://forums.unrealengine.com/u/KaidoomDev)\
**Post date:** [February 4, 2025, 5:29pm UTC](https://forums.unrealengine.com/t/delegate-with-extra-parameters/2317503/2 "2025-02-04T17:29:19Z")

</div>

You can use a two param delegate and pass the reference and keep track of which one is selected and uncheck the old one. You will need to add your own delegate.

Another solution is to have the array of all checkboxes saved and bind their event and figure out which one should be the current selected, here’s a rough example:

In header I have these variables

![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/5/8/f/58fdf6eae3ae19f278512c9ca73e10da20568acc.png)

You will then need to fill that array with your checkboxes and then bind their event

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/5/7/d572181c04f977b55f7f7b019e84f53a4a93d566.png)

Finally the HandleCheckBoxState function you can do a few checks to figure out which checkbox should be the selected one

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/6/7/267d9dc4801bfd43570baaffde4049a0467bdcba.png)

No tested it but if you have any question let me know.

---

<div class="post-metadata">

**Author:** ![Fraipp](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Fraipp](https://forums.unrealengine.com/u/Fraipp)\
**Post date:** [February 4, 2025, 11:17pm UTC](https://forums.unrealengine.com/t/delegate-with-extra-parameters/2317503/3 "2025-02-04T23:17:00Z")

</div>

Thanks for your response.

1. how would i use a two param delegate for the oncheckstatuschanged event?

2. your explanation was my idea, however, as i unferstand it when you vheck a second box, and one is already checked, you will have two checked boxes and one needs unchecking, so youd need to know which one is which for what you need a reference. Are you sayinf if i keep the ref at the start then that solves it?

This seems a bit convoluted, could you explain more of the other way?

As i understand it the delegate that gets triggered when check status changes is the one that alreasy is built in, can i fire my own delegate on that event?
