Point.Parse(String) Point.Parse(String) Point.Parse(String) Point.Parse(String) Method

定义

从指定的 Point 构造 StringConstructs a Point from the specified 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 String String String

点的字符串表示形式。A string representation of a point.

返回

等效的 Point 结构。The equivalent Point structure.

异常

source 不是由两个逗号分隔或空格分隔的双精度值组成。source is not composed of two comma- or space-delimited double values.

source 不包含两个数字。source does not contain two numbers.

- 或 --or- source 包含的分隔符过多。source contains too many delimiters.

示例

下面的示例演示如何使用Parse方法String将某个点Point的表示形式转换为结构。The following example shows how to use the Parse method to convert a String representation of a point into a Point structure.

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

适用于