|
-
Dec 2nd, 2003, 01:12 AM
#1
Thread Starter
Hyperactive Member
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.
-
Dec 2nd, 2003, 01:20 AM
#2
-= B u g S l a y e r =-
VB Code:
Option Explicit
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
Private Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long
Private Type POINTAPI
X As Long
Y As Long
End Type
Private Sub List1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
Dim nPos As Integer
Dim PtAPI As POINTAPI
If Button = 2 Then
GetCursorPos PtAPI
List1.Selected(LBItemFromPt(List1.hWnd, PtAPI.X, PtAPI.Y, 0)) = True
End If
End Sub
-
Dec 2nd, 2003, 01:23 AM
#3
Too quick there peet (G'Day too!)
Bruce.
-
Dec 2nd, 2003, 01:25 AM
#4
Thread Starter
Hyperactive Member
-
Dec 2nd, 2003, 01:30 AM
#5
-
Dec 2nd, 2003, 01:32 AM
#6
Where's the cheerleader??
-
Dec 2nd, 2003, 01:35 AM
#7
-
Dec 2nd, 2003, 01:39 AM
#8
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|