Selected listbox item?

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.
4 posts Page 1 of 1
Contributors
User avatar
zachman61
VIP - Donator
VIP - Donator
Posts: 1892
Joined: Wed Dec 16, 2009 9:56 pm

Selected listbox item?
zachman61
im making a office theme changer for my program but im making it simpler but how do i make it so when a certain item is selected and you hit the button then it shows a current theme ?
Nailing my feet to the floor is easier than using my own muscles to balance, but you don't see me doing that :)
NoWayIn
VIP - Donator
VIP - Donator
Posts: 444
Joined: Sat Nov 21, 2009 11:16 pm

Re: Selected listbox item?
NoWayIn
Hello Zach, to use the selected item in the listbox you can do something like this :
Code: Select all
Try
            MsgBox(ListBox1.SelectedItem.ToString)
        Catch ex As Exception
            MsgBox(ex.Message)
        End Try
what that will do is it will give you a MsgBox saying the selected item.
you could change "MsgBox(ListBox1.SelectedItem.ToString)" so it would change your theme.
User avatar
Agust1337
Coding God
Coding God
Posts: 2456
Joined: Fri Feb 19, 2010 8:18 pm

Re: Selected listbox item?
Agust1337
Code: Select all
 If ListBox1.Text = "Office Theme" Then
            'office theme is used
        End If
Top-notch casual Dating
User avatar
zachman61
VIP - Donator
VIP - Donator
Posts: 1892
Joined: Wed Dec 16, 2009 9:56 pm

Re: Selected listbox item?
zachman61
thanks both of them worked :)
Nailing my feet to the floor is easier than using my own muscles to balance, but you don't see me doing that :)
4 posts Page 1 of 1
Return to “Tutorial Requests”