Senin, 28 Maret 2011

Part 1 & 2

Part 1


Public Class Form1
Dim jurusan As String
Dim kelas As Integer
Dim d As Integer = 5

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Call perintah()
End Sub
Sub perintah()
If TextBox1.Text = "ti" Then
TextBox2.Text = "Teknik Informatika"
ElseIf Text = "si" Then
TextBox2.Text = " Sistem Informasi"
End If
End Sub
End Class

Part 2



Public Class Form1

Private Sub TextBox1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress
If e.KeyChar = Chr(13) Then
TextBox2.Focus()
End If

End Sub

Private Sub TextBox2_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox2.KeyPress
If e.KeyChar = Chr(13) Then
TextBox3.Focus()
End If
End Sub

Private Sub TextBox3_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox3.KeyPress
If e.KeyChar = Chr(13) Then
TextBox4.Focus()
End If
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Proses.Click
ListBox1.Items.Add(TextBox1.Text + " " + TextBox2.Text + " " + TextBox3.Text + " " + TextBox4.Text)
End Sub

Private Sub TextBox4_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox4.KeyPress
If e.KeyChar = Chr(13) Then
Proses.Focus()
End If
End Sub

End Class

Tidak ada komentar:

Posting Komentar