Click here to Skip to main content
15,889,116 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all

I am showing some images as items now please tell me how to open particular form based on the item clicked in that list box.

Thank you
Posted

 
Share this answer
 
Comments
kahan 8-Mar-13 7:07am    
<iframe src = " ">
kahan 8-Mar-13 7:08am    
<iframe src = " ">
josh-jw 8-Mar-13 7:14am    
Creates a new Dialog and DialogViewModel
Binds the DialogViewModel.EditableContentProperty to the ListBox's SelectedItem
Dialog.DataContext = DialogViewModel
Dialog.ShowDialog()
Menon Santosh 8-Mar-13 8:32am    
you can find basic wpf solution here http://rachel53461.wordpress.com/
This can also be done simple.

You can use either If Else or Switch case method..
You can do on "button click" event...


Place a Listbox1 and Button1 controls on Form1.vb[Design]
and type the following code in Form1.vb



VB
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        If (ListBox1.SelectedIndex = 0) Then
            Form2.Show()
        ElseIf (ListBox1.SelectedIndex = 1) Then
            Form3.Show()
        End If
    End Sub
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900