Point.Parse(String) Metoda

Definice

Vytvoří ze Point zadaného Stringobjektu .

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

Řetězcová reprezentace bodu.

Návraty

Ekvivalentní Point struktura.

Výjimky

source se skládá ze dvou dvojitých hodnot oddělených čárkami nebo mezerami.

source neobsahuje dvě čísla.

nebo

source obsahuje příliš mnoho oddělovačů.

Příklady

Následující příklad ukazuje, jak pomocí Parse metody převést String reprezentaci bodu na Point strukturu.

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

Platí pro