Form.Location 属性

定义

获取或设置以屏幕坐标表示的代表 Form 左上角的 PointGets or sets the Point that represents the upper-left corner of the Form in screen coordinates.

public:
 property System::Drawing::Point Location { System::Drawing::Point get(); void set(System::Drawing::Point value); };
[System.ComponentModel.SettingsBindable(true)]
public System.Drawing.Point Location { get; set; }
member this.Location : System.Drawing.Point with get, set
Public Property Location As Point

属性值

以屏幕坐标表示的代表 Form 左上角的 PointThe Point that represents the upper-left corner of the Form in screen coordinates.

属性

注解

Point 是一种结构,这意味着它是值类型。Point is a structure, which means that it is a value type. 如果访问 Point 中的属性,将返回该属性的副本。If you access a property in Point, a copy of the property is returned. 因此,更改从 Location 属性返回的 PointXY 属性将不会影响 LeftRightTopBottomForm属性值。Therefore, changing the X or Y properties of the Point returned from the Location property will not affect the Left, Right, Top, or Bottom property values of the Form. 若要调整这些属性,请单独设置每个属性值,或使用新的 Point设置 "Location" 属性。To adjust these properties, set each property value individually, or set the Location property with a new Point.

Location 属性获取或设置 Control 基类的 Location 属性,并将 Bindable 属性设置为 trueThe Location property gets or sets the Location property of the Control base class, and sets the Bindable property to true.

适用于

另请参阅