Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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,

Jarod
  • *Experts*
Posted

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

"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
Posted

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?

Jarod

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...