Mixer
Mixer

Reputation: 1332

How to scroll to a specific element in a StackPanel?

I created a vertical StackPanel and added a large number of Child elements. Each Child has a different height. How can I scroll to a specific child? What if a Child is not visible e.g. due to being located at the bottom of the list.

Upvotes: 2

Views: 1071

Answers (1)

Nathan Hillyer
Nathan Hillyer

Reputation: 1979

Try using the StackPanel.MakeVisible(Visual visual, Rect rectangle) method by passing in the control you would like as the first parameter, and a Rect with the coordinates to make visible as the second.

Upvotes: 1

Related Questions