Size.Addition(Size, Size) 操作员
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
public:
static System::Drawing::Size operator +(System::Drawing::Size sz1, System::Drawing::Size sz2);
C#
public static System.Drawing.Size operator + (System.Drawing.Size sz1, System.Drawing.Size sz2);
static member ( + ) : System.Drawing.Size * System.Drawing.Size -> System.Drawing.Size
Public Shared Operator + (sz1 As Size, sz2 As Size) As Size
一个 Size 结构,它是加法运算的结果。
下面的代码示例演示 了 Addition 运算符。 该示例旨在与 Windows 窗体 一起使用。 若要运行此示例,请将其粘贴到包含名为 addButton
的按钮的窗体中, addButton_Click
并将 方法与按钮的事件 Click 相关联。
void addButton_Click( System::Object^ /*sender*/, System::EventArgs^ /*e*/ )
{
addButton->Size = addButton->Size + System::Drawing::Size( 10, 10 );
}
C#
private void addButton_Click(System.Object sender, System.EventArgs e)
{
addButton.Size = addButton.Size + new Size(10, 10);
}
Private Sub addButton_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles addButton.Click
addButton.Size = Size.op_Addition(addButton.Size, New Size(10, 10))
End Sub
产品 | 版本 |
---|---|
.NET | Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9 |
.NET Framework | 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET Standard | 2.0, 2.1 |