Form 1:
Form 2
pada form ini menampilkan tanggal,bulan dan tahun,yang bisa kita masukkan pada koding.
berikut adalah kodding untuk form 2:
Public Class Form2
Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim tgl As Integer
For tgl = 1 To 31
ComboBox1.Items.Add(tgl)
Next
Dim bulan As Integer
For bulan = 1 To 12
ComboBox2.Items.Add(MonthName(bulan))
Next
Dim tahun As Integer
For tahun = 2000 To 1945 Step -1
ComboBox3.Items.Add(tahun)
Next
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Form3.Show()
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
End
End Sub
End Class
Form 3
setelah kita men-check list pilihan "alasan memilih merek tsb" maka akan tampil seperti berikutakan muncul combo box "Kegunaan". Berikut adalah koding untuk form 3:
Public Class Form3
Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Form4.Show()
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
End
End Sub
Private Sub CheckBox1_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckBox1.CheckedChanged
If CheckBox1.Checked = True Then
Label3.Visible = True
ComboBox2.Visible = True
If CheckBox2.Checked = True Then
Label3.Visible = True
ComboBox2.Visible = True
If CheckBox3.Checked = True Then
Label3.Visible = True
ComboBox2.Visible = True
If CheckBox4.Checked = True Then
Label3.Visible = True
ComboBox2.Visible = True
If CheckBox5.Checked = True Then
Label3.Visible = True
ComboBox2.Visible = True
End If
End If
End If
End If
End If
End Sub
Private Sub Form3_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
End Class
Form 4
berikut tampilan form setelah radio button "Ya" di pilih
kodingnya adalah sebagai berikut:Public Class Form4
Private Sub Form4_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim tgl As Integer
For tgl = 1 To 31
ComboBox1.Items.Add(tgl)
Next
Dim tahun As Integer
For tahun = 2011 To 1945 Step -1
ComboBox2.Items.Add(tahun)
Next
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Form5.Show()
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
End
End Sub
Private Sub RadioButton1_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton1.CheckedChanged
If RadioButton1.Checked = True Then
GroupBox2.Visible = True
End If
End Sub
Private Sub ComboBox2_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox2.SelectedIndexChanged
End Sub
End Class
Form 5
pada form ini anda diminta untuk memasukkan no.handphone dan alamat e-mail. tapi ketika anda ingin memasukkannya,anda akan diminta memasukkannya dalam "Input Box". Berikut adalah kodingnya:
Public Class Form5
Private Sub TextBox1_MouseClick(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles TextBox1.MouseClick
Dim x As String
x = InputBox("Masukkan Nomor Handphone Anda")
TextBox1.Text = x
End Sub
Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged
End Sub
Private Sub TextBox2_MouseClick(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles TextBox2.MouseClick
Dim y As String
y = InputBox("Masukkan Alamat E-mail Anda")
TextBox2.Text = y
End Sub
Private Sub TextBox2_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox2.TextChanged
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Form6.Show()
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
End
End Sub
Private Sub Form5_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
End Class
Form 6
form ini merupakan form akhir dari survey/tugas yang saya buat
ketika tombol start di tekan maka angka dalam textbox dan label2 akan berubah,karena menggunakan fungsi timer. lalu apa yang terjadi apabila tombol "Stop" ditekan
berikut adalah kodingnya:
Public Class Form6
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
Dim a As Integer
For a = 1 To 1000
TextBox1.Text = Rnd(a)
Label2.Text = Strings.Mid(TextBox1.Text, 3, 1)
Next
End Sub
Dim a As Integer
For a = 1 To 1000
TextBox1.Text = Rnd(a)
Label2.Text = Strings.Mid(TextBox1.Text, 3, 1)
Next
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Timer1.Enabled = True
Timer1.Enabled = True
If Button1.Text = "&Start" Then
Timer1.Enabled = True
Button1.Text = "Stop"
Timer1.Enabled = True
Button1.Text = "Stop"
Else
Timer1.Enabled = False
Button1.Text = "&Start"
Timer1.Enabled = False
Button1.Text = "&Start"
End If
Select Case Label2.Text
Case 1
Label3.Text = "Helm"
PictureBox1.Visible = True
PictureBox2.Visible = False
PictureBox3.Visible = False
PictureBox4.Visible = False
Case 2, 3
Label3.Text = "Jaket"
PictureBox1.Visible = False
PictureBox2.Visible = True
PictureBox3.Visible = False
PictureBox4.Visible = False
Case 4, 7
Label3.Text = "Glove"
PictureBox1.Visible = False
PictureBox2.Visible = False
PictureBox3.Visible = True
PictureBox4.Visible = False
Case 5, 6
Label3.Text = "Sepatu"
PictureBox1.Visible = False
PictureBox2.Visible = False
PictureBox3.Visible = False
PictureBox4.Visible = True
Case 0, 8, 9
Label3.Text = "Anda belum beruntung"
End Select
End Sub
Label3.Text = "Jaket"
PictureBox1.Visible = False
PictureBox2.Visible = True
PictureBox3.Visible = False
PictureBox4.Visible = False
Case 4, 7
Label3.Text = "Glove"
PictureBox1.Visible = False
PictureBox2.Visible = False
PictureBox3.Visible = True
PictureBox4.Visible = False
Case 5, 6
Label3.Text = "Sepatu"
PictureBox1.Visible = False
PictureBox2.Visible = False
PictureBox3.Visible = False
PictureBox4.Visible = True
Case 0, 8, 9
Label3.Text = "Anda belum beruntung"
End Select
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
MessageBox.Show("Terima Kasih Atas Partisipasi Anda", "Kementrian Perindustrian", MessageBoxButtons.OK, MessageBoxIcon.Information)
End Sub
MessageBox.Show("Terima Kasih Atas Partisipasi Anda", "Kementrian Perindustrian", MessageBoxButtons.OK, MessageBoxIcon.Information)
End Sub
Private Sub Form6_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
End Class
End Class
Sekian dan Terima Kasih :D