Hi @kwok kan ho , Welcome to Q&A.
Scrolling the container to the bottom may not always work as expected if the container has many controls and not enough space to display them all at once.
In this case, the scroll position may not be updated properly, or the container may not be able to scroll far enough to bring the last control into view.
In this situation, you may need to consider using a different container, such as a List View or a DataGrid View, which are better suited for displaying large numbers of items.
If you want to scroll to the bottom of the container, you can use the property of the container and set it to the maximum value.
this is my code:
private void Form1_Load(object sender, EventArgs e)
{
for (int i = 0; i < 1000; i++)
{
PictureBox a = new PictureBox();
a.Image = pictureBox1.Image;
flowLayoutPanel1.Controls.Add(a);
}
flowLayoutPanel1.AutoScroll = true;
flowLayoutPanel1.VerticalScroll.Value = flowLayoutPanel1.VerticalScroll.Maximum;
}
Best Regards,
Jiale
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.