Point.Parse(String) Méthode

Définition

Construit un Point à partir du String spécifié.

public:
 static System::Windows::Point Parse(System::String ^ source);
public static System.Windows.Point Parse (string source);
static member Parse : string -> System.Windows.Point
Public Shared Function Parse (source As String) As Point

Paramètres

source
String

Représentation sous forme de chaîne d'un point.

Retours

Point

Structure Point équivalente.

Exceptions

source ne se compose pas de deux valeurs doubles délimitées par une virgule ou un espace.

source ne contient pas deux nombres.

  • ou - source contient trop de séparateurs.

Exemples

L’exemple suivant montre comment utiliser la Parse méthode pour convertir une String représentation d’un point en structure Point .

private Point parseExample()
{

    // Converts a string representation of a point into a Point structure
    // using the Parse static method.
    // pointResult is equal to (1,3).
    Point pointResult = Point.Parse("1,3");

    return pointResult;
}
Private Function parseExample() As Point

    ' Converts a string representation of a point into a Point structure
    ' using the Parse static method.
    ' pointResult is equal to (1,3).
    Dim pointResult As Point = Point.Parse("1,3")

    Return pointResult

End Function

S’applique à