Windows Develop Bookmark and Share   
 index > Windows Forms General > Accessing protected problems
 

Accessing protected problems

I am trying to set VScroll or SetScrollState on a Panel but i cannot access the protected members altough i read this:

The protected keyword is a member access modifier. A protected member is accessible within its class and by derived classes.

...

A protected member of a base class is accessible in a derived class only if the access takes place through the derived class type.

in here:http://msdn2.microsoft.com/en-us/library/bcd5672a(VS.80).aspx

I cannot access VScroll from Panel instance; Panel derives from ScrollableControl so it should've worked.

I tried even setting a property that accessess the protectedmember on a class derived from Panel. It seemed to access it but it didn't changed anything so it wasn't a solution.

MSDN:

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 is not visible, even if the AutoScroll property is set to true.

So if it accessed it it should've set the scroll bar visibility to false; i tried SetScrollState too, it didn't work.

I cannot tell wich is the problem, protected accessign or Panel implementation.

w0lfshad3  Monday, October 01, 2007 10:33 AM
The documentation for Scrollable.VScroll in my copy of the MSDN library says something quite different:

"Note AutoScroll maintains the visibility of the scrollbars automatically. Therefore, setting the HScroll or VScroll properties to true have no effect when AutoScroll is enabled."

That's accurate.
nobugz  Monday, October 01, 2007 3:15 PM
The documentation for Scrollable.VScroll in my copy of the MSDN library says something quite different:

"Note AutoScroll maintains the visibility of the scrollbars automatically. Therefore, setting the HScroll or VScroll properties to true have no effect when AutoScroll is enabled."

That's accurate.
nobugz  Monday, October 01, 2007 3:15 PM

It must be accurate. Well to show i didn't invent that MSDN part:

ms-help://MS.MSDNQTR.v80.en/MS.MSDN.v80/MS.NETFX30SDK4VS.1033/cpref32/html/T_System_Windows_Forms_ScrollableControl.htm

http://msdn2.microsoft.com/en-us/library/system.windows.forms.scrollablecontrol.aspx

check remarks.

Still i can't explain why i can't access that property anyway through a derived class instance like the other link specifies.

w0lfshad3  Tuesday, October 02, 2007 2:43 AM

You can use google to search for other answers

Custom Search

More Threads

• Should shortcut keys still be active when the menu item's parent is disabled?
• Is it possible to rotate window control like rotate picture box ?
• How to detect mouse click on winform title bar?
• How to do query if a property/method is supported by the object?
• Listing all the controls in the page
• Media services
• Read Data From Windows Form?
• How to create a unique visual interface for my application.
• cleaning a webbrowser
• Transparent control on panel shows flickering backcolor (bug?)