In a vb 6 form, I am trying to addopt following code to update ToolTipText content in MouseMove event. My list view control (lvWs) has 4 columns but wide-enough to show only two. The remaining two columns aren't very important nevertheless, I want user to see it when the mouse is moved on certain list item.
Following code is used to do, in a way, similar thing with a list box. Depending what item is right-clicked on, it opens a popup menu specific to that item.
Private Sub lstAllPagesWith_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)
Dim typPoint As POINTAPI, lngSel As Long, intTemp As Integer
If Button = vbRightButton Then
'typPoint.X = X \ Screen.TwipsPerPixelX
typPoint.y = y \ Screen.TwipsPerPixelY
Call ClientToScreen(lstAllPagesWith.hWnd, typPoint)
lngSel = LBItemFromPt(lstAllPagesWith.hWnd, typPoint.x, typPoint.y, False)
If lngSel > -1 Then
lstAllPagesWith.Selected(lngSel) = True
strFlag = Left(lstAllPagesWith.List(lngSel), 3)
Select Case strFlag
Call ShowPopup("Pag", y) ', True, True, True, False)
Call ShowPopup("Col", y) ', True, True, True, True)
Call ShowPopup("Row", y) ', True, True, False, False)
Now, I want to use this sample to code it for mouse move event such that it will detect what list item it is on. Then I suppose, it will easy to build a string of the first subItem plus last two to update ToolTipText property.
Any other solution that works also is fine with me.