Point.Parse(String) Metoda

Definicja

Tworzy element Point z określonego Stringelementu .

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

Parametry

source
String

Reprezentacja ciągu punktu.

Zwraca

Point

Równoważna Point struktura.

Wyjątki

source nie składa się z dwóch wartości rozdzielonych przecinkami lub spacjami.

source nie zawiera dwóch liczb.

-lub- source zawiera zbyt wiele ograniczników.

Przykłady

W poniższym przykładzie pokazano, jak za pomocą Parse metody przekonwertować reprezentację String Point punktu na strukturę.

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

Dotyczy