Rect.ToString メソッド
定義
重要
一部の情報は、リリース前に大きく変更される可能性があるプレリリースされた製品に関するものです。 Microsoft は、ここに記載されている情報について、明示または黙示を問わず、一切保証しません。
四角形の文字列形式を返します。
オーバーロード
| 名前 | 説明 |
|---|---|
| ToString() |
四角形の文字列形式を返します。 |
| ToString(IFormatProvider) |
指定した書式プロバイダーを使用して、四角形の文字列形式を返します。 |
ToString()
四角形の文字列形式を返します。
public:
override System::String ^ ToString();
public override string ToString();
override this.ToString : unit -> string
Public Overrides Function ToString () As String
返品
現在の四角形の文字列表現。 文字列の形式は "X,Y,Width,Height" です。
例
次の例は、 ToString() メソッドを使用して、 Rect 構造体の文字列形式を取得する方法を示しています。
private string toStringExample()
{
// Initialize new rectangle.
Rect myRectangle = new Rect();
// The Location property specifies the coordinates of the upper left-hand
// corner of the rectangle.
myRectangle.Location = new Point(10, 5);
// Set the Size property of the rectangle with a width of 200
// and a height of 50.
myRectangle.Size = new Size(200, 50);
// Get a string representation of a Rect structure.
// rectString is equal to "10,5,200,50" .
string rectString = myRectangle.ToString();
return rectString;
}
適用対象
ToString(IFormatProvider)
指定した書式プロバイダーを使用して、四角形の文字列形式を返します。
public:
System::String ^ ToString(IFormatProvider ^ provider);
public string ToString(IFormatProvider provider);
override this.ToString : IFormatProvider -> string
Public Function ToString (provider As IFormatProvider) As String
パラメーター
- provider
- IFormatProvider
カルチャ固有の書式設定情報。
返品
指定した書式プロバイダーによって決定される現在の四角形の文字列形式。