Size.Addition(Size, Size) Size.Addition(Size, Size) Size.Addition(Size, Size) Size.Addition(Size, Size) Operator


Adds the width and height of one Size structure to the width and height of another Size structure.

 static System::Drawing::Size operator +(System::Drawing::Size sz1, System::Drawing::Size sz2);
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 Size Size Size

The first Size to add.

Size Size Size Size

The second Size to add.


A Size structure that is the result of the addition operation.


The following code example demonstrates the Addition operator. The example is designed to be used with Windows Forms. To run this example, paste it into a form that contains a button named addButton and associate the addButton_Click method with the button's Click event.

void addButton_Click( System::Object^ /*sender*/, System::EventArgs^ /*e*/ )
   addButton->Size = addButton->Size + System::Drawing::Size( 10, 10 );
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

Applies to