# Get parent reference when pressing a button in a Widget Blueprint

**URL:** <https://forums.unrealengine.com/t/get-parent-reference-when-pressing-a-button-in-a-widget-blueprint/418219>\
**Category:** UI\
**Tags:** unreal-engine, onclicked, Widget, UE4, Blueprint, question\
**Created:** [February 24, 2018, 9:53am UTC](https://forums.unrealengine.com/t/get-parent-reference-when-pressing-a-button-in-a-widget-blueprint/418219 "2018-02-24T09:53:19Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pacman2000](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Pacman2000](https://forums.unrealengine.com/u/Pacman2000)\
**Post date:** [February 24, 2018, 9:53am UTC](https://forums.unrealengine.com/t/get-parent-reference-when-pressing-a-button-in-a-widget-blueprint/418219/1 "2018-02-24T09:53:19Z")

</div>

Hello,  
I let out the information of an array, create several horizontal boxes and fill them with texts and buttons.

Well, for example, I would like that when pressing the delete button the horizontal box is deleted. I already connected the OnClickEvent to the buttons, but my problem is that I can not hand over the references. Maybe someone has a tip for me.

 ![231829-pic1.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/1/f/e/1fe93419d1c16c77d30f667570c082b65a8a7d1d.jpeg)

![231830-pic3.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/3/6/1/3615e6c8b245ed67646ef138974d36f405de117e.jpeg)

 ![231841-pic2.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/c/e/b/ceb478996887b5685b990bafa0cbb60ac65d1ee5.jpeg)

---

<div class="post-metadata">

**Author:** ![CharlyB.Goode](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@CharlyB.Goode](https://forums.unrealengine.com/u/CharlyB.Goode)\
**Post date:** [February 24, 2018, 2:22pm UTC](https://forums.unrealengine.com/t/get-parent-reference-when-pressing-a-button-in-a-widget-blueprint/418219/2 "2018-02-24T14:22:14Z")

</div>

I would create a custom widget instead of an horizontal box and populate them in a scrollbox, then each custom widget will reference to self so just use a remove from parent

Or if you want to keep it like this use a set visibility, collapsed but it won’t clear your values itself, but I don’t know how you populate thoses.

---

<div class="post-metadata">

**Author:** ![Pacman2000](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Pacman2000](https://forums.unrealengine.com/u/Pacman2000)\
**Post date:** [February 26, 2018, 4:35pm UTC](https://forums.unrealengine.com/t/get-parent-reference-when-pressing-a-button-in-a-widget-blueprint/418219/3 "2018-02-26T16:35:53Z")

</div>

great thanks,  
sometimes you just do not get into the simplest things. thats how it works.  
Thanks
