BoundsSpecified 열거형
컨트롤의 크기 및 위치를 정의할 때 사용할 컨트롤의 범위를 지정합니다.
이 열거형에는 멤버 값를 비트로 조합할 수 있는 FlagsAttribute 특성이 있습니다.
네임스페이스: System.Windows.Forms
어셈블리: System.Windows.Forms(system.windows.forms.dll)
구문
‘선언
<FlagsAttribute> _
Public Enumeration BoundsSpecified
‘사용 방법
Dim instance As BoundsSpecified
[FlagsAttribute]
public enum BoundsSpecified
[FlagsAttribute]
public enum class BoundsSpecified
/** @attribute FlagsAttribute() */
public enum BoundsSpecified
FlagsAttribute
public enum BoundsSpecified
멤버
멤버 이름 | 설명 | |
---|---|---|
All | Location과 Size 속성 값이 모두 정의되어 있습니다. | |
Height | 컨트롤의 높이가 정의됩니다. | |
Location | 컨트롤의 X와 Y 좌표가 모두 정의되어 있습니다. | |
None | 범위를 지정하지 않았습니다. | |
Size | 컨트롤의 Width와 Height 속성 값이 모두 정의되어 있습니다. | |
Width | 컨트롤의 너비가 정의됩니다. | |
X | 컨트롤의 왼쪽 가장자리를 정의됩니다. | |
Y | 컨트롤의 위쪽 가장자리가 정의됩니다. |
설명
Control 클래스의 SetBoundsCore 및 SetBounds 메서드를 호출할 때 이 열거형의 멤버를 사용합니다.
예제
Private Sub MyForm_Layout(ByVal sender As Object, _
ByVal e As System.Windows.Forms.LayoutEventArgs) Handles MyBase.Layout
' Center the Form on the user's screen everytime it requires a Layout.
Me.SetBounds((System.Windows.Forms.Screen.GetBounds(Me).Width / 2) - (Me.Width / 2), _
(System.Windows.Forms.Screen.GetBounds(Me).Height / 2) - (Me.Height / 2), _
Me.Width, Me.Height, System.Windows.Forms.BoundsSpecified.Location)
End Sub
private void MyForm_Layout(object sender, System.Windows.Forms.LayoutEventArgs e)
{
// Center the Form on the user's screen everytime it requires a Layout.
this.SetBounds((Screen.GetBounds(this).Width/2) - (this.Width/2),
(Screen.GetBounds(this).Height/2) - (this.Height/2),
this.Width, this.Height, BoundsSpecified.Location);
}
private:
void MyForm_Layout( Object^ /*sender*/, System::Windows::Forms::LayoutEventArgs^ /*e*/ )
{
// Center the Form on the user's screen everytime it requires a Layout.
this->SetBounds( (Screen::GetBounds( this ).Width / 2) - (this->Width / 2), (Screen::GetBounds( this ).Height / 2) - (this->Height / 2), this->Width, this->Height, BoundsSpecified::Location );
}
private void MyForm_Layout(Object sender,
System.Windows.Forms.LayoutEventArgs e)
{
// Center the Form on the user's screen everytime it requires a Layout.
this.SetBounds(Screen.GetBounds(this).get_Width()
/ 2 - this.get_Width() / 2, Screen.GetBounds(this).get_Height()
/ 2 - this.get_Height() / 2, this.get_Width(), this.get_Height(),
BoundsSpecified.Location);
} //MyForm_Layout
플랫폼
Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
.NET Framework에서 모든 플래폼의 모든 버전을 지원하지는 않습니다. 지원되는 버전의 목록은 시스템 요구 사항을 참조하십시오.
버전 정보
.NET Framework
2.0, 1.1, 1.0에서 지원
.NET Compact Framework
2.0에서 지원
참고 항목
참조
System.Windows.Forms 네임스페이스
SetBoundsCore
SetBounds
Size
Location