Bab 01
Bab 01
NET)
BAB 1
1. Memulai VB.Net
2. File, New Project
3. Pilih “Visual Basic” pada panel Project Type
4. Pilih “Windows Application” pada Templete
5. Berikan Nama Project “Latihan1” pada Kotak Name, Klik Tombol OK
Toolbar
Properties
Solution
Form Explorer
Data
Error List Sources
1
Praktikum Pemrograman 3 ( VB.NET)
Latihan 1
3. Properties
Label1.Text = "STT"
End Sub
5. Jalankan Program dengan menekan tombol “F5” atau melalui Menu [ Debug, Start
Debugging ]
6. Simpan project ini pada Direktori / Folder “Nim Anda”
Pada saat anda membuat project ini, maka akan muncul beberapa file pada direktori yang kita
tentukan, diantaranya adalah :
Sebagai hasil Compile / Build, maka akan terbentuk file “exe” yang terdapat pada folder
bin\Release\..
2
Praktikum Pemrograman 3 ( VB.NET)
Latihan 2
Label5.Text = TextBox1.Text
Label6.Text = TextBox2.Text
End Sub
3
Praktikum Pemrograman 3 ( VB.NET)
4. Double Klik pada Button Keluar, Masukan script sbb :
Latihan 3
1. Buat project baru, kemudian desain form dengan mamasukan komponen : label,
TextBox, GroupBox, ComboBox, CheckBox, ListBox, Button
4
Praktikum Pemrograman 3 ( VB.NET)
ListBox1.Items.Add(CheckBox4.Text)
End If
If CheckBox5.Checked Then
ListBox1.Items.Add(CheckBox5.Text)
End If
If CheckBox6.Checked Then
ListBox1.Items.Add(CheckBox6.Text)
End If
If CheckBox7.Checked Then
ListBox1.Items.Add(CheckBox7.Text)
End If
If CheckBox8.Checked Then
ListBox1.Items.Add(CheckBox8.Text)
End If
If CheckBox9.Checked Then
ListBox1.Items.Add(CheckBox9.Text)
End If
End If
Latihan 4
5
Praktikum Pemrograman 3 ( VB.NET)
3. HScrollBar1_Scroll
4. TrackBar1_Scroll
Latihan 5
End Sub
6
Praktikum Pemrograman 3 ( VB.NET)
Latihan 6
1. Masukan komponen : Tooltips, MaskedTextBox
2. MaskedTextBox1_KeyDown
End Sub
3. MaskedTextBox1_MaskInputRejected
If (Me.MaskedTextBox1.MaskFull) Then
ToolTip1.ToolTipTitle = "Input data Sudah Full"
ToolTip1.Show("Silahkan Hapus sebagian data.",
Me.MaskedTextBox1, Me.MaskedTextBox1.Location.X,
Me.MaskedTextBox1.Location.Y, 5000)
ElseIf (e.Position = Me.MaskedTextBox1.Mask.Length) Then
ToolTip1.ToolTipTitle = "Input data terlalu Lebar"
ToolTip1.Show("Anda tidak dapat Menambahkan Tambahan
Karakter.", Me.MaskedTextBox1, Me.MaskedTextBox1.Location.X,
Me.MaskedTextBox1.Location.Y, 5000)
Else
ToolTip1.ToolTipTitle = "Input Salah"
ToolTip1.Show("Masukan data Angka antara 0 s/d 9.",
Me.MaskedTextBox1, Me.MaskedTextBox1.Location.X,
Me.MaskedTextBox1.Location.Y, 5000)
End If
End Sub
4. Form1_Load
End Sub
7
Praktikum Pemrograman 3 ( VB.NET)
Latihan 7
1. Masukan komponen : TreeView
2. Form1_Load