Tuesday, March 24, 2009

Code from today

Public Class Form1
Dim foodInfo(4) As String
'Cakes
'Bread
'Meat
'Seafood
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
foodInfo(0) = "Cakes at Publix are the highest quality!"
foodInfo(1) = "All the bread at Publix is fresh"
foodInfo(2) = "Publix meat is the best in the world"
foodInfo(3) = "Our seafood !! is caught freshly every day!"
If ComboBox1.Text = "Cakes" Then
'output info to lblInfo
lblInfo.Text = foodInfo(0)
ElseIf ComboBox1.Text = "Bread" Then
PictureBox1.ImageLocation = "http://upload.wikimedia.org/wikipedia/commons/1/1f/FD_1.jpg"
'PictureBox1.Visible = False
'PictureBox2.Visible = True
lblInfo.Text = foodInfo(1)
ElseIf ComboBox1.Text = "Meat" Then
lblInfo.Text = foodInfo(2)
ElseIf ComboBox1.Text = "Seafood" Then
lblInfo.Text = foodInfo(3)
End If
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
foodInfo(0) = "Cakes at Publix are the highest quality!"
foodInfo(1) = "All the bread at Publix is fresh"
foodInfo(2) = "Publix meat is the best in the world"
foodInfo(3) = "Our seafood !! is caught freshly every day!"
If txtProduct.Text = "Cake" Then
lblInfo.Text = foodInfo(0)
ElseIf txtProduct.Text = "Bread" Then
lblInfo.Text = foodInfo(1)
End If
End Sub
End Class

No comments: