How to make autoscroll bars not visible?

Connor Frayne 20 Reputation points
2024-08-12T13:25:13.5+00:00

Hello,

Question as stated in Title. I have a GUI with autoscroll, the problem flowlayoutpanel is to be scrolled with fingers on a touch screen monitor, it does not need scroll bar functionality. How can I make these scroll bars non visible or remove these scroll bars without removing the ability to scroll? .visible doesn't work with autoscroll I've noticed, is there a way to overwrite their paint events?

Thank you,

Connor Frayne
User's image

.NET
.NET
Microsoft Technologies based on the .NET software framework.
3,904 questions
Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
5,172 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,732 questions
{count} votes

3 answers

Sort by: Most helpful
  1. Viorel 117.9K Reputation points
    2024-08-12T22:16:48.1533333+00:00

    Maybe you should experiment with this:

    If FlowLayoutPanel1.VerticalScroll.Visible Then
        FlowLayoutPanel1.Width += SystemInformation.VerticalScrollBarWidth
        FlowLayoutPanel1.Padding = New Padding With {.Left = 0, .Top = 0, .Right = SystemInformation.VerticalScrollBarWidth, .Bottom = 0}
    End If
    
    If FlowLayoutPanel1.HorizontalScroll.Visible Then
        FlowLayoutPanel1.Height += SystemInformation.HorizontalScrollBarHeight
        FlowLayoutPanel1.Padding = New Padding With {.Left = 0, .Top = 0, .Right = FlowLayoutPanel1.Padding.Right, .Bottom = SystemInformation.HorizontalScrollBarHeight}
    End If
    

    If the FlowLayout panel is inside a tab page or another panel, then the right and bottom sides, which contain the scrollbars, become invisible.

    However, the scrollbars should be probably kept visible for better orientation.

    2 people found this answer helpful.
    0 comments No comments

  2. Bruce (SqlWork.com) 66,056 Reputation points
    2024-08-12T15:12:29.89+00:00

    You would need to disable auto scroll, capture the touch events and implement scroll in code.

    1 person found this answer helpful.
    0 comments No comments

  3. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.


    Comments have been turned off. Learn more

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.