Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Public Class Form1
- Private Sub btnExit_Click(sender As Object, e As EventArgs) Handles btnExit.Click
- Application.Exit()
- End Sub
- ' Save Button: Displays the entered data in a message box
- Private Sub btnSimpan_Click(sender As Object, e As EventArgs) Handles btnSimpan.Click
- ' Check if any required field is empty
- nama = txtNama.Text
- tempatLahir = txtTempat.Text
- tanggalLahir = dtpTanggal.Value.ToString("dd MMMM yyyy")
- gender = If(rbtnLaki.Checked, "Laki-laki", If(rbtnPerempuan.Checked, "Perempuan", String.Empty))
- agama = cbAgama.SelectedItem?.ToString()
- asalSekolah = txtAsal.Text
- noHP = txtNo.Text
- alamat = txtAlamat.Text
- email = txtEmail.Text
- namaAyah = txtAyah.Text
- namaIbu = txtIbu.Text
- noHPO = txtNoHPO.Text
- If String.IsNullOrWhiteSpace(nama) OrElse
- String.IsNullOrWhiteSpace(tempatLahir) OrElse
- String.IsNullOrWhiteSpace(gender) OrElse
- String.IsNullOrWhiteSpace(agama) OrElse
- String.IsNullOrWhiteSpace(asalSekolah) OrElse
- String.IsNullOrWhiteSpace(noHP) OrElse
- String.IsNullOrWhiteSpace(alamat) OrElse
- String.IsNullOrWhiteSpace(email) OrElse
- String.IsNullOrWhiteSpace(namaAyah) OrElse
- String.IsNullOrWhiteSpace(namaIbu) OrElse
- String.IsNullOrWhiteSpace(noHPO) Then
- MessageBox.Show("Harap isi semua data yang diperlukan.", "Data Tidak Lengkap", MessageBoxButtons.OK, MessageBoxIcon.Warning)
- Return
- End If
- btnSimpan.Enabled = False
- btnLanjutkan.Enabled = True
- End Sub
- ' Lanjutkan Button: Opens the next form (Form2)
- ' Lanjutkan Button: Opens the next form (Form2) if all required fields are filled
- Private Sub btnLanjutkan_Click(sender As Object, e As EventArgs) Handles btnLanjutkan.Click
- ' Open Form2 and hide the current form
- Dim form2 As New Form2()
- form2.Show()
- Me.Hide()
- End Sub
- End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement