本文整理匯總了C#中System.Windows.Forms.Cursors.Hand屬性的典型用法代碼示例。如果您正苦於以下問題:C# Cursors.Hand屬性的具體用法?C# Cursors.Hand怎麽用?C# Cursors.Hand使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類System.Windows.Forms.Cursors
的用法示例。
在下文中一共展示了Cursors.Hand屬性的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: OnMouseHover
public class FunButton:
Button
{
protected override void OnMouseHover(System.EventArgs e)
{
// Get the font size in Points, add one to the
// size, and reset the button's font to the larger
// size.
float fontSize = Font.SizeInPoints;
fontSize += 1;
System.Drawing.Size buttonSize = Size;
this.Font = new System.Drawing.Font(
Font.FontFamily, fontSize, Font.Style);
// Increase the size width and height of the button
// by 5 points each.
Size = new System.Drawing.Size(Size.Width+5, Size.Height+5);
// Call myBase.OnMouseHover to activate the delegate.
base.OnMouseHover(e);
}
protected override void OnMouseMove(MouseEventArgs e)
{
// Make the cursor the Hand cursor when the mouse moves
// over the button.
Cursor = Cursors.Hand;
// Call MyBase.OnMouseMove to activate the delegate.
base.OnMouseMove(e);
}
示例2: Main
//引入命名空間
using System.Drawing;
using System.Windows.Forms;
class FormProperties
{
public static void Main()
{
Form form = new Form();
form.Text = "Form Properties";
form.Cursor = Cursors.Hand;
Application.Run(form);
}
}