# (Widget) Check a checkbox -\> uncheck the others

**URL:** <https://forums.unrealengine.com/t/widget-check-a-checkbox-uncheck-the-others/495419>\
**Category:** Blueprint\
**Tags:** UE4-24, checkbox, unreal-engine, Widget, UE4, question\
**Created:** [February 7, 2022, 7:41pm UTC](https://forums.unrealengine.com/t/widget-check-a-checkbox-uncheck-the-others/495419 "2022-02-07T19:41:30Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![linkings](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@linkings](https://forums.unrealengine.com/u/linkings)\
**Post date:** [February 7, 2022, 7:41pm UTC](https://forums.unrealengine.com/t/widget-check-a-checkbox-uncheck-the-others/495419/1 "2022-02-07T19:41:30Z")

</div>

I made a neat looking level/ship selection menu. I’d like to limit the **maximum number of checkable check boxes** to **one**. For now, with every checking and unchecking, i increment/decrement a _ShipChecks_ integer. If it’s greater than 1, checking should be disallowed. But i can’t branch it in a way to prevent clicks. Other boxes should be greyed out. How would you go about this?

 ![checks2](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/a/8/7a8a356f42012739200473a592f3a8d7ab0b6cc8.jpeg)  
 ![checks1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/e/2/7e2de2b41e1ba9d8575d9a0b7246f3779712cbf5.jpeg)

![checks](https://d3kjluh73b9h9o.cloudfront.net/original/4X/b/b/1/bb1d854d7dbff68c066d6065ec39e1ba1f904e38.gif)

---

<div class="post-metadata">

**Author:** ![ClockworkOcean](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/clockworkocean/32/1169999_2.png) [@ClockworkOcean](https://forums.unrealengine.com/u/ClockworkOcean)\
**Post date:** [February 7, 2022, 7:52pm UTC](https://forums.unrealengine.com/t/widget-check-a-checkbox-uncheck-the-others/495419/2 "2022-02-07T19:52:21Z")

</div>

When someone clicks one, always grey them all out, and then select the one they clicked.

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [February 7, 2022, 7:53pm UTC](https://forums.unrealengine.com/t/widget-check-a-checkbox-uncheck-the-others/495419/3 "2022-02-07T19:53:29Z")

</div>

Brute force as suggested above could work pretty well, especially when we’re considering a handful of those only.

* * *

For something a tad more snazzy:

> [@UMG Toggle Buttons](https://forums.unrealengine.com/t/umg-toggle-buttons/227052/6):
>
> Another solution that works for any number of widgets and does not require array iteration: Wrap the native checkbox with a User Widget, dispatch its state and self reference: And in the main widget holding checkboxes: You probably don’t even need that boolean but you may find another use for it! edit: Another benefit of wrapping User Widgets is that you can now easily stylise those checkboxes so they stay uniform throughout the menus. Makes maintenance / adjustments a …
