Point.Parse(String) 方法

定义

Point构造从指定的 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

参数

source
String

点的字符串表示形式。

返回

等效 Point 的结构。

例外

source 不由两个逗号或空格分隔的双精度值组成。

source 不包含两个数字。

-或-

source 包含过多的分隔符。

示例

下面的示例演示如何使用Parse该方法将点的表示形式转换为StringPoint结构。

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

适用于