What's wrong with my code visual basic 2010?
I wrote this code and i'm trying to make it say "Please CHOOSE A CELL PHONE!" if you do not click on one of the radiobuttons this is what i wrote:
Public Class Form2
Dim price As Double
Private Sub RadioButton1_CheckedChanged(ByVal sender As System. Object, ByVal e As System. EventArgs) Handles RadioButton1. CheckedChanged
If RadioButton1. Checked = True Then
PictureBox1.Image = System. Drawing.Image.FromFile("C:\Users\… One.png")
price = 299
ElseIf RadioButton2. Checked = True Then
PictureBox1.Image = System. Drawing.Image.FromFile("C:\Users\… Galaxy 4.jpg")
price = 349
End If
End Sub
Private Sub RadioButton3_CheckedChanged(ByVal sender As System. Object, ByVal e As System. EventArgs) Handles RadioButton3. CheckedChanged
If RadioButton3. Checked = True Then
PictureBox1.Image = System. Drawing.Image.FromFile("C:\Users\… 5.jpg")
price = 500
ElseIf RadioButton4. Checked = True Then
PictureBox1.Image = System. Drawing.Image.FromFile("C:\Users\… Venice.jpg")
price = 219
End If
End Sub
Private Sub Button2_Click(ByVal sender As System. Object, ByVal e As System. EventArgs) Handles Button2. Click
If RadioButton1. Checked = False Then
MessageBox.Show("Please choose a cell phone!")
ElseIf RadioButton2. Checked = False Then
MessageBox.Show("Please choose a cell phone!")
ElseIf RadioButton3. Checked = False Then
MessageBox.Show("Please choose a cell phone!")
ElseIf RadioButton4. Checked = False Then
MessageBox.Show("Please choose a cell phone!")
Else
form3.show()
End If
End Sub
End Class
In your Button2 click event, change the first part of your IF Statement as follows:
If RadioButton1. Checked = False and If RadioButton2. Checked = False _
and If RadioButton3. Checked = False and If RadioButton4. Checked = False Then
MessageBox.Show("Please choose a cell phone!")
- Why does my 2010 car not have an aux port? I have a 2010 Chevrolet Colorado truck. It doesn't have an auxiliary port to plug my iPhone into, and it frustrates me because I hate having to make CDs.
- What happens if pass code is entered wrong on iPhone? I need to put a pass code lock on my phone so my son can't get on my phone but when the pass code is entered wrong so many times it brings up the emergency slide. What will happen if he slides it?
- What does it mean to be basic? Like a basic white girl? If someone was a "basic white girl" or "basic," what do they do, or how do they act?
- Sync Iphone 4 with outlook 2010? I would just like to know if it is possible to sync my iphone 4 with my outlook 2010 contacts without losing the contacts already on my phone.