Jadikan hidup lebih bermakna.... Penuh semangat dan motivasi.... Wujudkan diri dengan karya dan bukti nyata.............................. Jadilah inspirasi untuk anak negeri....Kebanggaan diri sendiri.... Kebanggaan Keluarga.... Kebanggaan Bangsa dan Negara....
INDRA YUSUF_gcoz.blogspot

Rabu, 16 Maret 2011

Program1 VB.Net (latihan materi)

Membuat program VB
Toolnya menggunakan : Combobox,textbox, label, button, dan listview.

Tampilan form sebagai berikut :


Sintax Program yaitu :

Public Class Form1

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

If TextBox1.Text = "TI" Then
TextBox2.Text = "teknik informatika"
Else
If TextBox1.Text = "SI" Then
TextBox2.Text = "sistem informasi"
End If
End If
End Sub


Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
ListBox1.Items.Add(TextBox3.Text + " " + TextBox4.Text + " " + TextBox5.Text + " " + TextBox6.Text + " " + TextBox7.Text)
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 TextBox4_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox4.KeyPress
If e.KeyChar = Chr(13) Then
TextBox5.Focus()
End If
End Sub

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

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

Private Sub TextBox7_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox7.KeyPress
If e.KeyChar = Chr(13) Then
ListBox1.Items.Add(TextBox3.Text + " " + TextBox4.Text + " " + TextBox5.Text + " " + TextBox6.Text + " " + TextBox7.Text)
Call bersih()
End If
End Sub

Sub bersih()
TextBox3.text = ""
TextBox4.text = ""
TextBox5.text = ""
TextBox6.text = ""
TextBox7.text = ""
End Sub

Private Sub TextBox1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress

If e.KeyChar = Chr(13) Then
Button1.Focus()
End If
End Sub
End Class

Hasil runningnya :

Selamat mencoba....


.

0 komentar:

Posting Komentar

INDRA YUSUF_gcoz.blogspot

B.Inggris

Join yuuu...

BISNIS ONLINE

Bisnis 100% Tanpa Modal

idebagus

Web hosting dan domain gratis untuk website di IdeBagus

BISNIS GRATIS