Buttons in scroll box

I am generating buttons during runtime and attaching them to the scroll box. I am storing these buttons in an array (Check the picture).

I want to detect and get the button’s style when clicked on the button. At the moment I am doing this to call “OnButtonClicked”, but I am not getting the right button’s reference.

Can anybody tell me how to get this working and detect the correct button on being pressed?

Hi, Do you put all info on each button when you creating them ? Look at mine how I set them. I’m adding all the info that i’ll need later for each button when a create them. So you can use the OnClicked Event and you’ll get the right info on each button

How did you do to scroll over the buttons? When i click the buttons I cant scroll :frowning:

1 Like

Did you manage to find a solution for this? I have the same issue!

All of the above issues can be solved with a custom button.

CustomButtonAndScroll

  1. Create a custom button:

image

  1. Put custom buttons into the Scroll box:

  1. Access to the used button:

image

  1. Add buttons at runtime:

  1. Get buttons in the scroll box:

I hope it’ll be helpful to someone.

My Products

3 Likes

This applies to half of all UI issues. I’m going to print, frame and hang this inspirational quote over the bed, right next to my Hufflepuff scarf.

2 Likes

Thank you so much for pointing me in the right direction, your solution couldn’t be applied to my case but you helped me understand where I had to make changes!

Also thank you for showing me that the “Named slot” widget exists, I didn’t know about it and it would have been very useful in my past projects! :smiling_face_with_tear:

2 Likes