Cursor Constructor (Type^, String^)
Initializes a new instance of the Cursor class from the specified resource with the specified resource type.
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
Parameters
- type
-
Type:
System::Type^
The resource Type.
- resource
-
Type:
System::String^
The name of the resource.
The following is an example of how to embed a cursor as a resource within your application. To embed the resource, reference the resource name followed by a comma, then its full assembly path. See the Example section to learn how to load the cursor from the embedded resource.
Using the C# compiler: csc /resource:"MyWaitCursor.cur","MyCursors.MyWaitCursor.cur" MyCursor.cs Using the Visual Basic compiler: vbc /resource:"MyWaitCursor.cur","MyCursors.MyWaitCursor.cur" MyCursor.vb
Note |
|---|
The resource reference when compiling as well as when referencing it in code, is case sensitive for both the C# and Visual Basic compilers. |
The following code example displays a form that demonstrates using a custom cursor by using the Cursor constructor. The custom Cursor is embedded in the application's resource file. The example requires that you have a cursor contained in a cursor file named MyCursor.cur. To compile this example using the command line, include the following flag: /res:MyCursor.Cur, CustomCursor.MyCursor.Cur
Available since 1.1
