照你的意思,vb中试了一下:Public Class Form1    Private Sub Form1_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Me.MouseMove
        Dim p As Point = New Point(e.X, e.Y)        If New Rectangle(0, 0, 100, 100).Contains(p) Then
            Me.Cursor = Cursors.Cross
        ElseIf New Rectangle(100, 0, 100, 100).Contains(p) Then
            Me.Cursor = Cursors.Hand
        ElseIf New Rectangle(0, 100, 100, 100).Contains(p) Then
            Me.Cursor = Cursors.VSplit
        ElseIf New Rectangle(100, 100, 100, 100).Contains(p) Then
            Me.Cursor = Cursors.UpArrow
        Else
            Me.Cursor = Cursors.Default
        End If
    End Sub    Private Sub Form1_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles Me.Paint
        Dim g As Graphics = e.Graphics        g.FillRectangle(Brushes.Blue, 0, 0, 100, 100)
        g.FillRectangle(Brushes.Red, 100, 0, 100, 100)
        g.FillRectangle(Brushes.Yellow, 0, 100, 100, 100)
        g.FillRectangle(Brushes.Green, 100, 100, 100, 100)
    End Sub
End Class没有问题,可以正常显示四个不同填充色的矩形框,并且鼠标移动到每个矩形框显示不同的光标。

解决方案 »

  1.   

    把你的exe文件拷贝到另外一台电脑上试试看吧,判断一下是不是你的运行环境的问题。呵呵
      

  2.   

    没有事件,拿来丢失.
    还是按照wzuomin的方法检查一下先
      

  3.   

    依据下面代码把windows自动生成的代码修改一下吧:private void InitializeComponent()
    {
    this.SuspendLayout();
    //
    // Form1
    //
    this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
    this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
    this.ClientSize = new System.Drawing.Size(292, 273);
    this.Name = "Form1";
    this.Text = "Form1";
    this.Paint += new System.Windows.Forms.PaintEventHandler(this.Form1_Paint);
    this.MouseMove += new System.Windows.Forms.MouseEventHandler(this.Form1_MouseMove);
    this.Load += new System.EventHandler(this.Form1_Load);
    this.ResumeLayout(false);}
      

  4.   

    wzuomin确实是高手!!佩服!!怎么给你分数?