# UPROPERTY(EditAnywhere) bool MyBool Binding Problem

**URL:** <https://forums.unrealengine.com/t/uproperty-editanywhere-bool-mybool-binding-problem/338569>\
**Category:** Community & Industry Discussion\
**Tags:** boolean, UProperty, bool, binding, unreal-engine, question\
**Created:** [November 15, 2015, 6:22pm UTC](https://forums.unrealengine.com/t/uproperty-editanywhere-bool-mybool-binding-problem/338569 "2015-11-15T18:22:19Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jerry.Richards](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Jerry.Richards](https://forums.unrealengine.com/u/Jerry.Richards)\
**Post date:** [November 15, 2015, 6:22pm UTC](https://forums.unrealengine.com/t/uproperty-editanywhere-bool-mybool-binding-problem/338569/1 "2015-11-15T18:22:19Z")

</div>

I cannot bind a boolean in my BP widget.

```
.h
    UPROPERTY(EditAnywhere, BlueprintReadWrite)
    bool MyBool;

```

When I bind to this variable in the BP Editor, I cannot change its value. It’s always set to true. What am I doing wrong?

I remember seeing someone else posting and answering this same question but I can’t find it.

Thank you for the help.

---

<div class="post-metadata">

**Author:** ![Jerry.Richards](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Jerry.Richards](https://forums.unrealengine.com/u/Jerry.Richards)\
**Post date:** [November 16, 2015, 5:18pm UTC](https://forums.unrealengine.com/t/uproperty-editanywhere-bool-mybool-binding-problem/338569/2 "2015-11-16T17:18:03Z")

</div>

I ended up binding to an ECheckBoxState variable and calling a function in my class when the UI value changed:

```
.h
UPROPERTY(EditAnywhere, BlueprintReadWrite)
ECheckBoxState MyCheckboxState;
bool MyBoolVar;

UFUNCTION(BlueprintCallable)
virtual void CheckBoxChanged(bool isChecked);

.cpp
void UMyWidget::CheckBoxChanged(bool isChecked)
{
    MyBoolVar = isChecked;
    if (MyBoolVar)
        MyCheckboxState = ECheckBoxState::Checked;
    else
        MyCheckboxState = ECheckBoxState::Unchecked;
}

```

1. I wouldn’t expect to have to do this in order to bind variables. I should be able to bind to a boolean, float, enum, FText, FString, int32, uint32 and documentation should clearly state how to do it.

2. I shouldn’t have to set the checkbox state in the above code but do so just to make sure that the UI and I are on the same page. If my variable is TRUE, I’m making sure that the checkbox state is also TRUE, meaning CHECKED (or as the case may be).

I could rewrite the function to a single line:

```
void UMyWidget::CheckBoxChanged(bool isChecked)
{
    MyBoolVar = isChecked;
}

```

Which is kind of silly. Why don’t I just bind to it in the first place?

I suspect that I’m doing something wrong.
