Point.Parse(String) Methode

Definitie

Hiermee wordt een Point van de opgegeven String.

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

Parameters

source
String

Een tekenreeksweergave van een punt.

Retouren

De equivalente Point structuur.

Uitzonderingen

source bestaat niet uit twee door komma's gescheiden dubbele waarden of spaties.

source bevat geen twee getallen.

– of –

source bevat te veel scheidingstekens.

Voorbeelden

In het volgende voorbeeld ziet u hoe u de Parse methode gebruikt om een String weergave van een punt te converteren naar een Point structuur.

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

Van toepassing op