Skip to content

Commit 1aec9c6

Browse files
Clarified the purpose of Winforms ScrollableControl HScroll and VScroll properties (#3702)
* Fixes #2329 * Update xml/System.Windows.Forms/ScrollableControl.xml Co-Authored-By: Maira Wenzel <[email protected]> * Update xml/System.Windows.Forms/ScrollableControl.xml Co-Authored-By: Maira Wenzel <[email protected]> * changed wording for clarity * reverted VS editor change that added an unneeded CDATA tag * Update xml/System.Windows.Forms/ScrollableControl.xml Co-Authored-By: Maira Wenzel <[email protected]> * Update xml/System.Windows.Forms/ScrollableControl.xml Co-Authored-By: Maira Wenzel <[email protected]> Co-authored-by: Maira Wenzel <[email protected]>
1 parent b994889 commit 1aec9c6

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

xml/System.Windows.Forms/ScrollableControl.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
5050
The <xref:System.Windows.Forms.ScrollableControl> class acts as a base class for controls that require the ability to scroll. To enable a control to display scroll bars as needed, set the <xref:System.Windows.Forms.ScrollableControl.AutoScroll%2A> property to `true` and set the <xref:System.Windows.Forms.ScrollableControl.AutoScrollMinSize%2A> property to the desired size. When the control is sized smaller than the specified minimum size, or a child control is located outside the bounds of the control, the appropriate scroll bars are displayed.
5151
52-
To manually override which scroll bars are visible, set the <xref:System.Windows.Forms.ScrollableControl.VScroll%2A> and <xref:System.Windows.Forms.ScrollableControl.HScroll%2A> properties. If either property is set to `false`, the corresponding scroll bar is not visible, even if the <xref:System.Windows.Forms.ScrollableControl.AutoScroll%2A> property is set to `true`.
52+
When developing custom controls that respond to layout changes by displaying scroll bars, set the <xref:System.Windows.Forms.ScrollableControl.VScroll%2A> and <xref:System.Windows.Forms.ScrollableControl.HScroll%2A> properties. If either scroll bar is not visible, set the corresponding property to `false`, even if the <xref:System.Windows.Forms.ScrollableControl.AutoScroll%2A> property is set to `true`.
5353
5454
You can handle the <xref:System.Windows.Forms.ScrollableControl.Scroll> event to know when the user or code scrolls the client area.
5555
@@ -174,14 +174,14 @@
174174
<value>
175175
<see langword="true" /> if the container enables auto-scrolling; otherwise, <see langword="false" />. The default value is <see langword="false" />.</value>
176176
<remarks>
177-
<format type="text/markdown"><![CDATA[
177+
<format type="text/markdown"><![CDATA[
178178
179179
## Remarks
180180
When `true`, this property enables the container to have a virtual size that is larger than its visible boundaries.
181181
182-
There is currently a limitation in Windows Forms that prevents all classes derived from <xref:System.Windows.Forms.ScrollableControl> from acting properly when both <xref:System.Windows.Forms.Control.RightToLeft%2A> is enabled and <xref:System.Windows.Forms.ScrollableControl.AutoScroll%2A> is set to <xref:System.Windows.Forms.RightToLeft.Yes>. For example, let's say that you place a control such as <xref:System.Windows.Forms.Panel> - or a container class derived from <xref:System.Windows.Forms.Panel> (such as <xref:System.Windows.Forms.FlowLayoutPanel> or <xref:System.Windows.Forms.TableLayoutPanel>) - on your form. If you set <xref:System.Windows.Forms.ScrollableControl.AutoScroll%2A> on the container to <xref:System.Windows.Forms.RightToLeft.Yes> and then set the <xref:System.Windows.Forms.Control.Anchor%2A> property on one or more of the controls inside of the container to <xref:System.Windows.Forms.AnchorStyles.Right>, then no scrollbar ever appears. The class derived from <xref:System.Windows.Forms.ScrollableControl> acts as if <xref:System.Windows.Forms.ScrollableControl.AutoScroll%2A> were set to <xref:System.Windows.Forms.RightToLeft.No>.
182+
There is currently a limitation in Windows Forms that prevents all classes derived from <xref:System.Windows.Forms.ScrollableControl> from acting properly when both <xref:System.Windows.Forms.Control.RightToLeft%2A> is enabled and <xref:System.Windows.Forms.ScrollableControl.AutoScroll%2A> is set to `true`. For example, let's say that you place a control such as <xref:System.Windows.Forms.Panel> - or a container class derived from <xref:System.Windows.Forms.Panel> (such as <xref:System.Windows.Forms.FlowLayoutPanel> or <xref:System.Windows.Forms.TableLayoutPanel>) - on your form. If you set <xref:System.Windows.Forms.ScrollableControl.AutoScroll%2A> on the container to `true` and then set the <xref:System.Windows.Forms.Control.Anchor%2A> property on one or more of the controls inside of the container to <xref:System.Windows.Forms.AnchorStyles.Right>, then no scrollbar ever appears. The class derived from <xref:System.Windows.Forms.ScrollableControl> acts as if <xref:System.Windows.Forms.ScrollableControl.AutoScroll%2A> were set to `false`.
183183
184-
Currently, the only workaround is to nest the <xref:System.Windows.Forms.ScrollableControl> inside another <xref:System.Windows.Forms.ScrollableControl>. For instance, if you need <xref:System.Windows.Forms.TableLayoutPanel> to work in this situation, you can place it inside of a <xref:System.Windows.Forms.Panel> control and set <xref:System.Windows.Forms.ScrollableControl.AutoScroll%2A> on the <xref:System.Windows.Forms.Panel> to <xref:System.Windows.Forms.RightToLeft.Yes>.
184+
Currently, the only workaround is to nest the <xref:System.Windows.Forms.ScrollableControl> inside another <xref:System.Windows.Forms.ScrollableControl>. For instance, if you need <xref:System.Windows.Forms.TableLayoutPanel> to work in this situation, you can place it inside of a <xref:System.Windows.Forms.Panel> control and set <xref:System.Windows.Forms.ScrollableControl.AutoScroll%2A> on the <xref:System.Windows.Forms.Panel> to `true`.
185185
186186
> [!NOTE]
187187
> <xref:System.Windows.Forms.ScrollableControl.AutoScroll%2A> maintains the visibility of the scrollbars automatically. Therefore, setting the <xref:System.Windows.Forms.ScrollableControl.HScroll%2A> or <xref:System.Windows.Forms.ScrollableControl.VScroll%2A> property to `true` has no effect when <xref:System.Windows.Forms.ScrollableControl.AutoScroll%2A> is enabled.

0 commit comments

Comments
 (0)