PROGRAM MENCARI NPM DENGAN VB.NET SERTA MENGGUNAKAN PERULANGAN
Mencari NPM dengan menggunakan VB.NET 2008
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Call TAHUNN()
Call JENJANGG()
Call URUTT()
End Sub
Sub TAHUNN()
Dim A As Integer
For A = 2005 To 2011
TAHUN.Items.Add(A)
Next
End Sub
Sub JENJANGG()
JENJANG.Items.Add("S1")
JENJANG.Items.Add("D3")
End Sub
Private Sub JENJANG_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles JENJANG.SelectedIndexChanged
If JENJANG.Text = "S1" Then
KODE.Text = "11"
ElseIf JENJANG.Text = "D3" Then
KODE.Text = "02"
End If
End Sub
Sub URUTT()
Dim V As Integer
For V = 500 To 1000
URUT.Items.Add(V)
Next
End Sub
Private Sub CMD_DELETE_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CMD_DELETE.Click
TAHUN.Text = ""
JENJANG.Text = ""
KODE.Text = ""
URUT.Text = ""
NPM.Text = ""
End Sub
Private Sub CMD_CLOSE_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CMD_CLOSE.Click
Dim PESAN As Integer
PESAN = MsgBox("APAKAH ANDA INGIN KELUAR", vbQuestion + vbYesNo, "LANJUTKAN")
If PESAN = vbYes Then
Me.Close()
ElseIf PESAN = vbNo Then
Me.Show()
End If
End Sub
Private Sub URUT_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles URUT.SelectedIndexChanged
NPM.Text = Microsoft.VisualBasic.Right(TAHUN.Text, 2) & Microsoft.VisualBasic.Right(KODE.Text, 2) & Microsoft.VisualBasic.Right(URUT.Text, 3)
End Sub
End Class
0 komentar:
Posting Komentar