# How to set widget added at runtime to fill container?

**URL:** <https://forums.unrealengine.com/t/how-to-set-widget-added-at-runtime-to-fill-container/2709227>\
**Category:** Blueprint\
**Tags:** unreal-engine, Blueprint, question\
**Created:** [March 26, 2026, 10:17pm UTC](https://forums.unrealengine.com/t/how-to-set-widget-added-at-runtime-to-fill-container/2709227 "2026-03-26T22:17:09Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![AllGamesSuck](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@AllGamesSuck](https://forums.unrealengine.com/u/AllGamesSuck)\
**Post date:** [March 26, 2026, 10:17pm UTC](https://forums.unrealengine.com/t/how-to-set-widget-added-at-runtime-to-fill-container/2709227/1 "2026-03-26T22:17:09Z")

</div>

Hi, I have this widget with nothing but a button and a text, that I’m adding to a horizontal box of another widget, at runtime.

How can i make it to fill that horizontal box Thanks.

---

<div class="post-metadata">

**Author:** ![Countsie](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/countsie/32/1194632_2.png) [@Countsie](https://forums.unrealengine.com/u/Countsie)\
**Post date:** [March 26, 2026, 11:16pm UTC](https://forums.unrealengine.com/t/how-to-set-widget-added-at-runtime-to-fill-container/2709227/2 "2026-03-26T23:16:34Z")

</div>

When adding the widget to the HBox, it should return the Slot reference. If you have the widget ref and need the slot, use GetSlot node.

From the Slot ref, call SetHorizontalAlignment(or SetVerticalAlignment if thats your need) to ‘Fill’.

---

<div class="post-metadata">

**Author:** ![dZh0](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@dZh0](https://forums.unrealengine.com/u/dZh0)\
**Post date:** [March 27, 2026, 12:41am UTC](https://forums.unrealengine.com/t/how-to-set-widget-added-at-runtime-to-fill-container/2709227/3 "2026-03-27T00:41:26Z")

</div>

Yea, what @Countsie said.

The node names are a bit different but I couldn’t recite them from the top of my head either.

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/c/c/c/ccc8fb6393a93bb3b3e8a30c922cba929978343b.jpeg)
