This documentation is archived and is not being maintained.

Point.Parse Method

Constructs a Point from the specified String.

Namespace: System.Windows
Assembly: WindowsBase (in windowsbase.dll)

public static Point Parse (
	string source
)
public static Point Parse (
	String source
)
public static function Parse (
	source : String
) : Point
You cannot use methods in XAML.

Parameters

source

A string representation of a point.

Return Value

The equivalent Point structure.

Exception typeCondition

FormatException

source is not composed of two comma- or space-delimited double values.

InvalidOperationException

source does not contain two numbers.

-or-

source contains too many delimiters.

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;

}

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0
Show: