News:

GinGly.com - Used by 85,000 Members - SMS Backed up 7,35,000 - Contacts Stored  28,850 !!

Main Menu

ListBox item under the mouse

Started by nandagopal, May 20, 2009, 07:15 PM

Previous topic - Next topic

nandagopal

Use GetCursorPos to get the mouse position. Use LBItemFromPt to get the item at that position.


Private Sub Form_MouseMove(Button As Integer, Shift As _
    Integer, X As Single, Y As Single)
    'should provide list autodragging
    Dim ret, cp As POINTAPI
    GetCursorPos cp
    ret = LBItemFromPt(List1.hwnd, cp.X, cp.Y, True)
    Form1.Caption = ret & ":" & X & ":" & Y
    List1.ListIndex = ret
End Sub

Private Sub List1_MouseMove(Button As Integer, Shift As _
    Integer, X As Single, Y As Single)
    Dim ret, cp As POINTAPI
    GetCursorPos cp
    ret = LBItemFromPt(List1.hwnd, cp.X, cp.Y, True)
    Form1.Caption = ret & ":" & X & ":" & Y
    List1.ListIndex = ret
End Sub



dhoni

yes its really easy to listbox should item under the mouse
it can easilyuse in vb.net
it mainily use for many program

Quick Reply

Warning: this topic has not been posted in for at least 120 days.
Unless you're sure you want to reply, please consider starting a new topic.

Note: this post will not display until it has been approved by a moderator.

Name:
Email:
Verification:
Please leave this box empty:
Type the letters shown in the picture
Listen to the letters / Request another image

Type the letters shown in the picture:

Shortcuts: ALT+S post or ALT+P preview