|
-
Oct 18th, 2003, 12:54 PM
#1
tooltip for list items?
how can I set a tooltip for each item in a listbox control?
rate my posts if they help ya!
Extract thumbnail without reading the whole image file: (C# - VB)
Apply texture to bitmaps: (C# - VB)
Extended console library: (VB)
Save JPEG with a certain quality (image compression): (C# - VB )
VB.NET to C# conversion tips!!
-
Oct 18th, 2003, 02:46 PM
#2
I don't think so but you can change the one for the list dynamically with each item selected.
-
Oct 18th, 2003, 04:15 PM
#3
Originally posted by Edneeis
I don't think so but you can change the one for the list dynamically with each item selected.
hmm weirdness I thought it was easy
well I want to have it whenever the mouse hovers over an item. I guess I have to show the tooltip manually, kinda inefficient I guess
rate my posts if they help ya!
Extract thumbnail without reading the whole image file: (C# - VB)
Apply texture to bitmaps: (C# - VB)
Extended console library: (VB)
Save JPEG with a certain quality (image compression): (C# - VB )
VB.NET to C# conversion tips!!
-
Oct 19th, 2003, 05:06 PM
#4
Lively Member
I didn't think it was especially tricky... This is a bit more than you seem to be asking for (I pull my tip strings from a dataset for the app I cut this from) but the principle would be the same for whatever method you want to store your tip text:
VB Code:
Private Sub lvwItems_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) _
Handles lvwItems.SelectedIndexChanged
SetToolTip()
End Sub
Private Sub SetToolTip()
If lvwItems.SelectedItems.Count > 0 Then
'Go get whole record for selected item
Dim strTip As String
Dim objRow As DataRow = dsData.Tables("SomeTable").Rows.Find(lvwItems.SelectedItems(0).Text)
strTip = lvwItems.SelectedItems(0).Text
If objRow("Comment") <> "" Then
strTip += ControlChars.CrLf + "Comment: " + objRow("Comment")
End If
tipMain.SetToolTip(lvwItems, strTip)
End If
End Sub
I guess if you wanted to get more fancy you could set an event handler for MouseHover and see what's under the mouse? This was good enough for me though.
-
Oct 19th, 2003, 05:11 PM
#5
Lively Member
also since ToolTip.SetToolTip expects a control as an input, and ListViewItem is not a control, I don't believe you can set separate tooltips for each listview item, as Edneeis says you probably have to set it for each item you are looking at.
-
Oct 20th, 2003, 06:41 PM
#6
well I've seen it done in programs, so it can be done
I'm a lil busy... I have to find some free time and see if I can do it for each list item or not
thanks for the replies
rate my posts if they help ya!
Extract thumbnail without reading the whole image file: (C# - VB)
Apply texture to bitmaps: (C# - VB)
Extended console library: (VB)
Save JPEG with a certain quality (image compression): (C# - VB )
VB.NET to C# conversion tips!!
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
|