Size::Subtraction Operator (Size, Size)

 

Subtracts the width and height of one Size structure from the width and height of another Size structure.

Namespace:   System.Drawing
Assembly:  System.Drawing (in System.Drawing.dll)

public:
static Size operator -(
	Size sz1,
	Size sz2
)

Parameters

sz1
Type: System.Drawing::Size

The Size structure on the left side of the subtraction operator.

sz2
Type: System.Drawing::Size

The Size structure on the right side of the subtraction operator.

Return Value

Type: System.Drawing::Size

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

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

void subtractButton_Click( System::Object^ /*sender*/, System::EventArgs^ /*e*/ )
{
   subtractButton->Size = subtractButton->Size - System::Drawing::Size( 10, 10 );
}

.NET Framework
Available since 1.1
Return to top
Show: