How to suppress a scroll bar
-
I noticed that when the XP visual styles are on, the Panel control sometimes adds a horizontal scroll bar when it is not necessary. The controls in the Panel fit the visible area fine (including the scroll margin and vertical scroll bar). This does not happen when the visual styles are off, i.e. in the Windows classic style X| ! It doesn't matter if the AutoScroll property is set to true or false. To fix this problem I wanted to hide the horizontal scroll bar manually. I tried to use the HScroll property. The MSDN documentation on the ScrollableControl (from which Panel is derived) class 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 is not visible, even if the AutoScroll property is set to true." This simply isn't true :mad:. You can set the property HScroll to false, but the horizontal scroll bar is still there and remains functional. The method SetScrollState doesn't work either. Does anyone know how I can suppress a horizontal scroll bar in a panel? Thanks.
-
I noticed that when the XP visual styles are on, the Panel control sometimes adds a horizontal scroll bar when it is not necessary. The controls in the Panel fit the visible area fine (including the scroll margin and vertical scroll bar). This does not happen when the visual styles are off, i.e. in the Windows classic style X| ! It doesn't matter if the AutoScroll property is set to true or false. To fix this problem I wanted to hide the horizontal scroll bar manually. I tried to use the HScroll property. The MSDN documentation on the ScrollableControl (from which Panel is derived) class 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 is not visible, even if the AutoScroll property is set to true." This simply isn't true :mad:. You can set the property HScroll to false, but the horizontal scroll bar is still there and remains functional. The method SetScrollState doesn't work either. Does anyone know how I can suppress a horizontal scroll bar in a panel? Thanks.
I still haven't been able to suppress the scroll bar. The panel totally ignores the property HScroll and other scroll bar methods :mad:. However, I can now hide the scroll bar using the Interop function ShowScrollBar, although it doesn't prevent the scroll bar to appear briefly.
-
I still haven't been able to suppress the scroll bar. The panel totally ignores the property HScroll and other scroll bar methods :mad:. However, I can now hide the scroll bar using the Interop function ShowScrollBar, although it doesn't prevent the scroll bar to appear briefly.