1. Buka aplikasi Microsoft Visual Studio 2005,
2. Jika sudah buat desain pada form tersebut, seperti dibawah ini
3. Selanjutnya masukkan kodingan dibawah ini
Public Class Form1
Private Sub Form1_Load (ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Button1.Enabled = False
End Sub
Private Sub TextBox1_TextChanged (ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged
Button1.Enabled = True
If TextBox1.Text.Trim = "" Or TextBox2.Text.Trim = "" Then
Button1.Enabled = False
End If
End Sub
Private Sub TextBox2_TextChanged (ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox2.TextChanged
Button1.Enabled = True
If TextBox1.Text.Trim = "" Or TextBox2.Text.Trim = "" Then
Button1.Enabled = False
End If
End Sub
Private Sub Button1_Click (ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Select Case TextBox1.Text.Trim.ToUpper
Case "HUSNA"
MessageBox.Show("selamat datang Husna", "pesan")
Case "HILIYAH"
MessageBox.Show("selamat datang Hiliyah", "pesan")
Case "ANGEL"
MessageBox.Show("selamat datang Angel", "pesan")
Case "TIFAN"
MessageBox.Show("selamat datang Tifan", "pesan")
Case "BELA"
MessageBox.Show("selamat datang Bela", "pesan")
Case "DIAN"
MessageBox.Show("selamat datang Dian", "pesan")
Case Else
MessageBox.Show("anda siapa ya ???", "pesan")
End Select
On Error Resume Next
Select Case CInt(TextBox2.Text.Trim)
Case Is < 6
MessageBox.Show("nilai anda kurang dari 6", "pesan")
Case Is < 8
MessageBox.Show("nilai anda dalam range 6-8", "pesan")
Case Is <= 10
MessageBox.Show("nilai anda dalam range 8-10", "pesan")
Case Else
MessageBox.Show("nilai anda tidak valid", "pesan")
End Select
End Sub
4. Yup setelah dimasukan kodingannya , maka Run Program.
Sekian blog saya hari ini, semoga bermanfaat. Terimakasih sudah membaca^^
0 komentar:
Posting Komentar