Hi...
well i am creating a sales analysis program...
The form is as follows
so..here the user is allowed a to select a product and enter a price . When the price is entered and Priche change button is clicked the price get stored in an array
which is later recalled for calculation purpose.
What i am suck is ....i want to validate the price ...so that when the user enters a invalid character to the price a error message pops up
I tried using tryparse ...the error messaged poped up ..but when the user entered a valid price it didnt get transfered to the array
My code is as follows
intMediaPrice () is the array
Private Sub btnPrice_Click(sender As System.Object, e As System.EventArgs) Handles btnPrice.Click
If cbMedia.Text = "8-Track" Then
intMediaPrice(0) = txtPrice.Text
frmSalesData.DisplayData()
ElseIf cbMedia.Text = "Cassette" Then
intMediaPrice(1) = txtPrice.Text
frmSalesData.DisplayData()
ElseIf cbMedia.Text = "CD" Then
intMediaPrice(2) = txtPrice.Text
frmSalesData.DisplayData()
ElseIf cbMedia.Text = "Bluray" Then
intMediaPrice(3) = txtPrice.Text
frmSalesData.DisplayData()
ElseIf cbMedia.Text = "Flash" Then
intMediaPrice(4) = txtPrice.Text
frmSalesData.DisplayData()
End If
End Sub
Function picBox()
PictureBox1.Visible = False
PictureBox2.Visible = False
PictureBox3.Visible = False
PictureBox4.Visible = False
PictureBox5.Visible = False
PictureBox6.Visible = False
End Function
Private Sub cbMedia_SelectedIndexChanged(sender As System.Object, e As System.EventArgs) Handles cbMedia.SelectedIndexChanged
If cbMedia.Text = "8-Track" Then
picBox()
PictureBox1.Visible = True
ElseIf cbMedia.Text = "Cassette" Then
picBox()
PictureBox2.Visible = True
ElseIf cbMedia.Text = "CD" Then
picBox()
PictureBox3.Visible = True
ElseIf cbMedia.Text = "Bluray" Then
picBox()
PictureBox4.Visible = True
ElseIf cbMedia.Text = "Flash" Then
picBox()
PictureBox5.Visible = True
End If
End Sub
End Class
any help is appreciated
thank you
well i am creating a sales analysis program...
The form is as follows
so..here the user is allowed a to select a product and enter a price . When the price is entered and Priche change button is clicked the price get stored in an array
which is later recalled for calculation purpose.
What i am suck is ....i want to validate the price ...so that when the user enters a invalid character to the price a error message pops up
I tried using tryparse ...the error messaged poped up ..but when the user entered a valid price it didnt get transfered to the array
My code is as follows
intMediaPrice () is the array
Private Sub btnPrice_Click(sender As System.Object, e As System.EventArgs) Handles btnPrice.Click
If cbMedia.Text = "8-Track" Then
intMediaPrice(0) = txtPrice.Text
frmSalesData.DisplayData()
ElseIf cbMedia.Text = "Cassette" Then
intMediaPrice(1) = txtPrice.Text
frmSalesData.DisplayData()
ElseIf cbMedia.Text = "CD" Then
intMediaPrice(2) = txtPrice.Text
frmSalesData.DisplayData()
ElseIf cbMedia.Text = "Bluray" Then
intMediaPrice(3) = txtPrice.Text
frmSalesData.DisplayData()
ElseIf cbMedia.Text = "Flash" Then
intMediaPrice(4) = txtPrice.Text
frmSalesData.DisplayData()
End If
End Sub
Function picBox()
PictureBox1.Visible = False
PictureBox2.Visible = False
PictureBox3.Visible = False
PictureBox4.Visible = False
PictureBox5.Visible = False
PictureBox6.Visible = False
End Function
Private Sub cbMedia_SelectedIndexChanged(sender As System.Object, e As System.EventArgs) Handles cbMedia.SelectedIndexChanged
If cbMedia.Text = "8-Track" Then
picBox()
PictureBox1.Visible = True
ElseIf cbMedia.Text = "Cassette" Then
picBox()
PictureBox2.Visible = True
ElseIf cbMedia.Text = "CD" Then
picBox()
PictureBox3.Visible = True
ElseIf cbMedia.Text = "Bluray" Then
picBox()
PictureBox4.Visible = True
ElseIf cbMedia.Text = "Flash" Then
picBox()
PictureBox5.Visible = True
End If
End Sub
End Class
any help is appreciated
thank you