Selasa, 11 Desember 2012

Tutorial cara membuat program pendaftaran universitas online


Tutorial cara membuat program pendaftaran universitas online

1. langkah pertama yang harus dilakukan adalah membuka visual basic 2010 terlebih dahulu.
2. lalu langkah kedua buat form1 seperti gambar dibawah ini 



Dan untuk informasi komponen dapat dilihat dibawah ini.
no
komponen
properties
1
label1
text = formulir pendaftaran universitas online
2
label2
text = nomor ujian
3
label3
text = nama lengkap
4
label4
text = tempat tanggal lahir
5
label5
text = umur
6
label6
text = alamat
7
label7
text = universitas tujuan
8
label8
text = jurusan sekolah
9
label9
text = jurusan tujuan
10
label10
text = nilai
11
label11
text = geografi
12
label12
text = ekonomi
13
label13
text = sosiologi
14
label14
text = bahasa inggris
15
label15
text = bahasa indonesia
16
label16
text = matematika
17
textbox1
text = ""
18
textbox2
text = ""
19
textbox3
text = ""
20
textbox4
text = ""
21
textbox5
text = ""
22
textbox6
text = ""
23
textbox7
text = ""
24
textbox8
text = ""
25
textbox9
text = ""
26
textbox10
text = ""
27
textbox11
text = ""
28
numeric up down1
-
29
combo box1
item = Jan
Feb
Mar
Apr
Mei
Jun
Jul
Agt
Sep
Okt
Nov
Des
30
combo box2
item = 1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
31
combo box3
item = ITB
UNDIP
UI
32
combo box4
item = IPA
IPS
33
combo box5
item = Manajemen
Ekonomi
Sastra Inggris
Sastra Indonesia
Komunikasi
34
button1
text = refresh
35
button2
text = next


Jika sudah memasukan komponen lalu tinggal memasukan listing. Dan listing dapat dilihat dibawah ini
Public Class Form1
    Dim hitung As Integer
    Private Sub ComboBox2_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox2.SelectedIndexChanged
        If ComboBox2.Text = "IPS" Then
            Geo.Show()
            Eko.Show()
            Sos.Show()
            Bio.Hide()
            Fis.Hide()
            Kim.Hide()
            TextBox3.Show()
            TextBox4.Show()
            TextBox5.Show()
            TextBox6.Show()
            TextBox8.Show()
            TextBox7.Show()
            Mat.Show()
            Bing.Show()
            BI.Show()
            ComboBox3.Hide()
            ComboBox6.Show()
        Else
            Geo.Hide()
            Eko.Hide()
            Sos.Hide()
            Bio.Show()
            Fis.Show()
            Kim.Show()
            TextBox3.Show()
            TextBox4.Show()
            TextBox5.Show()
            TextBox6.Show()
            TextBox8.Show()
            TextBox7.Show()
            Mat.Show()
            Bing.Show()
            BI.Show()
            ComboBox3.Show()
            ComboBox6.Hide()
        End If
    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        If TextBox1.Text = "" Or
            TextBox10.Text = "" Or
            TextBox11.Text = "" Or
            TextBox2.Text = "" Or
            TextBox3.Text = "" Or
            TextBox4.Text = "" Or
            TextBox5.Text = "" Or
            TextBox6.Text = "" Or
            TextBox7.Text = "" Or
            TextBox8.Text = "" Or
            TextBox9.Text = "" Or
            ComboBox1.SelectedItem = Nothing Or
            ComboBox2.SelectedItem = Nothing Or
            ComboBox3.SelectedItem = Nothing Or
            ComboBox4.SelectedItem = Nothing Or
            ComboBox5.SelectedItem = Nothing And ComboBox6.SelectedItem = Nothing Or
            NumericUpDown1.Value = "0" Then
            MsgBox("Data Belum Lengkap")
            Return
        Else
            Form2.Show()
            Me.Hide()
            Form2.Label2.Text = TextBox1.Text
            Form2.Label4.Text = TextBox2.Text
            Form2.Label3.Text = TextBox9.Text & ", " & NumericUpDown1.Text & " " & ComboBox4.Text & " " & ComboBox5.Text
            Form2.Label5.Text = ComboBox1.SelectedItem
            Form2.Label6.Text = ComboBox3.SelectedItem
            Form2.Label7.Text = ComboBox2.SelectedItem
            hitung = Val(TextBox3.Text) + Val(TextBox4.Text) + Val(TextBox5.Text) + Val(TextBox6.Text) + Val(TextBox7.Text) + Val(TextBox8.Text)
            Form2.Label8.Text = hitung / 6
            Form2.Label10.Text = TextBox10.Text
        End If
    End Sub

    Private Sub TextBox10_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox10.KeyPress
        Dim key As Integer = Char.ConvertToUtf32(e.KeyChar.ToString(), 0)
        If Not (((key >= 48) And (key <= 57)) Or (key = 8) Or (key = 46) Or (key = 45)) Then
            e.Handled = True
        End If

    End Sub
    Private Sub TextBox3_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox3.KeyPress
        Dim key As Integer = Char.ConvertToUtf32(e.KeyChar.ToString(), 0)
        If Not (((key >= 48) And (key <= 57)) Or (key = 8) Or (key = 46) Or (key = 45)) Then
            e.Handled = True
        End If

    End Sub
    Private Sub TextBox4_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox4.KeyPress
        Dim key As Integer = Char.ConvertToUtf32(e.KeyChar.ToString(), 0)
        If Not (((key >= 48) And (key <= 57)) Or (key = 8) Or (key = 46) Or (key = 45)) Then
            e.Handled = True
        End If

    End Sub
    Private Sub TextBox5_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox5.KeyPress
        Dim key As Integer = Char.ConvertToUtf32(e.KeyChar.ToString(), 0)
        If Not (((key >= 48) And (key <= 57)) Or (key = 8) Or (key = 46) Or (key = 45)) Then
            e.Handled = True
        End If

    End Sub
    Private Sub TextBox6_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox6.KeyPress
        Dim key As Integer = Char.ConvertToUtf32(e.KeyChar.ToString(), 0)
        If Not (((key >= 48) And (key <= 57)) Or (key = 8) Or (key = 46) Or (key = 45)) Then
            e.Handled = True
        End If

    End Sub
    Private Sub TextBox7_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox7.KeyPress
        Dim key As Integer = Char.ConvertToUtf32(e.KeyChar.ToString(), 0)
        If Not (((key >= 48) And (key <= 57)) Or (key = 8) Or (key = 46) Or (key = 45)) Then
            e.Handled = True
        End If

    End Sub
    Private Sub TextBox8_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox8.KeyPress
        Dim key As Integer = Char.ConvertToUtf32(e.KeyChar.ToString(), 0)
        If Not (((key >= 48) And (key <= 57)) Or (key = 8) Or (key = 46) Or (key = 45)) Then
            e.Handled = True
        End If

    End Sub
    Private Sub ComboBox5_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox5.SelectedIndexChanged
        TextBox11.Text = 2012 - Val(ComboBox5.SelectedItem)
    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        TextBox1.Text = ""
        TextBox10.Text = ""
        TextBox11.Text = ""
        TextBox2.Text = ""
        TextBox3.Text = ""
        TextBox4.Text = ""
        TextBox5.Text = ""
        TextBox6.Text = ""
        TextBox7.Text = ""
        TextBox8.Text = ""
        TextBox9.Text = ""
        ComboBox1.SelectedItem = Nothing
        ComboBox2.SelectedItem = Nothing
        ComboBox3.SelectedItem = Nothing
        ComboBox4.SelectedItem = Nothing
        ComboBox5.SelectedItem = Nothing
        ComboBox6.SelectedItem = Nothing
        NumericUpDown1.Value = "0"

    End Sub

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

    End Sub
End Class



3. lalu setelah membuat form1 buatlah form2 dengan komponen seperti gambar dibawah ini.











Dan untuk komponen bisa dilihat tabel dibawah ini.
no
komponen
Properties
1
label1
text = rekap data pedaftaran
2
label2
text = label2
3
label3
text = label3
4
label4
text = label4
5
label5
text = label5
6
label6
text = label6
7
label7
text = label7
8
label8
text = label8
9
label9
text = label9
10
label10
text = label10
11
label11
text = nama lengkap
12
label12
text = tempat tanggal lahir
13
label13
text = alamat
14
label14
text = universitas tujuan
15
label15
text = jurusan tujuan
16
label16
text = jurusan sekolah
17
label17
text = nilai rata rata
18
button1
text = back
19
button2
text = finish


Dan setelah itu masukan listing dibawah ini
Public Class Form2
    Dim hitung As Integer
    Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Label2.Text = Form1.TextBox1.Text
        Label4.Text = Form1.TextBox2.Text
        Label3.Text = Form1.TextBox9.Text & ", " & Form1.NumericUpDown1.Text & " " & Form1.ComboBox4.Text & " " & Form1.ComboBox5.Text
        Label5.Text = Form1.ComboBox1.SelectedItem
        Label6.Text = Form1.ComboBox3.SelectedItem
        Label7.Text = Form1.ComboBox2.SelectedItem
        hitung = Val(Form1.TextBox3.Text) + Val(Form1.TextBox4.Text) + Val(Form1.TextBox5.Text) + Val(Form1.TextBox6.Text) + Val(Form1.TextBox7.Text) + Val(Form1.TextBox8.Text)
        Label8.Text = hitung / 6
        Label10.Text = Form1.TextBox10.Text
    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim A As String
        A = MsgBox("Apakah Anda Sudah Yakin?", vbYesNo + vbQuestion, "Peringatan")
        If A = vbNo Then
            Form1.Show()
            Me.Hide()
        ElseIf A = vbYes Then
            Form3.Show()
            Me.Hide()
        End If
    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        Form1.Show()
        Me.Hide()
    End Sub
End Class












4. lalu setelah membuat form2 buatlah form3 seperti gambar dibawah ini.











Setelah itu buatlah komponen seperti tabel dibawah ini
no
komponen
properties
1
label1
text = label1
2
label2
text = pengumuman hasil SNMPTN 2012 jalur online
3
label3
text = jurusan
4
label4
text = label4
5
label5
text = universitas
6
label6
text = label6
7
label7
text = nomor ujian
8
button1
text = keluar

Lalu masukan listing dibawah ini
Public Class Form3
    Dim kira As Integer

    Private Sub Form3_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Label4.Text = Form2.Label10.Text
        Label6.Text = Form2.Label5.Text
        Label8.Text = Form2.Label6.Text
        kira = Val(Form2.Label8.Text)
        If kira > 75 Then
            diterima()
        Else
            ditolak()
        End If
       
    End Sub
    Private Sub diterima()
        If Label6.Text = "UI" Then
            Label1.Text = "Selamat, Anda diterima sebagai calon mahasiswa baru Universitas Indonesia"
        ElseIf Label6.Text = "ITB" Then
            Label1.Text = "Selamat, Anda diterima sebagai calon mahasiswa baru Institut Teknologi Bandung"
        ElseIf Label6.Text = "UNDIP" Then
            Label1.Text = "Selamat, Anda diterima sebagai calon mahasiswa baru Universitas Diponegoro"
        End If
        Label4.Show()
        Label6.Show()
        Label8.Show()
        Label3.Show()
        Label5.Show()
        Label7.Show()
    End Sub
    Private Sub ditolak()
        Label1.Text = "Mohon Maaf, Peserta Dengan Nama " & Form2.Label2.Text & " Dengan Nomor Ujian " & Form2.Label10.Text & " Dinyatakan Tidak Diterima Pada SNMPTN Jalur Ujian Tertulis"
        Label4.Hide()
        Label3.Hide()
        Label5.Hide()
        Label7.Hide()
        Label6.Hide()
        Label8.Hide()
    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Form4.Close()
    End Sub
End Class











5. setelah membuat form3 lalu buatlah form selanjutnya yaitu form4 seperti gambar dibawah ini.











Lalu masukan komponen mengikuti tabel dibawah ini
no
komponen
properties
1
label1
text = selamat datang di pendaftaran SNMPTN online 2012
2
picture box1
-
3
button1
text = daftar
4
button2
text = keluar

Lalu setelah itu masukan listing berikut
Public Class Form1
    Dim hitung As Integer
    Private Sub ComboBox2_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox2.SelectedIndexChanged
        If ComboBox2.Text = "IPS" Then
            Geo.Show()
            Eko.Show()
            Sos.Show()
            Bio.Hide()
            Fis.Hide()
            Kim.Hide()
            TextBox3.Show()
            TextBox4.Show()
            TextBox5.Show()
            TextBox6.Show()
            TextBox8.Show()
            TextBox7.Show()
            Mat.Show()
            Bing.Show()
            BI.Show()
            ComboBox3.Hide()
            ComboBox6.Show()
        Else
            Geo.Hide()
            Eko.Hide()
            Sos.Hide()
            Bio.Show()
            Fis.Show()
            Kim.Show()
            TextBox3.Show()
            TextBox4.Show()
            TextBox5.Show()
            TextBox6.Show()
            TextBox8.Show()
            TextBox7.Show()
            Mat.Show()
            Bing.Show()
            BI.Show()
            ComboBox3.Show()
            ComboBox6.Hide()
        End If
    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        If TextBox1.Text = "" Or
            TextBox10.Text = "" Or
            TextBox11.Text = "" Or
            TextBox2.Text = "" Or
            TextBox3.Text = "" Or
            TextBox4.Text = "" Or
            TextBox5.Text = "" Or
            TextBox6.Text = "" Or
            TextBox7.Text = "" Or
            TextBox8.Text = "" Or
            TextBox9.Text = "" Or
            ComboBox1.SelectedItem = Nothing Or
            ComboBox2.SelectedItem = Nothing Or
            ComboBox3.SelectedItem = Nothing Or
            ComboBox4.SelectedItem = Nothing Or
            ComboBox5.SelectedItem = Nothing And ComboBox6.SelectedItem = Nothing Or
            NumericUpDown1.Value = "0" Then
            MsgBox("Data Belum Lengkap")
            Return
        Else
            Form2.Show()
            Me.Hide()
            Form2.Label2.Text = TextBox1.Text
            Form2.Label4.Text = TextBox2.Text
            Form2.Label3.Text = TextBox9.Text & ", " & NumericUpDown1.Text & " " & ComboBox4.Text & " " & ComboBox5.Text
            Form2.Label5.Text = ComboBox1.SelectedItem
            Form2.Label6.Text = ComboBox3.SelectedItem
            Form2.Label7.Text = ComboBox2.SelectedItem
            hitung = Val(TextBox3.Text) + Val(TextBox4.Text) + Val(TextBox5.Text) + Val(TextBox6.Text) + Val(TextBox7.Text) + Val(TextBox8.Text)
            Form2.Label8.Text = hitung / 6
            Form2.Label10.Text = TextBox10.Text
        End If
    End Sub

    Private Sub TextBox10_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox10.KeyPress
        Dim key As Integer = Char.ConvertToUtf32(e.KeyChar.ToString(), 0)
        If Not (((key >= 48) And (key <= 57)) Or (key = 8) Or (key = 46) Or (key = 45)) Then
            e.Handled = True
        End If

    End Sub
    Private Sub TextBox3_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox3.KeyPress
        Dim key As Integer = Char.ConvertToUtf32(e.KeyChar.ToString(), 0)
        If Not (((key >= 48) And (key <= 57)) Or (key = 8) Or (key = 46) Or (key = 45)) Then
            e.Handled = True
        End If

    End Sub
    Private Sub TextBox4_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox4.KeyPress
        Dim key As Integer = Char.ConvertToUtf32(e.KeyChar.ToString(), 0)
        If Not (((key >= 48) And (key <= 57)) Or (key = 8) Or (key = 46) Or (key = 45)) Then
            e.Handled = True
        End If

    End Sub
    Private Sub TextBox5_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox5.KeyPress
        Dim key As Integer = Char.ConvertToUtf32(e.KeyChar.ToString(), 0)
        If Not (((key >= 48) And (key <= 57)) Or (key = 8) Or (key = 46) Or (key = 45)) Then
            e.Handled = True
        End If

    End Sub
    Private Sub TextBox6_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox6.KeyPress
        Dim key As Integer = Char.ConvertToUtf32(e.KeyChar.ToString(), 0)
        If Not (((key >= 48) And (key <= 57)) Or (key = 8) Or (key = 46) Or (key = 45)) Then
            e.Handled = True
        End If

    End Sub
    Private Sub TextBox7_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox7.KeyPress
        Dim key As Integer = Char.ConvertToUtf32(e.KeyChar.ToString(), 0)
        If Not (((key >= 48) And (key <= 57)) Or (key = 8) Or (key = 46) Or (key = 45)) Then
            e.Handled = True
        End If

    End Sub
    Private Sub TextBox8_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox8.KeyPress
        Dim key As Integer = Char.ConvertToUtf32(e.KeyChar.ToString(), 0)
        If Not (((key >= 48) And (key <= 57)) Or (key = 8) Or (key = 46) Or (key = 45)) Then
            e.Handled = True
        End If

    End Sub
    Private Sub ComboBox5_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox5.SelectedIndexChanged
        TextBox11.Text = 2012 - Val(ComboBox5.SelectedItem)
    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        TextBox1.Text = ""
        TextBox10.Text = ""
        TextBox11.Text = ""
        TextBox2.Text = ""
        TextBox3.Text = ""
        TextBox4.Text = ""
        TextBox5.Text = ""
        TextBox6.Text = ""
        TextBox7.Text = ""
        TextBox8.Text = ""
        TextBox9.Text = ""
        ComboBox1.SelectedItem = Nothing
        ComboBox2.SelectedItem = Nothing
        ComboBox3.SelectedItem = Nothing
        ComboBox4.SelectedItem = Nothing
        ComboBox5.SelectedItem = Nothing
        ComboBox6.SelectedItem = Nothing
        NumericUpDown1.Value = "0"

    End Sub

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

    End Sub
End Class


6.  lalu pada solution explorer klik 2 kali project, dan pilih application, dan pilih start up form = form4

Tidak ada komentar:

Posting Komentar