Using tooltips and listboxes

Do you need something made? then ask in here.
Forum rules
Please LOCK your topics once you have found the solution to your question so we know you no longer require help with your query.
8 posts Page 1 of 1
Contributors
GoodGuy17
Coding God
Coding God
Posts: 1610
Joined: Mon Sep 07, 2009 12:25 am

Using tooltips and listboxes
GoodGuy17
Hello,
I am using a listbox control, and I want the user to see the name of the song when the mouse is hovered over an item. In the listbox, it has the full directory for ease of playing the music on click event. Can somebody either tell me how to show the name of the song in a run-time-made tooltip or tell me how I could use the Listview to show the name and directory. Note with the listview I would need to know how to make Player.URL = Listview1.SelectedItem work.
Thanks.
~GoodGuy17 :D
GoodGuy17
Coding God
Coding God
Posts: 1610
Joined: Mon Sep 07, 2009 12:25 am

Re: Using tooltips and listboxes
GoodGuy17
BUMP.
User avatar
Codex
Coding God
Coding God
Posts: 2028
Joined: Wed Mar 31, 2010 5:50 pm

Re: Using tooltips and listboxes
Codex
i dont get what you mean. so i cant help you unless you explain.
We shall let the revolution begin.. the revolution for freedom, freedom against censorship. We shall fight in the fields and in the streets, we shall fight in the hills; we shall never surrender
GoodGuy17
Coding God
Coding God
Posts: 1610
Joined: Mon Sep 07, 2009 12:25 am

Re: Using tooltips and listboxes
GoodGuy17
I am using a listbox.
Everytime I click Add Song, I navigate to a song, and add it to the listbox.
I want to see the name of the song, instead of the file location, when I hover the mouse over the location. If you can't do that, I could use a ListView and put the name under a column.
User avatar
Codex
Coding God
Coding God
Posts: 2028
Joined: Wed Mar 31, 2010 5:50 pm

Re: Using tooltips and listboxes
Codex
Ok, now for the part where u take the name, u could use : listbox.items.add(OpenFileDialog1.SafeFileNames)
We shall let the revolution begin.. the revolution for freedom, freedom against censorship. We shall fight in the fields and in the streets, we shall fight in the hills; we shall never surrender
GoodGuy17
Coding God
Coding God
Posts: 1610
Joined: Mon Sep 07, 2009 12:25 am

Re: Using tooltips and listboxes
GoodGuy17
No I need the name of the song. Like If I get C:\BLABLABLA\Song.wav I want Song.wav to show up in a tooltip.
User avatar
mandai
Coding God
Coding God
Posts: 2585
Joined: Mon Apr 26, 2010 6:51 pm

Re: Using tooltips and listboxes
mandai
Code: Select all
    Private Sub ListBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ListBox1.SelectedIndexChanged
        ToolTip1.RemoveAll()
        ToolTip1.SetToolTip(ListBox1, Path.GetFileName(ListBox1.SelectedItem.ToString()))
    End Sub
GoodGuy17
Coding God
Coding God
Posts: 1610
Joined: Mon Sep 07, 2009 12:25 am

Re: Using tooltips and listboxes
GoodGuy17
Thanks mandai.
Later in other help, can you tell people what to import because if someone was new to vb and you gave them a code like this they would come back saying it doesnt work since they didnt import System.IO
8 posts Page 1 of 1
Return to “Tutorial Requests”