Shape.Visible 속성
선 또는 도형 컨트롤이 표시 되는지 여부를 나타내는 값을 가져오거나 설정 합니다.
네임스페이스: Microsoft.VisualBasic.PowerPacks
어셈블리: Microsoft.VisualBasic.PowerPacks.Vs(Microsoft.VisualBasic.PowerPacks.Vs.dll)
구문
‘선언
<BrowsableAttribute(True)> _
Public Property Visible As Boolean
[BrowsableAttribute(true)]
public bool Visible { get; set; }
[BrowsableAttribute(true)]
public:
property bool Visible {
bool get ();
void set (bool value);
}
[<BrowsableAttribute(true)>]
member Visible : bool with get, set
function get Visible () : boolean
function set Visible (value : boolean)
속성 값
형식: System.Boolean
true 컨트롤에 표시 되는 경우; 그렇지 않으면 false.기본값은 true입니다.
설명
Visible 속성을 사용 하 여 그래픽 개체를 사용 하 여 만들 수 있는 LineShape, OvalShape, 또는 RectangleShape 컨트롤이 표시 되 고 런타임에 사라집니다.
예제
다음 예제에서는 Visible 런타임에 서로 다른 두 도형 간을 전환 하는 속성입니다.이 예제에서는 있어야는 RectangleShape RectangleShape1 이라는 컨트롤 하는 OvalShape 폼에 OvalShape1 이라는 컨트롤.최상의 결과 얻으려면 두 컨트롤 모두 같은 크기로 하 고 맨 위에 다른 하나를 놓습니다.
Private Sub ShapeVisible_Load() Handles MyBase.Load
' Hide the oval.
OvalShape1.Visible = False
End Sub
Private Sub Shapes_Click() Handles RectangleShape1.Click,
OvalShape1.Click
If OvalShape1.Visible = True Then
' Hide the oval.
OvalShape1.Visible = False
' Show the rectangle.
RectangleShape1.Visible = True
Else
' Hide the rectangle.
RectangleShape1.Visible = False
' Show the oval.
OvalShape1.Visible = True
End If
End Sub
private void ShapeVisible_Load(System.Object sender, System.EventArgs e)
{
// Hide the oval.
ovalShape1.Visible = false;
}
private void Shapes_Click(System.Object sender, System.EventArgs e)
{
if (ovalShape1.Visible == true)
// Hide the oval.
{
ovalShape1.Visible = false;
// Show the rectangle.
rectangleShape1.Visible = true;
}
else
{
// Hide the rectangle.
rectangleShape1.Visible = false;
// Show the oval.
ovalShape1.Visible = true;
}
}
.NET Framework 보안
- 직접 실행 호출자의 경우 완전히 신뢰합니다. 이 멤버는 부분적으로 신뢰할 수 있는 코드에서 사용할 수 없습니다. 자세한 내용은 부분 신뢰 코드에서 라이브러리 사용을 참조하십시오.
참고 항목
참조
Microsoft.VisualBasic.PowerPacks 네임스페이스
기타 리소스
방법: LineShape 컨트롤로 선 그리기(Visual Studio)
방법: OvalShape 및 RectangleShape 컨트롤을 사용하여 도형 그리기(Visual Studio)