# UMG: UButton-\>SetIsEnabled(false); disables all of UMG

**URL:** <https://forums.unrealengine.com/t/umg-ubutton-setisenabled-false-disables-all-of-umg/387329>\
**Category:** UI\
**Tags:** button, freeze, unreal-engine, question, UMG\
**Created:** [March 8, 2017, 4:58pm UTC](https://forums.unrealengine.com/t/umg-ubutton-setisenabled-false-disables-all-of-umg/387329 "2017-03-08T16:58:25Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Juice-Tin](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/juice-tin/32/1008648_2.png) [@Juice-Tin](https://forums.unrealengine.com/u/Juice-Tin)\
**Post date:** [March 8, 2017, 4:58pm UTC](https://forums.unrealengine.com/t/umg-ubutton-setisenabled-false-disables-all-of-umg/387329/1 "2017-03-08T16:58:25Z")

</div>

Hello,

Disabling a single button in C++ disables all UMG button functionality. When this happens, all buttons will become disabled at once, and the mouse can’t even click the minimize/maximize/close in the PIE window.

Note: Not sure if it matters, but I’ve got my button in a UUserWidget which is inside a UHorizontalBox (MenuBar), and it’s being called like so:

```
MenuBar->GetChildAt(0))->Button->SetIsEnabled(false);

```

Everything else works perfectly, but attempting to disable any button will disable everything.  
I assume these problems would also happen on regular buttons on the canvas without the wrapper.

Is there any workaround for this?

Thanks

Edit:  
I used it on the construction of a button and it seems to work there, so it may only break UMG when used after clicking the button through OnPressed

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_2b03d27c](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_2b03d27c](https://forums.unrealengine.com/u/anonymous_user_2b03d27c)\
**Post date:** [March 9, 2017, 3:36pm UTC](https://forums.unrealengine.com/t/umg-ubutton-setisenabled-false-disables-all-of-umg/387329/2 "2017-03-09T15:36:05Z")

</div>

Hey -

How exactly are you setting up your UMG in code? When tested in blueprint, disabling one button did not affect other buttons (the disabled button grayed out but other buttons did not and could still be clicked). If possible, please provide your setup or a small sample project showing the issue to help investigate locally.

---

<div class="post-metadata">

**Author:** ![Juice-Tin](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/juice-tin/32/1008648_2.png) [@Juice-Tin](https://forums.unrealengine.com/u/Juice-Tin)\
**Post date:** [March 9, 2017, 8:44pm UTC](https://forums.unrealengine.com/t/umg-ubutton-setisenabled-false-disables-all-of-umg/387329/3 "2017-03-09T20:44:10Z")

</div>

Hi ,  
My slow computer takes waaay too long to make a new project, considering VS then needs to parse the engine code, etc. So since the code is simple, I will just provide that for now.

1. Create a class that extends UserWidget, this will house the button and handle it’s click code.

2. Grab the button object from the widget blueprint, and set it to disable itself when pressed.

3. Create a blueprint child of that class, and add a button with the name BP\_Button, so it can be accessed from the construction function.

4. Place a bunch of those buttons and click one of them. Rather than it disabling itself, all of UMG should freeze up, including the PIE window controls.

Edit: Sorry the post seems to be autoformatting, messing up my step numbers and forcing some of my code into regular text.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_2b03d27c](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_2b03d27c](https://forums.unrealengine.com/u/anonymous_user_2b03d27c)\
**Post date:** [March 10, 2017, 6:34pm UTC](https://forums.unrealengine.com/t/umg-ubutton-setisenabled-false-disables-all-of-umg/387329/4 "2017-03-10T18:34:24Z")

</div>

Thank you for the code. I have reproduced this issue and logged a report for it here [Unreal Engine Issues and Bug Tracker (UE-42777)](https://issues.unrealengine.com/issue/UE-42777) . You can track the report’s status as the issue is reviewed by our development staff. Please be aware that this issue may not be prioritized or fixed soon.

Cheers
