PointCollection.ToString Méthode

Définition

Crée une représentation String de PointCollection.

Surcharges

ToString()

Crée une représentation String de PointCollection.

ToString(IFormatProvider)

Crée une représentation String de PointCollection.

ToString()

Crée une représentation String de PointCollection.

C#
public override string ToString ();

Retours

Retourne un String contenant les valeurs X et Y des structures Point de PointCollection.

Exemples

L’exemple de code suivant montre comment créer une représentation sous forme de chaîne de PointCollection.

C#
string pcString;

// Instantiating and initializing Point structures
Point point1 = new Point(10, 10);
Point point2 = new Point(20, 20);
Point point3 = new Point(30, 30);

// Instantiating a PointCollection 
PointCollection pointCollection1 = new PointCollection();

// Adding Points to PointCollection
pointCollection1.Add(point1);
pointCollection1.Add(point2);
pointCollection1.Add(point3);

// pointCollection1 is equal to (10,10 20,20 30,30)

// Getting a string representation of the PointCollection
pcString = pointCollection1.ToString();

// pcString is equal to "10,10 20,20 30,30"

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

ToString(IFormatProvider)

Crée une représentation String de PointCollection.

C#
public string ToString (IFormatProvider provider);

Paramètres

provider
IFormatProvider

Informations de mise en forme spécifiques à la culture.

Retours

Retourne un String contenant les valeurs X et Y des structures Point de PointCollection.

Exemples

L’exemple de code suivant montre comment obtenir une représentation sous forme de chaîne d’un PointCollection.

C#
string pcString;

// Instantiating and initializing Point structures
Point point1 = new Point(10, 10);
Point point2 = new Point(20, 20);
Point point3 = new Point(30, 30);

// Instantiating a PointCollection 
PointCollection pointCollection1 = new PointCollection();

// Adding Points to PointCollection
pointCollection1.Add(point1);
pointCollection1.Add(point2);
pointCollection1.Add(point3);

// pointCollection1 is equal to (10,10 20,20 30,30)

// Getting a string representation of the PointCollection
pcString = pointCollection1.ToString();

// pcString is equal to "10,10 20,20 30,30"

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