Seleksi Pengajuan Pembelian Komputer
Gambar1. Contoh aplikasi penyeleksian calon pembeli komputer
Aplikasi ini dibuat berdasarkan penambangan data menggunakan metode decision tree.
Codingnya;
Public Class Form1
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
'Me.Width = 463
If PT.Left < 390 Then 'Me.Width Then
PT.Left += 1
If PT.Left < 50 Then
PT.ForeColor = Color.Violet
ElseIf PT.Left >= 50 And PT.Left < 100 Then
PT.ForeColor = Color.Yellow
ElseIf PT.Left >= 100 And PT.Left < 150 Then
PT.ForeColor = Color.Cyan
ElseIf PT.Left >= 150 And PT.Left < 200 Then
PT.ForeColor = Color.Magenta
ElseIf PT.Left >= 200 And PT.Left < 250 Then
PT.ForeColor = Color.Orange
ElseIf PT.Left >= 250 And PT.Left < 300 Then
PT.ForeColor = Color.YellowGreen
ElseIf PT.Left >= 300 And PT.Left < 350 Then
PT.ForeColor = Color.OrangeRed
Else
PT.ForeColor = Color.White
End If
Else
Timer2.Enabled = True
End If
End Sub
Private Sub Timer2_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer2.Tick
Timer1.Enabled = False
If PT.Left > 0 Then
PT.Left -= 1
If PT.Left < 50 Then
PT.ForeColor = Color.Violet
ElseIf PT.Left >= 50 And PT.Left < 100 Then
PT.ForeColor = Color.Yellow
ElseIf PT.Left >= 100 And PT.Left < 150 Then
PT.ForeColor = Color.Cyan
ElseIf PT.Left >= 150 And PT.Left < 200 Then
PT.ForeColor = Color.Magenta
ElseIf PT.Left >= 200 And PT.Left < 250 Then
PT.ForeColor = Color.Orange
ElseIf PT.Left >= 250 And PT.Left < 300 Then
PT.ForeColor = Color.YellowGreen
ElseIf PT.Left >= 300 And PT.Left < 350 Then
PT.ForeColor = Color.OrangeRed
Else
PT.ForeColor = Color.White
End If
Else
Timer1.Enabled = True
Timer2.Enabled = False
End If
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Beep()
If umur.Text = "" Or nama.Text = "" Then
MessageBox.Show("Masukkan Umur dan Nama", "Oops!!!!!!!!!!!!!!!!")
ElseIf Val(umur.Text) > 40 And RadioButton4.Checked = True Then
hasil.Text = nama.Text + " anda Boleh Membeli Komputer"
ElseIf Val(umur.Text) > 30 And Val(umur.Text) <= 40 Then
hasil.Text = nama.Text + " anda Boleh Membeli Komputer"
ElseIf Val(umur.Text) <= 30 And RadioButton1.Checked = True Then
hasil.Text = nama.Text + " anda Boleh Membeli Komputer"
Else
hasil.Text = nama.Text + " anda TIDAK Boleh Membeli Komputer"
End If
End Sub
Private Sub umur_Leave(ByVal sender As Object, ByVal e As System.EventArgs) Handles umur.Leave
umur.Text = umur.Text + " Tahun"
End Sub
Private Sub umur_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles umur.TextChanged
If Val(umur.Text) > 40 Then
RadioButton1.Enabled = False
RadioButton2.Enabled = False
RadioButton3.Enabled = True
RadioButton4.Enabled = True
ElseIf Val(umur.Text) <= 40 Then
RadioButton1.Enabled = True
RadioButton2.Enabled = True
RadioButton3.Enabled = False
RadioButton4.Enabled = False
End If
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
judul.BackColor = Color.Transparent
lnama.BackColor = Color.Transparent
lumur.BackColor = Color.Transparent
lstatus.BackColor = Color.Transparent
lrating.BackColor = Color.Transparent
gstatus.BackColor = Color.Transparent
Grating.BackColor = Color.Transparent
lket.BackColor = Color.Transparent
PT.BackColor = Color.Transparent
hasil.BackColor = Color.Transparent
lket.ForeColor = Color.Brown
hasil.ForeColor = Color.Brown
MessageBox.Show("loading........", "Load")
Me.MaximizeBox = False
Me.MinimizeBox = False
nama.TabIndex = 1
umur.TabIndex = 2
'RadioButton1.TabIndex = 3
'RadioButton1.TabIndex = 4
'RadioButton1.TabIndex = 5
'RadioButton1.TabIndex = 6
'RadioButton1.TabIndex = 7
'Button1.TabIndex = 8
'Button2.TabIndex = 9
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
nama.Text = ""
umur.Text = ""
hasil.Text = "Belum yakin? Coba lagi Ya.."
RadioButton1.Enabled = True
RadioButton2.Enabled = True
RadioButton3.Enabled = True
RadioButton4.Enabled = True
RadioButton1.Checked = False
RadioButton2.Checked = False
RadioButton3.Checked = False
RadioButton4.Checked = False
nama.Focus()
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
Beep()
Form2.Show()
End Sub
End Class
Gambar form login
codingnya:
Public Class Form3
Private Sub TextBox2_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox2.KeyPress
If TextBox1.Text = "zen" And TextBox2.Text = "zen" Then
Me.Hide()
Form1.Show()
' Else
'MsgBox("User name atau password Default user name dan Password 'zen'", "Pesan")
End If
End Sub
End Class
Gambar form konfirmasi
Codingnya:
Public Class Form2
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Form1.Show()
Me.Close()
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
End
End Sub
Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Label1.BackColor = Color.Transparent
End Sub
End Class


Comments
Post a Comment