Control 构造函数
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
初始化 Control 类的新实例。
重载
| 名称 | 说明 |
|---|---|
| Control() |
使用默认设置初始化类的新实例 Control 。 |
| Control(String) |
使用特定文本初始化类的新实例 Control 。 |
| Control(Control, String) |
使用特定文本初始化类的新实例 Control 作为子控件。 |
| Control(String, Int32, Int32, Int32, Int32) |
使用特定文本、大小和位置初始化类的新实例 Control 。 |
| Control(Control, String, Int32, Int32, Int32, Int32) |
将类的新实例初始化为具有特定文本、大小和位置的 Control 子控件。 |
Control()
- Source:
- Control.cs
- Source:
- Control.cs
- Source:
- Control.cs
- Source:
- Control.cs
- Source:
- Control.cs
使用默认设置初始化类的新实例 Control 。
public:
Control();
public Control();
Public Sub New ()
注解
该 Control 类是 Windows 窗体应用程序中使用的所有控件的基类。 由于此类通常用于创建类的实例,因此此构造函数通常不直接调用,而是由派生类调用。
适用于
Control(String)
- Source:
- Control.cs
- Source:
- Control.cs
- Source:
- Control.cs
- Source:
- Control.cs
- Source:
- Control.cs
使用特定文本初始化类的新实例 Control 。
public:
Control(System::String ^ text);
public Control(string text);
public Control(string? text);
new System.Windows.Forms.Control : string -> System.Windows.Forms.Control
Public Sub New (text As String)
参数
- text
- String
控件显示的文本。
注解
该 Control 类是 Windows 窗体应用程序中使用的所有控件的基类。 由于此类通常用于创建类的实例,因此此构造函数通常不直接调用,而是由派生类调用。
此版本的 Control 构造函数将初始 Text 属性值设置为 text 参数值。
适用于
Control(Control, String)
- Source:
- Control.cs
- Source:
- Control.cs
- Source:
- Control.cs
- Source:
- Control.cs
- Source:
- Control.cs
使用特定文本初始化类的新实例 Control 作为子控件。
public:
Control(System::Windows::Forms::Control ^ parent, System::String ^ text);
public Control(System.Windows.Forms.Control parent, string text);
public Control(System.Windows.Forms.Control? parent, string? text);
new System.Windows.Forms.Control : System.Windows.Forms.Control * string -> System.Windows.Forms.Control
Public Sub New (parent As Control, text As String)
参数
- text
- String
控件显示的文本。
注解
该 Control 类是 Windows 窗体应用程序中使用的所有控件的基类。 由于此类通常用于创建类的实例,因此此构造函数通常不直接调用,而是由派生类调用。
此版本的 Control 构造函数将初始 Text 属性值设置为 text 参数值。 构造函数还会将控件添加到父控件的 Control.ControlCollection控件。
适用于
Control(String, Int32, Int32, Int32, Int32)
- Source:
- Control.cs
- Source:
- Control.cs
- Source:
- Control.cs
- Source:
- Control.cs
- Source:
- Control.cs
使用特定文本、大小和位置初始化类的新实例 Control 。
public:
Control(System::String ^ text, int left, int top, int width, int height);
public Control(string text, int left, int top, int width, int height);
public Control(string? text, int left, int top, int width, int height);
new System.Windows.Forms.Control : string * int * int * int * int -> System.Windows.Forms.Control
Public Sub New (text As String, left As Integer, top As Integer, width As Integer, height As Integer)
参数
- text
- String
控件显示的文本。
注解
该 Control 类是 Windows 窗体应用程序中使用的所有控件的基类。 由于此类通常用于创建类的实例,因此此构造函数通常不直接调用,而是由派生类调用。
此版本的 Control 构造函数将初始 Text 属性值设置为 text 参数值。 控件的初始Size值和Location控件由left参数topwidth值和height参数值确定。
注释
若要保持更好的性能,请不要在其构造函数中设置控件的大小。 首选方法是重写 DefaultSize 属性。
适用于
Control(Control, String, Int32, Int32, Int32, Int32)
- Source:
- Control.cs
- Source:
- Control.cs
- Source:
- Control.cs
- Source:
- Control.cs
- Source:
- Control.cs
将类的新实例初始化为具有特定文本、大小和位置的 Control 子控件。
public:
Control(System::Windows::Forms::Control ^ parent, System::String ^ text, int left, int top, int width, int height);
public Control(System.Windows.Forms.Control parent, string text, int left, int top, int width, int height);
public Control(System.Windows.Forms.Control? parent, string? text, int left, int top, int width, int height);
new System.Windows.Forms.Control : System.Windows.Forms.Control * string * int * int * int * int -> System.Windows.Forms.Control
Public Sub New (parent As Control, text As String, left As Integer, top As Integer, width As Integer, height As Integer)
参数
- text
- String
控件显示的文本。
注解
该 Control 类是 Windows 窗体应用程序中使用的所有控件的基类。 由于此类通常用于创建类的实例,因此此构造函数通常不直接调用,而是由派生类调用。
此版本的 Control 构造函数将初始 Text 属性值设置为 text 参数值。 构造函数还会将控件添加到父控件的 Control.ControlCollection控件。 控件的初始Size值和Location控件由left参数topwidth值和height参数值确定。
注释
若要保持更好的性能,请不要在其构造函数中设置控件的大小。 首选方法是重写 DefaultSize 属性。