Bulan dengan Error Provider jika Dimasukkan Huruf
Program untuk mengingatkan = Cek Validasi
Public Class Form1
Dim XBULAN(12)
Private Sub no_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles no.KeyPress
If Asc(e.KeyChar) = 13 Then
If Not IsNumeric(no.Text) Then
MsgBox("Wah, gak nglindur a kund?? Salah ngleboknoe.. baleni kono!")
Else
If no.Text > 12 Then
MsgBox("Wah, gak nglindur a kund?? Salah ngleboknoe.. baleni kono!")
Else
lstatus.Text = XBULAN(no.Text)
End If
End If
End If
End Sub
Private Sub Form1_Activated(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Activated
XBULAN(1) = "JANUARI"
XBULAN(2) = "FEBRUARI"
XBULAN(3) = "MARET"
XBULAN(4) = "APRIL"
XBULAN(5) = "MEI"
XBULAN(6) = "JUNI"
XBULAN(7) = "JULI"
XBULAN(8) = "AGUSTUS"
XBULAN(9) = "SEPTEMBER"
XBULAN(10) = "OKTOBER"
XBULAN(11) = "NOPEMBER"
XBULAN(12) = "DESEMBER"
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
End
End Sub
End Class
Dim XBULAN(12)
Private Sub no_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles no.KeyPress
If Asc(e.KeyChar) = 13 Then
If Not IsNumeric(no.Text) Then
MsgBox("Wah, gak nglindur a kund?? Salah ngleboknoe.. baleni kono!")
Else
If no.Text > 12 Then
MsgBox("Wah, gak nglindur a kund?? Salah ngleboknoe.. baleni kono!")
Else
lstatus.Text = XBULAN(no.Text)
End If
End If
End If
End Sub
Private Sub Form1_Activated(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Activated
XBULAN(1) = "JANUARI"
XBULAN(2) = "FEBRUARI"
XBULAN(3) = "MARET"
XBULAN(4) = "APRIL"
XBULAN(5) = "MEI"
XBULAN(6) = "JUNI"
XBULAN(7) = "JULI"
XBULAN(8) = "AGUSTUS"
XBULAN(9) = "SEPTEMBER"
XBULAN(10) = "OKTOBER"
XBULAN(11) = "NOPEMBER"
XBULAN(12) = "DESEMBER"
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
End
End Sub
End Class
0 komentar
Posting Komentar