本文整理汇总了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);
}
}