|
-
Aug 22nd, 2005, 09:25 AM
#1
[RESOLVED] tooltip problem
Ok, wondering if anyone can shed some light on this one for me.
I have a listview (details view) that when you right click on a listviewitem, a tooltip pops up with some additional information. Here is the code I use
VB Code:
Private Sub lvwListing_MouseDown(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles lvwListing.MouseDown
If optTerrName.Checked Then
Dim LVI As ListViewItem = lvwListing.GetItemAt(e.X, e.Y)
If LVI Is Nothing Then Return
If e.Button = MouseButtons.Right Then
tipTerr.SetToolTip(lvwListing, LVI.Tag.ToString)
tipTerr.Active = True
End If
End If
End Sub
Now the problem is that the first time a user right clicks an item, the tooltip is not shown. If they right click on an item, and then right click it again, it does work. Also any right clicks after that also work fine, its just the first one. I assue it has something to do with focus or something, but what is odd is when I put a break point, on the first click all the code runs, including the settooltip and active = true parts, so I don't know why the tip does not display. Any ideas? I have already tried various things like manually calling the focus event of the listview at the start of the above routine, also setting the selected and focused properties to true for the listviewitem prior to the tip display. Also I tried setting the ShowAlways property of the tooltip to true. None change the way its working.
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
|