Results 1 to 4 of 4

Thread: Screen.MousePointer in VB.NET

  1. #1

    Thread Starter
    New Member
    Join Date
    May 2003
    Posts
    7

    Screen.MousePointer in VB.NET

    Hi,

    I'm kind of new to VB.NET and am trying to do something like the old Screen.MousePointer = vbHourglass.

    I found something on the help, saying that I have to use System.Drawing.Cursor.Current, but when I put that into my code, I get an error, saying that does not exist. What's wrong here? Do I have to include something in my code in order to ues that?

    Help, please.

    Thanks,

    David

  2. #2
    Fanatic Member
    Join Date
    Sep 2002
    Posts
    518
    It's easier than you think, it's just

    Me.Cursor = Cursors.WaitCursor

  3. #3

    Thread Starter
    New Member
    Join Date
    May 2003
    Posts
    7
    The problem is that the code is inside a class, not a form.

    Thanks,

    David

  4. #4
    Fanatic Member
    Join Date
    Sep 2002
    Posts
    518
    Not sure if this is what you're looking for, but here's some MS sample code that sets cursor inside a class:

    Code:
        Protected Overrides Sub OnDragEnter(ByVal drgevent As DragEventArgs)
            ' The user is allowed to drag and drop member nodes only.  If the user
            ' attempts to drag something else, display a Not-Allowed mouse cursor.
    
            Dim obj As Object = drgevent.Data.GetData("XMLDocumentationTool.MemberNode", False)
            If obj Is Nothing Then
                drgevent.Effect = DragDropEffects.None
            Else
                drgevent.Effect = DragDropEffects.Copy
            End If
            MyBase.OnDragEnter(drgevent)
        End Sub
    Attached Files Attached Files

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width