Mata Kuliah Semester 3
Pemrograman Visual I
§ CODING MEMBUAT SEBUAH §
§ PROGRAM/APLIKASI §
§ MENAMPILKAN ZODIAK ANDA §
بسم الله الرحمن الرحيم
Aplikasi ini menggunakan Visual Basic aja.
Dan berikut ini adalah rumus codingannya :
Selamat mencoba =)
Public Class Form1
Private Sub Label1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label1.Click
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
For i As Integer = 1 To 31
ComboBox1.Items.Add(i)
Next
For i As Integer = 1 To 12
ComboBox2.Items.Add(MonthName(i))
Next
End Sub
Dim zodiak As String
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If ComboBox1.SelectedIndex < 20 And ComboBox2.SelectedIndex = 0 Or ComboBox1.SelectedIndex > 21 And ComboBox2.SelectedIndex = 11 Then
zodiak = "Capricorn"
ElseIf ComboBox1.SelectedIndex < 18 And ComboBox2.SelectedIndex = 1 Or ComboBox1.SelectedIndex > 19 And ComboBox2.SelectedIndex = 0 Then
zodiak = "Aquarius"
ElseIf ComboBox1.SelectedIndex < 20 And ComboBox2.SelectedIndex = 2 Or ComboBox1.SelectedIndex > 17 And ComboBox2.SelectedIndex = 1 Then
zodiak = "Pisces"
ElseIf ComboBox1.SelectedIndex < 20 And ComboBox2.SelectedIndex = 3 Or ComboBox1.SelectedIndex > 19 And ComboBox2.SelectedIndex = 2 Then
zodiak = "Aries"
ElseIf ComboBox1.SelectedIndex < 20 And ComboBox2.SelectedIndex = 4 Or ComboBox1.SelectedIndex > 19 And ComboBox2.SelectedIndex = 3 Then
zodiak = "Taurus"
ElseIf ComboBox1.SelectedIndex < 21 And ComboBox2.SelectedIndex = 5 Or ComboBox1.SelectedIndex > 19 And ComboBox2.SelectedIndex = 4 Then
zodiak = "Gemini"
ElseIf ComboBox1.SelectedIndex < 22 And ComboBox2.SelectedIndex = 6 Or ComboBox1.SelectedIndex > 20 And ComboBox2.SelectedIndex = 5 Then
zodiak = "Cancer"
ElseIf ComboBox1.SelectedIndex < 23 And ComboBox2.SelectedIndex = 7 Or ComboBox1.SelectedIndex > 21 And ComboBox2.SelectedIndex = 6 Then
zodiak = "Leo"
ElseIf ComboBox1.SelectedIndex < 22 And ComboBox2.SelectedIndex = 8 Or ComboBox1.SelectedIndex > 22 And ComboBox2.SelectedIndex = 7 Then
zodiak = "Virgo"
ElseIf ComboBox1.SelectedIndex < 23 And ComboBox2.SelectedIndex = 9 Or ComboBox1.SelectedIndex > 21 And ComboBox2.SelectedIndex = 8 Then
zodiak = "Libra"
ElseIf ComboBox1.SelectedIndex < 22 And ComboBox2.SelectedIndex = 10 Or ComboBox1.SelectedIndex > 22 And ComboBox2.SelectedIndex = 9 Then
zodiak = "Scorpio"
ElseIf ComboBox1.SelectedIndex < 22 And ComboBox2.SelectedIndex = 11 Or ComboBox1.SelectedIndex > 20 And ComboBox2.SelectedIndex = 10 Then
zodiak = "Sagitarius"
End If
RichTextBox1.Text = TextBox1.Text & " ,anda lahir pada" & ComboBox1.Text & " " & ComboBox2.Text & "zodiak anda adalah" & zodiak
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
For Each a As Control In Me.Controls
If TypeOf (a) Is TextBox Or TypeOf (a) Is ComboBox Then
a.Text = " "
End If
Next
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
Application.Exit()
End Sub
Private Sub LinkLabel1_LinkClicked(ByVal sender As System.Object, ByVal e As System.Windows.Forms.LinkLabelLinkClickedEventArgs) Handles LinkLabel1.LinkClicked
End Sub
End Class
Makasih udah mau mengunjungi blogku ..
Semoga berhasil dan ilmunya bisa bermanfaat lebih dan lebih lagi ..
^^
★☆。.:*:・"゚★('-^v)Thanks(v^-')★。.:*:・"☆★
0 komentar
Posting Komentar