Jumat, 14 September 2012

Latihan_05_36110038


Deskripsi Latihan_05_36110038
Form Latihan_05 terdapat empat object yaitu Label, Textbox, Button, dan Date Time Picker:

Object Label
Terdapat tiga label (yang bertuliskan Nama, Date Of Birth, dan Bintang)

Object Text Box
Terdapat tiga textbox (dua status input; satu status multiline=true). Status input digunakan untuk memasukkan nilai/text Nama, Bintang dan Hasil Ramalan.

Object Button
Terdapat dua object button (Analizing dan Close). Tombol Analizing digunakan untuk menampilkan hasil analisa atau ramalan di object TextBox multiline=true. Sedangkan Tombol close digunakan untuk mengosongkan nilai pada semua TextBox.

Object Datetimepicker
Terdapat satu datetimepicker yang digunakan untuk memasukkan date/tanggal.

Script Unique 
·         Button "Analizing" (button1_36110038)
If DTP_36110038.Value.Day >= 22 And DTP_36110038.Value.Month = 12 Or DTP_36110038.Value.Day <= 19 And DTP_36110038.Value.Month = 1 Then
            text2_36110038.Text = "Capricorn"
            text3_36110038.Text = "Tidak kenapa-kenapa"
·         Button "Close" (button2_36110038)
       
text1_36110038.Text = ""
        text2_36110038.Text = ""
        text3_36110038.Text = ""
        DTP_36110038.Text = ""
Even
Button1_36110038.Click
Button2_36110038.Click 

Property
Property TextBox ==> Multiline=True

Prosedur penyelesaian
1.klik star lalu pilih Microsoft Visual Studio 2008
2. pilih file => new => project
3. isi name dan location pada kolom yang disiapkan lalu OK
4. buat form dengan menggunakan Label, Textbox, dan Button yang ada dalam "Toolbox

5. ganti nama textbox dan button menggunakan "Properties Window"
6. Klik 2x pada kotak design untuk membuka lembar vb
 Masukkan rumus berikut untuk menyelesaikan latihan_05
Public Class Latihan_05_36110038

    Private Sub Button1_36110038_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1_36110038.Click
        If DTP_36110038.Value.Day >= 22 And DTP_36110038.Value.Month = 12 Or DTP_36110038.Value.Day <= 19 And DTP_36110038.Value.Month = 1 Then
            text2_36110038.Text = "Capricorn"
            text3_36110038.Text = "Tidak kenapa-kenapa"
        ElseIf DTP_36110038.Value.Day >= 20 And DTP_36110038.Value.Month = 1 Or DTP_36110038.Value.Day <= 18 And DTP_36110038.Value.Month = 2 Then
            text2_36110038.Text = "Aquarius"
            text3_36110038.Text = "Suka minum air"
        ElseIf DTP_36110038.Value.Day >= 19 And DTP_36110038.Value.Month = 2 Or DTP_36110038.Value.Day <= 20 And DTP_36110038.Value.Month = 3 Then
            text2_36110038.Text = "Pisces"
            text3_36110038.Text = "Suka marah-marah"
        ElseIf DTP_36110038.Value.Day >= 21 And DTP_36110038.Value.Month = 3 Or DTP_36110038.Value.Day <= 20 And DTP_36110038.Value.Month = 4 Then
            text2_36110038.Text = "Aries"
            text3_36110038.Text = "Doyan Nyanyi"
        ElseIf DTP_36110038.Value.Day >= 21 And DTP_36110038.Value.Month = 4 Or DTP_36110038.Value.Day <= 20 And DTP_36110038.Value.Month = 5 Then
            text2_36110038.Text = "Taurus"
            text3_36110038.Text = "Tak mau diurus"
        ElseIf DTP_36110038.Value.Day >= 21 And DTP_36110038.Value.Month = 5 Or DTP_36110038.Value.Day <= 20 And DTP_36110038.Value.Month = 6 Then
            text2_36110038.Text = "Gemini"
            text3_36110038.Text = "Maunya Lebih"
        ElseIf DTP_36110038.Value.Day >= 21 And DTP_36110038.Value.Month = 6 Or DTP_36110038.Value.Day <= 22 And DTP_36110038.Value.Month = 7 Then
            text2_36110038.Text = "Cancer"
            text3_36110038.Text = "Ada ajjahh"
        ElseIf DTP_36110038.Value.Day >= 23 And DTP_36110038.Value.Month = 7 Or DTP_36110038.Value.Day <= 22 And DTP_36110038.Value.Month = 8 Then
            text2_36110038.Text = "Leo"
            text3_36110038.Text = "Suka merum"
        ElseIf DTP_36110038.Value.Day >= 23 And DTP_36110038.Value.Month = 8 Or DTP_36110038.Value.Day <= 23 And DTP_36110038.Value.Month = 9 Then
            text2_36110038.Text = "Virgo"
            text3_36110038.Text = "Sehat-sehat saja"
        ElseIf DTP_36110038.Value.Day >= 24 And DTP_36110038.Value.Month = 9 Or DTP_36110038.Value.Day <= 23 And DTP_36110038.Value.Month = 10 Then
            text2_36110038.Text = "Libra"
            text3_36110038.Text = "Kurang kerjaan"
        ElseIf DTP_36110038.Value.Day >= 24 And DTP_36110038.Value.Month = 10 Or DTP_36110038.Value.Day <= 21 And DTP_36110038.Value.Month = 11 Then
            text2_36110038.Text = "Scorpio"
            text3_36110038.Text = "Kurang makan"
        ElseIf DTP_36110038.Value.Day >= 22 And DTP_36110038.Value.Month = 11 Or DTP_36110038.Value.Day <= 21 And DTP_36110038.Value.Month = 12 Then
            text2_36110038.Text = "Sagitarius"
            text3_36110038.Text = "Cantik dehh"
        End If
    End Sub

    Private Sub Button2_36110038_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2_36110038.Click
        text1_36110038.Text = ""
        text2_36110038.Text = ""
        text3_36110038.Text = ""
        DTP_36110038.Text = ""
    End Sub
End Class
7. Tekan F5 pada keyboard untuk menjalankan form.

Tidak ada komentar:

Posting Komentar