Results 1 to 8 of 8

Thread: Simulating Hot Tracking in a List Box [resolved]

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Oct 2000
    Location
    Sydney Australia
    Posts
    476

    Simulating Hot Tracking in a List Box [resolved]

    Hi team, does anyone know how to simulate hot tracking in a list box.

    My list box responds to a right click, but the right click does not select the list item that was right clicked. The ListIndex property remains set the list item that was last left clicked.

    Basically, I need to ensure the list boex's ListIndex is set to the list item that was right clicked.

    I thought hot tracking would solve the problem. Any other ideas how to solve this?

    Thanks

    FW
    Last edited by freewilly; Dec 2nd, 2003 at 01:26 AM.

  2. #2
    -= B u g S l a y e r =- peet's Avatar
    Join Date
    Aug 2000
    Posts
    9,629
    VB Code:
    1. Option Explicit
    2. Private Declare Function LBItemFromPt Lib "comctl32.dll" (ByVal hLB As Long, ByVal ptx As Integer, ByVal pty As Integer, ByVal bAutoScroll As Long) As Long
    3. Private Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long
    4. Private Type POINTAPI
    5.     X As Long
    6.     Y As Long
    7. End Type
    8.  
    9. Private Sub List1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
    10.     Dim nPos As Integer
    11.     Dim PtAPI As POINTAPI
    12.  
    13.     If Button = 2 Then
    14.         GetCursorPos PtAPI
    15.         List1.Selected(LBItemFromPt(List1.hWnd, PtAPI.X, PtAPI.Y, 0)) = True
    16.     End If
    17. End Sub
    -= a peet post =-

  3. #3
    INXSIVE Bruce Fox's Avatar
    Join Date
    Sep 2001
    Location
    Melbourne, Australia
    Posts
    7,429
    Too quick there peet (G'Day too!)



    Bruce.

  4. #4

    Thread Starter
    Hyperactive Member
    Join Date
    Oct 2000
    Location
    Sydney Australia
    Posts
    476
    Thanks guys

  5. #5
    -= B u g S l a y e r =- peet's Avatar
    Join Date
    Aug 2000
    Posts
    9,629
    your welcome

    morning bruce
    -= a peet post =-

  6. #6
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170
    Where's the cheerleader??

  7. #7
    -= B u g S l a y e r =- peet's Avatar
    Join Date
    Aug 2000
    Posts
    9,629


    morning frog
    -= a peet post =-

  8. #8
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170
    Afternoon and sands.

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