BoundsSpecified Enum
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Specifies the bounds of the control to use when defining a control's size and position.
This enumeration supports a bitwise combination of its member values.
public enum class BoundsSpecified
[System.Flags]
public enum BoundsSpecified
[<System.Flags>]
type BoundsSpecified =
Public Enum BoundsSpecified
- Inheritance
- Attributes
Fields
All | 15 | Specifies that both the Location and Size property values are defined. |
Height | 8 | Specifies that the height of the control is defined. |
Location | 3 | Specifies that both the X and Y coordinates of the control are defined. |
None | 0 | No bounds are specified. |
Size | 12 | Specifies that both the Width and Height property values of the control are defined. |
Width | 4 | Specifies that the width of the control is defined. |
X | 1 | Specifies that the left edge of the control is defined. |
Y | 2 | Specifies that the top edge of the control is defined. |
Examples
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 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
Remarks
Use the members of this enumeration when calling the SetBoundsCore and SetBounds methods of the Control class.
Applies to
See also
.NET
피드백
https://aka.ms/ContentUserFeedback
출시 예정: 2024년 내내 콘텐츠에 대한 피드백 메커니즘으로 GitHub 문제를 단계적으로 폐지하고 이를 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은 다음을 참조하세요.다음에 대한 사용자 의견 제출 및 보기