3

I am designing a touch optimized WinForm application. The problem is: how to add a custom VScrollBar that I can affect its width?

This is my VScrollBar code

    panel1.VerticalScroll.Value = vScrollBar1.Value;

The problem is that it is not scrolling the panel to the end.

Makyen
  • 31,849
  • 12
  • 86
  • 121
DANIEL NGAHU
  • 51
  • 2
  • 11
  • Your statement of "that I can affect its width" is unclear. It could have multiple interpretations. That statement is implying that you want to change the width of the vertical scrollbar? Yet your code implies that you are wanting to change to where your panel is scrolled. What is your real issue/desire? – Makyen Jun 19 '16 at 03:39
  • Potential duplicate: [C# UserControl.VerticalScroll.Value not being set](http://stackoverflow.com/questions/757408/c-sharp-usercontrol-verticalscroll-value-not-being-set). – Makyen Jun 19 '16 at 03:41

1 Answers1

1

You can add a FlowLayoutPanel and set the following property to that:

 flowLayoutPanel1.FlowDirection = System.Windows.Forms.FlowDirection.TopDown;
 flowLayoutPanel1.WrapContents = false;
 flowLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
 flowLayoutPanel1.AutoScroll = true;

and you can see the scroll, you can use the Panels and design your application.

Taken from:

How to make Winform scrollable in C#

Community
  • 1
  • 1
whoismaikl
  • 304
  • 1
  • 3
  • 11