1. First of all, open the Microsoft Visual Basic 2008
2. Then, click file in the menu bar, click for the new project and write for the name which you want to save.
3. After that, you will enter in the page which just have a blank form in there. Then, you can change for the properties name or etc as you like. Next, click save in the standard button. It will appear like the picture below and don't forget for the save name as well as the folder or file you want to save in.
4. Next, you make the form design as you want but related to Program Operator Logic. Or you can copy like this picture below.
5. For this step, you need to concern about the properties name of the design that you make. because it'll effect the coding you want to write. (For this article, the coding it write related to below properties).
Nama Design | Nama Properties |
L_NPM | Label1 |
L_Nama | Label2 |
L_Nilai Angka | Label3 |
L_Nilai Huruf | Label4 |
L_Predikat | Label5 |
T_NPM | Textbox1 |
T_Nama | Textbox2 |
T_Nilai Angka | Textbox3 |
T_Nilai Huruf | TextBox4 |
T_Predikat | TextBox5 |
B_Mulai | Button1 |
B_Selesai | Button2 |
6. This Step is for coding.
Public Class FLogika
End Class
Sub Bersih()
TextBox1.Clear()
TextBox2.Clear()
TextBox3.Clear()
TextBox4.Clear()
TextBox5.Clear()
End Sub
Sub Buka()
TextBox1.Enabled = True
TextBox2.Enabled = True
TextBox3.Enabled = True
TextBox4.Enabled = True
TextBox5.Enabled = True
End Sub
Sub Tutup()
TextBox1.Enabled = False
TextBox2.Enabled = False
TextBox3.Enabled = False
TextBox4.Enabled = False
TextBox5.Enabled = False
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Bersih()
Buka()
TextBox5.ReadOnly = True
TextBox4.ReadOnly = True
TextBox1.Focus()
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Dim A1 As Integer
Try
A1 = CInt(TextBox3.Text)
If A1 >= 80 And A1 <= 100 Then
TextBox4.Text = "A"
TextBox5.Text = "Sangat Baik"
MessageBox.Show("Pertahankan Prestasi Anda", "Selamat", MessageBoxButtons.OK, MessageBoxIcon.Asterisk)
ElseIf A1 >= 67 And A1 <= 79 Then
TextBox4.Text = "B"
TextBox5.Text = "Baik"
MessageBox.Show("Tingkatan Prestasi Anda", "Selamat", MessageBoxButtons.OK, MessageBoxIcon.Asterisk)
ElseIf A1 >= 56 And A1 <= 66 Then
TextBox4.Text = "C"
TextBox5.Text = "Cukup Baik"
MessageBox.Show("Tingkatan Prestasi Anda Dan Rajinlah Belajar", "Selamat", MessageBoxButtons.OK, MessageBoxIcon.Asterisk)
ElseIf A1 >= 40 And A1 <= 55 Then
TextBox4.Text = "D"
TextBox5.Text = "Kurang Baik"
MessageBox.Show("Belajarlah Dengan Giat Dan Tekun", "Tingkatkan", MessageBoxButtons.OK, MessageBoxIcon.Asterisk)
ElseIf A1 < 40 And A1 >= 0 Then
TextBox4.Text = "E"
TextBox5.Text = "Gagal"
MessageBox.Show("Ikutlah Pelajaran Dengan Baik dan Belajarlah dengan Sungguh-Sungguh", "Gagal", MessageBoxButtons.OK, MessageBoxIcon.Asterisk)
Else
MessageBox.Show("No Record", "Snytax Error", MessageBoxButtons.OK, MessageBoxIcon.Stop)
End If
Catch ex As Exception
End Try
End Sub
Private Sub Soal1d_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Bersih()
Tutup()
Button1.Select()
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
Me.Close()
End Sub
End Class
7. To the end, you try for the debug(F5). Then, input the data as you like.
8. Thank You and Good Luck^^
0 comments:
Post a Comment
Note: only a member of this blog may post a comment.