Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Dim ano As String
- Dim cilindrada As String
- Dim co2 As String
- Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
- cilindrada = TextBox2.Text
- co2 = TextBox3.Text
- If RadioButton4.Checked Then
- MsgBox("Este programa não pode serve para carros eletricos")
- Exit Sub
- End If
- ano = TextBox1.Text
- If ano < 2007 Then
- MsgBox("O simulador so é valido para carros superiopres a 2007")
- Exit Sub
- End If
- If cilindrada = "" Then
- MsgBox("O campo cilindrada não pode tar vazio")
- Exit Sub
- End If
- If co2 = "" Then
- MsgBox("O campo CO2 não pode tar vasio")
- Exit Sub
- End If
- If co2 <= 90 Then
- Label5.Text = "Ecológico"
- ElseIf co2 > 90 And co2 <= 120 Then
- Label5.Text = "Normal"
- Else
- Label5.Text = "Poluidor"
- End If
- Button1.Visible = True
- Button2.Visible = True
- TextBox4.Visible = True
- TextBox5.Visible = True
- End Sub
- Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
- Dim cl As Integer
- If cilindrada < 1500 Then
- cl = 5 * cilindrada - 500
- Else
- cl = 10 * cilindrada - 3000
- End If
- TextBox4.Text = cl
- End Sub
- Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
- Dim ca As Integer
- If co2 <= 90 Then
- ca = 5 * co2
- ElseIf co2 > 90 And co2 <= 120 Then
- ca = 10 * co2
- Else
- ca = 20 * co2
- End If
- TextBox5.Text = ca
- End Sub
- Private Sub ReniciarToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles ReniciarToolStripMenuItem.Click
- Application.Restart()
- End Sub
- Private Sub SairToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles SairToolStripMenuItem.Click
- Dim resposta As String
- resposta = MsgBox("Terminar", MessageBoxButtons.YesNo, MsgBoxStyle.Exclamation)
- If resposta = Windows.Forms.DialogResult.Yes Then
- End
- End If
- End Sub
- End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement