Resizing UMG Widgets in Blueprint

I want to resize a “Canvas Panel” via Blueprint.

Let’s assume I had the following hierarchy in the UMG editor:


And I wanted to change the size of the canvas panel. What I’ve tried so far is:

There is no direct “Resize” or “Set Size” method, instead the “Canvas Panel” seems to wrap its contents in “Canvas Slots”.

The above code always fails at the cast to “CanvasPanelSlot”, however.

Is there a way by which I could resize the canvas or a control contained therein?

You need to go from the Vertical Box rather than the Canvas Panel for the slot. Then you can do what you’re trying to do or use the “Slot as Canvas Slot” pure off the Vertical Box directly.

1 Like