Jarod Posted February 5, 2003 Posted February 5, 2003 Hello, I was using a Panel control and wanted the following behaviour: - AutoScroll to be able to set an AutoScroll position (to synchronise two scrollable panel) - Hide both scrollbars to define my scrollBar common to my two forms. Accordingly to the MSDN which says: To manually override which scroll bars are visible, set the VScroll and HScroll properties. If either property is set to false, the corresponding scroll bar will not be visible, even if the AutoScroll property is set to true I create my own Panel object with that simple definition: Public Class myPanel Inherits Panel Public Sub New() MyBase.New() Me.HScroll = False Me.VScroll = False Me.AutoScroll = True End Sub End Class But if my panel is correctly "AutoScrolled", both ScrollBars are visible. Does anyone has already experienced that and found a solution / workaround? Thanks, Quote Jarod
*Gurus* divil Posted February 5, 2003 *Gurus* Posted February 5, 2003 Have you tried not setting VScroll and HScroll at all? Quote MVP, Visual Developer - .NET Now you see why evil will always triumph - because good is dumb. My free .NET Windows Forms Controls and Articles
*Experts* Nerseus Posted February 5, 2003 *Experts* Posted February 5, 2003 Don't you want to do: Me.AutoScroll = True Me.HScroll = False Me.VScroll = False instead of Me.HScroll = False Me.VScroll = False Me.AutoScroll = True -nerseus Quote "I want to stand as close to the edge as I can without going over. Out on the edge you see all the kinds of things you can't see from the center." - Kurt Vonnegut
Jarod Posted February 6, 2003 Author Posted February 6, 2003 Thanks for your reply! However, it still doesn't work. If i don't set any of these values, the default values (TRUE) remain and the scrollbars are drawn. Modifying the code order doesn't change anything either. For the microsoft support, everything is working nice, but I shouldn't do that in the new function. Ok, I have tried anywhere else, calling a property after, overriding the OnPaint method to reset HScroll and VScroll to false, but it doesn't work either. Does anybody have succeeded to do that? Quote Jarod
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.