Rect.ToString Méthode
Important
Certaines informations portent sur la préversion du produit qui est susceptible d’être en grande partie modifiée avant sa publication. Microsoft exclut toute garantie, expresse ou implicite, concernant les informations fournies ici.
Renvoie une représentation sous forme de chaîne du rectangle.
ToString() |
Renvoie une représentation sous forme de chaîne du rectangle. |
ToString(IFormatProvider) |
Renvoie une représentation sous forme de chaîne du rectangle en utilisant le fournisseur de format spécifié. |
Renvoie une représentation sous forme de chaîne du rectangle.
public:
override System::String ^ ToString();
public override string ToString ();
override this.ToString : unit -> string
Public Overrides Function ToString () As String
Retours
Une représentation sous forme de chaîne du rectangle actuel. La chaîne a la forme suivante : « X,Y,Width,Height ».
Exemples
L’exemple suivant montre comment utiliser la ToString() méthode pour obtenir une représentation sous forme de chaîne d’une Rect structure.
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;
}
S’applique à
.NET Framework 4.8.1 et autres versions
Produit | Versions |
---|---|
.NET Framework | 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 |
Windows Desktop | 3.0, 3.1, 5, 6, 7, 8, 9 |
Renvoie une représentation sous forme de chaîne du rectangle en utilisant le fournisseur de format spécifié.
public:
System::String ^ ToString(IFormatProvider ^ provider);
public string ToString (IFormatProvider provider);
override this.ToString : IFormatProvider -> string
Public Function ToString (provider As IFormatProvider) As String
Paramètres
- provider
- IFormatProvider
Informations de mise en forme spécifiques à la culture.
Retours
Une représentation sous forme de chaîne du rectangle actuel qui est déterminée par le fournisseur de format spécifié.
S’applique à
.NET Framework 4.8.1 et autres versions
Produit | Versions |
---|---|
.NET Framework | 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 |
Windows Desktop | 3.0, 3.1, 5, 6, 7, 8, 9 |
Commentaires sur .NET
.NET est un projet open source. Sélectionnez un lien pour fournir des commentaires :