SVerticalBoxScroll

SScrollBox is a container (like SVerticalBox), so you’ll need to put the content you want to make scrollable inside it (you’re not even using the scroll box you’ve made in your example above).

If you don’t need the SVerticalBox in the code above, you can just replace it with an SScrollBox, although I suspect you’re wanting to limit the height of the scrollable area, if so, you probably want this:

ChildSlot
	.VAlign(VAlign_Fill)
	.HAlign(HAlign_Fill)
	[
		SNew(SVerticalBox)
		 
		+ SVerticalBox::Slot()
		.MaxHeight(130.f)
		[
			SNew(SScrollBox)
			
			+ SScrollBox::Slot()
			[
				WrapBox
			]
		]
	];

hello everyone, i have a question about SVerticalBox. I want to implement scrollbar to this

	TArray strArr;
	strArr.Add("hello");
	strArr.Add("Hello 1323");
	strArr.Add("hello dwadw23");
	strArr.Add("hello dwadw23");
	strArr.Add("hello dwadw23");
	strArr.Add("hello dwadw23");
	strArr.Add("hello dwadw23");
	strArr.Add("hello dwadw23");
	strArr.Add("hello dwadw23");
	strArr.Add("hello dwadw23");

	TSharedRef WrapBox = SNew(SWrapBox)
		.PreferredWidth(100.f);
	
	TSharedRef sbar = SNew(SScrollBox);

	for (const auto& Item : strArr)
	{
		WrapBox->AddSlot()
			[
				SNew(STextBlock)
				.Text(FText::FromString(Item))
			];
	}

	

	ChildSlot
		.VAlign(VAlign_Fill)
		.HAlign(HAlign_Fill)
		[
			SNew(SVerticalBox)

			+ SVerticalBox::Slot()
			.MaxHeight(130.f)
			[
				WrapBox
			]
		];

and this is what i get

15308-screen12.jpg

there is no scrollbar, what should i do?

well, i tried with SScrollBox, but i didnt find any limiting for ScrollBox, that’s why i tried to use this, so how can i limit box with SScrollBox and get scrollbar?

sorry, i just saw difference with your example, let me check

yea, it’s working, thank you very much :slight_smile: