In my application I always want hscrollbar.LargeChange to equal panel.Width. Currently I set hscrollbar.LargeChange to panel.Widthin resizing events, painting events, et cetera. I do not know much about binding so I’m wondering if it is possible to do this.
Sorry if this is a simple question but when I tried googling binding and c# I got a lot of complicated information about other platforms.
Actually, there is a way to bind the LargeChange property of the HScrollBar to the Width property of the panel, but I think I’ve just discovered a bug in .NET 4 with regards to this as it works if I target .NET 3.5.
Basically, you need to manually create a Binding object and assign it to the HScrollBar’s DataBindings collection, like so:
Again, this doesn’t work in .NET 4, but it does in .NET 3.5. I’ll probably submit a bug report.
Cheers