Results 1 to 6 of 6

Thread: ListView Cursor

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Aug 2002
    Posts
    224

    ListView Cursor

    Hi,

    I am using Visual Basic 2005 Express Edition

    I set in the properties of the ListView the Cursor to Hand.

    When the cursor is in the Columns the cursor is not change to Hand.

    My question is: If it's possible to change the cursor to Hand?

    What i mean is that the Column Header,
    The place that you write the caption.

    Thanks in advance
    Last edited by yulyos; Apr 13th, 2007 at 01:38 AM.

  2. #2
    Fanatic Member
    Join Date
    Nov 2006
    Posts
    675

    Re: ListView Cursor

    Try setting the cursor when you enter and exit the listview.
    Private Sub ListView_MouseEnter(ByVal sender As Object, ByVal e As System.EventArgs) Handles ListView.MouseEnter
    Me.Cursor = Windows.Forms.Cursors.Hand
    End Sub

    Private Sub ListView_MouseLeave(ByVal sender As Object, ByVal e As System.EventArgs) Handles ListView.MouseLeave
    Me.Cursor = Windows.Forms.Cursors.Default
    End Sub
    VB.Net 2008
    .Net Framework 2.0

    "Must you breathe? 'Cause I need heaven..."

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Aug 2002
    Posts
    224

    Re: ListView Cursor

    Hi,

    Tannks for your reply

    What i mean is that the Column Header,
    The place that you write the caption.

    It's not change.

  4. #4
    Fanatic Member
    Join Date
    Nov 2006
    Posts
    675

    Re: ListView Cursor

    Well, maybe you could use the MouseMove event. That should give you the coordinates of the mouse relative to the listview. Then you just have to know the height of the Column Headers.
    Private Sub ListView_MouseMove(ByVal sender As Object, ByVal e As System.EventArgs) Handles ListView.MouseMove
    if e.Y < 10 'Or whatever the height of the header is
    Me.Cursor = Windows.Forms.Cursors.Hand
    else
    Me.Cursor = Windows.Forms.Cursors.Default
    end if
    End Sub
    Just adjust that 10 to whatever it needs to be. I would guess it actually need to be 17.
    VB.Net 2008
    .Net Framework 2.0

    "Must you breathe? 'Cause I need heaven..."

  5. #5

    Thread Starter
    Addicted Member
    Join Date
    Aug 2002
    Posts
    224

    Re: ListView Cursor

    Hi,

    It's not working.

  6. #6

    Thread Starter
    Addicted Member
    Join Date
    Aug 2002
    Posts
    224

    Re: ListView Cursor

    Hi,

    Who that interested in the solution:
    http://www.vbcity.com/forums/goto.as...ply&rid=467833

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