Skip to content

Commit 171eb9d

Browse files
authored
Clarify Visible property (dotnet#7496)
1 parent d08d816 commit 171eb9d

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

xml/System.Windows.Forms/Control.xml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19868,14 +19868,16 @@ Note: This property will always return <see langword="true" /> for an instance o
1986819868
<Docs>
1986919869
<summary>Gets or sets a value indicating whether the control and all its child controls are displayed.</summary>
1987019870
<value>
19871-
<see langword="true" /> if the control and all its child controls are displayed; otherwise, <see langword="false" />. The default is <see langword="true" />.</value>
19871+
<see langword="true" /> to display the control and its child controls; otherwise, <see langword="false" />. The default is <see langword="true" />. When getting the value, <see langword="true" /> is returned only if the control is visible and the parent control, if it exists, is visible.</value>
1987219872
<remarks>
1987319873
<format type="text/markdown"><![CDATA[
1987419874

19875-
## Remarks
19876-
Note that even if `Visible` is set to `true`, the control might not be visible to the user if it is obscured behind other controls.
19877-
19878-
19875+
## Remarks
19876+
19877+
If you set `Visible` to `true`:
19878+
19879+
- The control might not be visible to the user if it's obscured behind other controls.
19880+
- The control won't be displayed if the parent control is not visible.
1987919881

1988019882
## Examples
1988119883
The following code example uses the derived classes <xref:System.Windows.Forms.VScrollBar> and <xref:System.Windows.Forms.HScrollBar> and sets their <xref:System.Windows.Forms.Control.Visible%2A> property values, based on the size of an <xref:System.Drawing.Image> being displayed in a <xref:System.Windows.Forms.PictureBox> control. This example requires that a <xref:System.Windows.Forms.PictureBox> has been created on a form and that <xref:System.Windows.Forms.HScrollBar> and <xref:System.Windows.Forms.VScrollBar> controls have been created on the <xref:System.Windows.Forms.PictureBox>. This code should be called when the image is loaded into the picture box and by the <xref:System.Windows.Forms.Control.Resize> event of the form.

0 commit comments

Comments
 (0)