Button Tampilan :
Dim tgl As Date
tgl = DTP_Tanggal.Value
MsgBox(DateValue(tgl))
F5 Debug Preview
Button MessageBox Pertama :
MsgBox("Selamat Datang" + Chr(13) + "Mahasiswa STMIK MDP", MsgBoxStyle.Information, "Salam MS.Visual Basic 2008")
F5 Debug Preview
Button MessageBox Kedua :
If MsgBox("Anda ingin lulus mata kuliah ini?", MsgBoxStyle.Question + MsgBoxStyle.YesNo, "Pilihan di tangan Anda") = MsgBoxResult.Yes Then
MsgBox("Anda harus belajar dan latihan di rumah", MsgBoxStyle.Exclamation, "Anda Lulus")
Else
MsgBox("Silakan Habiskan waktu anda dengan percuma", MsgBoxStyle.Critical, "Anda Gagal")
End If
F5 Debug Preview
Dim A, B, C As String
A = InputBox("Ketik Nama Anda : ", "Mahasiswa")
B = InputBox("Ketik Kode Jurusan : ", "Ketik SI/TI")
If UCase(B) = "SI" Then
C = "Sistem Informasi"
ElseIf UCase(B) = "TI" Then
C = "Teknik Informasi"
End If
MessageBox.Show("Terima kasih" + Chr(13) + " Nama Anda : " & A + Chr(13) + "Jurusan : " & C, "Data Anda")
End Sub
F5 Debug Preview
Button Exit :
Cara 1
If MsgBox("Anda yakin ingin keluar?", MsgBoxStyle.Question + MsgBoxStyle.YesNo, "Pilih Yes untuk keluar") = MsgBoxResult.Yes Then Me.Close()
Cara2
Dim keluar As String
keluar = MsgBox("Anda ingin keluar dari Program ?", MsgBoxStyle.Question + MsgBoxStyle.YesNo, "EXIT")
If keluar = vbYes Then
Me.Close()
ElseIf keluar = vbNo Then
Me.Show()
End If
F5 Debug Preview









0 komentar:
Posting Komentar
Tuliskan Komentar Disini..