文章收藏-FAQ 位置:电脑学习网

改动鼠标形状的一小段代码

    主要还是调用了系统的方法,因为实在做鼠标时间是开发的,想了好久才找到,留在这里,以作纪念。

 public class Grid : GoldSoft.Inf.UI.Controls.Grid.Grid
 {
  /// 〈summary〉
  /// 必需的设计器变量。
  /// 〈/summary〉
  private System.ComponentModel.Container components = null;

  public Grid()
  {
   // 该调用是 Windows.Forms 窗体设计器所必需的。
   InitializeComponent();
   // TODO: 在 InitComponent 调用后添加任何初始化
         this.MouseMove += new MouseEventHandler(n_MouseMove);
  }
  private void n_MouseMove(object sender, System.Windows.Forms.MouseEventArgs e)
  {
         this.Cursor=Cursors.SizeWE;

     //以上用来修改鼠标的形状,在Cursors加.就可以看到了
         Console.WriteLine(“====〉   Test  〈====  (“+e.X+“,“+e.Y+“)“);
  }
  /// 〈summary〉
  /// 清理所有正在使用的资源。
  /// 〈/summary〉
  protected override void Dispose( bool disposing )
  {
   if( disposing )
   {
    if( components != null )
     components.Dispose();
   }
   base.Dispose( disposing );
  }

  #region 组件设计器生成的代码
  /// 〈summary〉
  /// 设计器支持所需的方法 - 不要使用代码编辑器
  /// 修改此方法的内容。
  /// 〈/summary〉
  private void InitializeComponent()
  {
   components = new System.ComponentModel.Container();
  }
  #endregion

 }

     [文章来源:“十万个为什么”电脑学习网]
     [网络地址:http://why100000.com]
     [版权声明:除本站部分特别声明禁止转载的专稿外,其他的文章可以自由转载,但请务必注明出处和原始作者。本站文章版权归文章原作者所有。如果本站转载的文章有版权问题请联系本站,我们会尽快予以更正。]
 

【字体:[大] [中] [小] 【加入收藏】 【发表评论】 【关闭本窗口】

Copyright © “十万个为什么”电脑学习网 2000-2007 陕ICP备06007929号
站务联系:MSN & Email:zhangking2008@gmail.com  QQ:9365822