Point.Parse(String) Metoda

Definice

Point Vytvoří ze 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é znázornění bodu.

Návraty

Point

Ekvivalentní Point struktura.

Výjimky

source není tvořena dvěma dvojitými hodnotami oddělenými čá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