VerticalScroll.visible doesn't seem to be working on autoscroll

Connor Frayne 25 Reputation points
2024-07-12T19:45:59.63+00:00

Hello,

My Flow layout panel has panels in it that stretch the entire flow panel, the problem is that it has autoscroll on(and I want to keep it on), and when there'ss enough panels to get a vertical scroll bar, the ends of the panels are cut out and it looks bad. I tried using this code to account for that

Container.Size = New Size(Form1.FlowLayoutPanel1.Width - Form1.FlowLayoutPanel1.Margin.Right * 3, 75) If Form1.FlowLayoutPanel1.VerticalScroll.Visible Then Container.Size = New Size((Form1.FlowLayoutPanel1.Width - Form1.FlowLayoutPanel1.Margin.Right * 3) - SystemInformation.VerticalScrollBarWidth, 75) End If

But VerticalScroll.Visible doesn't seem to be picking up autoscroll, any suggestions?

Thank you,

Connor Frayne

Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
5,144 questions
VB
VB
An object-oriented programming language developed by Microsoft that is implemented on the .NET Framework. Previously known as Visual Basic .NET.
2,729 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Michael Taylor 54,401 Reputation points
    2024-07-12T20:29:37.8133333+00:00

    Please provide the actual designer code you're using for the UI. At this point it sounds like WPF, XAML or MAUI but it isn't clear. Nevertheless giving us the designer code (please use the Inline Code option so we can easily copy/paste it) so we can see how you have things configured. It would be even better if you could provide a link to a working example.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.