Represents the image used to paint the mouse pointer.
public class Cursor: Object, IDisposable
ObjectCursor
// This sample show how to create a new Cursor, it also displays some properties of the cursor.
using System;
using System.Drawing;
using System.Windows.Forms;
using System.Diagnostics;
public class Form1 : System.Windows.Forms.Form
{
private System.Windows.Forms.Button button;
static void Main()
{
Application.Run(new Form1());
}
public Form1()
{
this.button
= new System.Windows.Forms.Button();this.button.Location = new System.Drawing.Point(8,8);
this.button.Size = new System.Drawing.Size(100,50);
// Creates a new cursor for the button.
Cursor my_cursor = Cursors.No;
this.button.Cursor= my_cursor;
// Displays some properties of the cursor.
Debug.WriteLine("Properties of the cursor:");
Debug.WriteLine("\tHotspot:" +my_cursor.HotSpot);
Debug.WriteLine("\tHandle:" +my_cursor.Handle);
Debug.WriteLine("\tTag:" +my_cursor.Tag);
this.Controls.Add(this.button);
}
// The cursor which will be used on the form.
protected override void OnMouseEnter(EventArgs e)
{
Debug.WriteLine("Enter the form");
this.Cursor = Cursors.Hand;
Debug.WriteLine("Position:" +Cursor.Position);
}
protected override void OnMouseLeave(EventArgs e)
{
Debug.WriteLine("Leave the form");
this.Cursor = Cursors.Default;
}
}
Namespace System.Windows.Forms Flash Library System.Windows.Forms.scl Flash Library Version 2.0.0.2118 Silverlight Library System.Windows.Forms.dll
| © 2003-2007 NETiKA Technologies. All rights reserved. |