2. Enter the program code below by double clicking the form object.
Public Class frmMenuSelector
Private Sub frmMenuSelector_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
lstDrinks.Items.Add("Juice")
lstDrinks.Items.Add("Coffee")
lstDrinks.Items.Add("Softdrinks")
cboDessert.Items.Add("Ice Cream")
cboDessert.Items.Add("Salad")
cboDessert.Items.Add("Pastry")
End Sub
Private Sub cboDessert_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles cboDessert.Click
Select Case cboDessert.SelectedIndex
Case 0
picDessert.Image = My.Resources.Ice_cream
Case 1
picDessert.Image = My.Resources.Salad
Case 2
picDessert.Image = My.Resources.Pastry
End Select
End Sub
Private Sub chkBurger_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles chkBurger.Click
If chkBurger.Checked Then
picBurger.Image = My.Resources.Burger
picBurger.Visible = True
Else
picBurger.Visible = False
End If
End Sub
Private Sub chkCake_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles chkCake.Click
If chkCake.Checked Then
picCake.Image = My.Resources.Cake
picCake.Visible = True
Else
picCake.Visible = False
End If
End Sub
Private Sub chkPizza_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles chkPizza.Click
If chkPizza.Checked Then
picPizza.Image = My.Resources.Pizza
picPizza.Visible = True
Else
picPizza.Visible = False
End If
End Sub
Private Sub lstDrinks_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles lstDrinks.Click
Select Case lstDrinks.SelectedIndex
Case 0
picDrinks.Image = My.Resources.Juice
Case 1
picDrinks.Image = My.Resources.Coffee
Case 2
picDrinks.Image = My.Resources.Softdrinks
End Select
End Sub
Private Sub rdoChicken_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles rdoChicken.Click
If rdoChicken.Checked Then
picMeal.Image = My.Resources.Chicken
picMeal.Visible = True
Else
picMeal.Visible = False
End If
End Sub
Private Sub rdoFish_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles rdoFish.Click
If rdoFish.Checked Then
picMeal.Image = My.Resources.Fish
picMeal.Visible = True
Else
picMeal.Visible = False
End If
End Sub
Private Sub rdoPork_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles rdoPork.Click
If rdoPork.Checked Then
picMeal.Image = My.Resources.Pork
picMeal.Visible = True
Else
picMeal.Visible = False
End If
End Sub
End Class
3. Save and run your program. The program looks like below.
~You can use the photos below.....
![](http://3.bp.blogspot.com/-VSlb8FqKxdg/TuqjY-qzALI/AAAAAAAAAIc/nbM5kidzgRk/s320/Softdrinks.jpeg)
![](http://1.bp.blogspot.com/-sxJdUlPt1YU/TuqjRwE1NqI/AAAAAAAAAIQ/f95ec6RHOCo/s320/Salad.jpeg)
![](http://3.bp.blogspot.com/-kaOH-n7qFLk/TuqjOYsd7TI/AAAAAAAAAIE/k3DE5kQbKwk/s320/Pork.jpeg)
![](http://3.bp.blogspot.com/-pYtfT293Png/TuqjKaB5c5I/AAAAAAAAAH4/lOt5Q32KhUM/s320/Pizza.jpeg)
![](http://4.bp.blogspot.com/-casvStDnB9o/TuqjFWui3zI/AAAAAAAAAHs/v6mGLa2ak-o/s320/Juice.jpeg)
![](http://1.bp.blogspot.com/-H4bvjMxNLm4/TuqjBFNoLkI/AAAAAAAAAHg/_rgS6sCzJCo/s320/Ice%2Bcream.jpeg)
![](http://2.bp.blogspot.com/-7WhNiPMSwP4/Tuqi8ionbfI/AAAAAAAAAHU/qGIEubt3zPk/s320/Fish.jpeg)
![](http://2.bp.blogspot.com/-njA2JDHzzD8/Tuqi4N8VuaI/AAAAAAAAAHI/cWBL0ZC_Yew/s320/Coffee.jpeg)
![](http://4.bp.blogspot.com/-MRR2yrWMtS4/Tuqi0twd-eI/AAAAAAAAAG8/rU_h813aLsc/s320/Chicken.jpeg)
![](http://2.bp.blogspot.com/-_Nd9_87N7pY/TuqiyEjR8PI/AAAAAAAAAGw/Est65ZkC2Is/s320/Cake.jpeg)
![](http://2.bp.blogspot.com/-14K1BsalJbI/Tuqip9f2phI/AAAAAAAAAGk/pi54_AFkdW8/s320/Burger.jpeg)
No comments:
Post a Comment