Cursor Constructors
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Initializes a new instance of the Cursor class.
Overloads
Cursor(Stream) |
Initializes a new instance of the Cursor class from the specified Stream. |
Cursor(String) |
Initializes a new instance of the Cursor class from the specified .ani or a .cur file. |
Cursor(Stream, Boolean) |
Initializes a new instance of the Cursor class. |
Cursor(String, Boolean) |
Initializes a new instance of the Cursor class. |
Cursor(Stream)
public:
Cursor(System::IO::Stream ^ cursorStream);
public Cursor (System.IO.Stream cursorStream);
new System.Windows.Input.Cursor : System.IO.Stream -> System.Windows.Input.Cursor
Public Sub New (cursorStream As Stream)
Parameters
Exceptions
cursorStream
is null
.
This constructor was unable to create a temporary file.
Remarks
For a Stream, WPF writes the data to a temporary file and then loads the Cursor from the file. If this constructor is unable to create a temporary file, an IOException might be thrown. For example, an IOException might be thrown if a unique temporary file is not available. To resolve this error, try deleting unneeded temporary files.
See also
Applies to
Cursor(String)
Initializes a new instance of the Cursor class from the specified .ani or a .cur file.
public:
Cursor(System::String ^ cursorFile);
public Cursor (string cursorFile);
new System.Windows.Input.Cursor : string -> System.Windows.Input.Cursor
Public Sub New (cursorFile As String)
Parameters
- cursorFile
- String
The file that contains the cursor.
Exceptions
cursorFile
is null
.
cursorFile
is not an .ani or .cur file name.
See also
Applies to
Cursor(Stream, Boolean)
Initializes a new instance of the Cursor class.
public:
Cursor(System::IO::Stream ^ cursorStream, bool scaleWithDpi);
public Cursor (System.IO.Stream cursorStream, bool scaleWithDpi);
new System.Windows.Input.Cursor : System.IO.Stream * bool -> System.Windows.Input.Cursor
Public Sub New (cursorStream As Stream, scaleWithDpi As Boolean)
Parameters
- scaleWithDpi
- Boolean
true
if to scale with dpi; otherwise, false
.
Applies to
Cursor(String, Boolean)
Initializes a new instance of the Cursor class.
public:
Cursor(System::String ^ cursorFile, bool scaleWithDpi);
public Cursor (string cursorFile, bool scaleWithDpi);
new System.Windows.Input.Cursor : string * bool -> System.Windows.Input.Cursor
Public Sub New (cursorFile As String, scaleWithDpi As Boolean)
Parameters
- scaleWithDpi
- Boolean
true
if to scale with dpi; otherwise, false
.