Desain Form.vb seperti dibawah ini:
Perintah Programnya :
Public Class Form1
Private Sub ComboBox1_SelectedIndexChanged(ByVal sender AsSystem.Object, ByVal e As System.EventArgs) HandlesComboBox1.SelectedIndexChanged
Select Case ComboBox1.Text
Case "12110861"
TextBox1.Text = "Lidia"
TextBox2.Text = "S1"
TextBox8.Text = "TI"
Case "12110867"
TextBox1.Text = "Naomi"
TextBox2.Text = "D3"
TextBox8.Text = "MI"
Case "12110990"
TextBox1.Text = "Rio"
TextBox2.Text = "D1"
TextBox8.Text = "AI"
Case Else
TextBox1.Text = "Ga tau"
TextBox2.Text = "S1"
TextBox8.Text = "SI"
End Select
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e AsSystem.EventArgs) Handles MyBase.Load
ComboBox1.Items.Add("12110861")
ComboBox1.Items.Add("12110867")
ComboBox1.Items.Add("12110990")
ComboBox2.Items.Add("12345678")
ComboBox2.Items.Add("12345679")
ComboBox2.Items.Add("12345670")
ComboBox3.Items.Add("MT-0001")
ComboBox3.Items.Add("MT-0002")
ComboBox3.Items.Add("MT-0003")
Dim i As Integer
For i = 100 To 1 Step -2
ComboBox4.Items.Add(i)
Next
For i = 100 To 1 Step -2
ComboBox5.Items.Add(i)
Next
For i = 100 To 1 Step -3
ComboBox6.Items.Add(i)
Next
For i = 100 To 1 Step -2
ComboBox7.Items.Add(i)
Next i
End Sub
Private Sub ComboBox2_SelectedIndexChanged(ByVal sender AsSystem.Object, ByVal e As System.EventArgs) HandlesComboBox2.SelectedIndexChanged
Select Case ComboBox2.Text
Case "12345678"
TextBox3.Text = "Mesran"
Case "12345679"
TextBox3.Text = "Rivalry"
Case "12345670"
TextBox3.Text = "Guidio"
Case Else
TextBox3.Text = "DLL"
End Select
End Sub
Private Sub ComboBox3_SelectedIndexChanged(ByVal sender AsSystem.Object, ByVal e As System.EventArgs) HandlesComboBox3.SelectedIndexChanged
Select Case ComboBox3.Text
Case "MT-0001"
TextBox4.Text = "Pemograman VB"
Case "MT-0002"
TextBox4.Text = "SIMBAD"
Case "MT-0003"
TextBox4.Text = "KOmunitas Data"
Case Else
TextBox4.Text = "DSB"
End Select
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e AsSystem.EventArgs) Handles Button2.Click
TextBox5.Text = 0.1 * ComboBox4.Text + 0.15 * ComboBox5.Text + 0.3 * ComboBox6.Text + 0.45 * ComboBox7.Text
If ComboBox4.Text >= 80 Then
TextBox6.Text = "A"
TextBox7.Text = "LULUS"
ElseIf ComboBox4.Text >= 70 Then
TextBox6.Text = "B"
TextBox7.Text = "LULUS"
ElseIf ComboBox4.Text >= 60 Then
TextBox6.Text = "C"
TextBox7.Text = "LULUS"
ElseIf ComboBox4.Text >= 50 Then
TextBox6.Text = "D"
TextBox7.Text = "LULUS"
Else
TextBox6.Text = "E"
TextBox7.Text = "GAGAL"
End If
End Sub
End Class
Hasilnya sebagai Berikut :
Tidak ada komentar:
Posting Komentar