# How to get a widget from a button placed in a slot \[UE4.26\]

**URL:** <https://forums.unrealengine.com/t/how-to-get-a-widget-from-a-button-placed-in-a-slot-ue4-26/498215>\
**Category:** UI\
**Tags:** unreal-engine, UE4-26, UE4, Blueprint, question\
**Created:** [February 15, 2022, 8:08am UTC](https://forums.unrealengine.com/t/how-to-get-a-widget-from-a-button-placed-in-a-slot-ue4-26/498215 "2022-02-15T08:08:23Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Neutroid](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Neutroid](https://forums.unrealengine.com/u/Neutroid)\
**Post date:** [February 15, 2022, 8:08am UTC](https://forums.unrealengine.com/t/how-to-get-a-widget-from-a-button-placed-in-a-slot-ue4-26/498215/1 "2022-02-15T08:08:23Z")

</div>

![howtoreference](https://d3kjluh73b9h9o.cloudfront.net/original/4X/9/a/c/9aced7ea9c14bc2964dfab93dafdead5cfab89de.png)

---

<div class="post-metadata">

**Author:** ![MilionX](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/milionx/32/1194703_2.png) [@MilionX](https://forums.unrealengine.com/u/MilionX)\
**Post date:** [February 15, 2022, 1:30pm UTC](https://forums.unrealengine.com/t/how-to-get-a-widget-from-a-button-placed-in-a-slot-ue4-26/498215/2 "2022-02-15T13:30:37Z")

</div>

get a ref???  
when u check is variable, u can take a ref…of button.  
i don’t know what is your problem.

---

<div class="post-metadata">

**Author:** ![Neutroid](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Neutroid](https://forums.unrealengine.com/u/Neutroid)\
**Post date:** [February 15, 2022, 5:21pm UTC](https://forums.unrealengine.com/t/how-to-get-a-widget-from-a-button-placed-in-a-slot-ue4-26/498215/3 "2022-02-15T17:21:58Z")

</div>

First of all, sorry for my poor English…

Within the button object, I want to access the widget it belongs to.

ex) ‘B Button’ placed on ‘A UserWidget’

I want to reference ‘A UserWidget’ object from ‘B Button object’.

---

<div class="post-metadata">

**Author:** ![MilionX](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/milionx/32/1194703_2.png) [@MilionX](https://forums.unrealengine.com/u/MilionX)\
**Post date:** [February 15, 2022, 5:30pm UTC](https://forums.unrealengine.com/t/how-to-get-a-widget-from-a-button-placed-in-a-slot-ue4-26/498215/4 "2022-02-15T17:30:12Z")

</div>

that widget call self.  
just search self, u will get that.  
hope i understand correctly.  
But, if the button is a custom widget.  
u can try to get parent inside button widget.

---

<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 15, 2022, 5:37pm UTC](https://forums.unrealengine.com/t/how-to-get-a-widget-from-a-button-placed-in-a-slot-ue4-26/498215/5 "2022-02-15T17:37:32Z")

</div>

> u can try to get parent inside button widget.

It would return the _immediate_ parent container, _not_ the parent user widget. Will not work the way you think in 99% cases.

> [@Neutroid](#):
>
> I want to reference ‘A UserWidget’ object from ‘B Button object’.

- widget A has widget B inside
- B wants to talk to A

Do you want B to _just talk_ to A or do you _really_ need B to have a hard reference to A? Asking, as communication can be done in many ways. Both can be done.
