i have a panel in my winforms and in it i load some usercontrols .
i would like to autoscroll to the bottom of the panel( as my panel fills ) everytime a new usercontrol is added . How can i do so ?
You can do that by setting the VerticalScroll
of the Panel but I think it would be better to use ScrollControlIntoView
instead.
private void panel1_ControlAdded(object sender, ControlEventArgs e)
{
panel1.ScrollControlIntoView(e.Control);
}
Good luck!
You could use ScrollControlIntoView and pass the control you last added.
An alternate solution would be:
panel.VerticalScroll.Value = panel.VerticalScroll.Maximum
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With