How to change widget's size in Scrollbox?

I spent all afternoon searching the answer, but failed. I found that few people asked it. Maybe it’s a too simple question? But I really don’t know how to do it.

don’t care about the red wave line. The code has no error but i don’t know how to remove the red wave line.The scrollbox is vertical. I just want to set the UImage_Test’s Height to 100.

(don’t care about the red wave line. The code has no error but i don’t know how to remove the red wave line.)

Have you tired wrapping you UImage into an USizeBox. There you can set the min height and width.
Then add the USizeBox to the scrollbox

I thought there was some direct method to do that…So…Now…It seems to be impossible…

SandboxWidget = CreateWidget(this, SandboxWidgetBP);

//If you want a specific child widget (in this case I want a sizebox named “Sandbox_A”).

UWidget *SizeBox = SandboxWidget->GetWidgetFromName(“Sandbox_A”);

//Set the size and location of the widget in the viewport.

//You will have to do math to calculate relative location based on DPI scale.

SandboxWidget->SetPositionInViewport(FVector2D(400, 400), 0);

SandboxWidget->SetDesiredSizeInViewport(FVector2D(400, 600));