0% found this document useful (0 votes)
86 views5 pages

"0812-356-2589" "Contact Person"

This document contains code for multiple forms in VB.NET. Form1 contains code to display a contact number, date/time, and menu options to open other forms. FormKondisi calculates shipping costs based on item type and weight. Form3 contains code for input boxes and listing values using For/Next and Do/While loops. Form4 allows selecting an item, entering quantity, and calculates subtotals, adding items to a list view and running total.
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
86 views5 pages

"0812-356-2589" "Contact Person"

This document contains code for multiple forms in VB.NET. Form1 contains code to display a contact number, date/time, and menu options to open other forms. FormKondisi calculates shipping costs based on item type and weight. Form3 contains code for input boxes and listing values using For/Next and Do/While loops. Form4 allows selecting an item, entering quantity, and calculates subtotals, adding items to a list view and running total.
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

Public Class Form1 Private Sub ContactPersonToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ContactPersonToolStripMenuItem.

Click MsgBox("0812-356-2589", 64, "Contact Person") End Sub Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick StatusStrip1.Items(0).Text = Format(Now, "dddd") + "," + Now.ToLongDateString StatusStrip1.Items(1).Text = Now.ToLongTimeString() StatusStrip1.Items(2).Text = "copyright @2010" End Sub Private Sub PerintahToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PerintahToolStripMenuItem.Click FormKondisi.MdiParent = Me FormKondisi.Show() End Sub Private Sub KeluarAplikasiToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles KeluarAplikasiToolStripMenuItem.Click Me.Close() End Sub Private Sub PengulanganLoopingToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PengulanganLoopingToolStripMenuItem.Click Form3.Show() End Sub Private Sub ListViewToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ListViewToolStripMenuItem.Click Form4.MdiParent = Me Form4.Show() End Sub End Class

Public Class FormKondisi Private Sub CmbJenis_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CmbJenis.SelectedIndexChanged Select Case CmbJenis.SelectedIndex Case 0 TxtBiaya.Text = 15000 Case 1 TxtBiaya.Text = 25000 End Select TxtBiaya.Text = FormatNumber(TxtBiaya.Text, 0) 'membuat format 5.000' End Sub Private Sub Btntutup_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Btnback.Click Me.Close() End Sub Private Sub TxtBerat_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TxtBerat.TextChanged txtTotal.Text = Val(Replace(TxtBiaya.Text, ".", "")) * (TxtBerat.Text) txtTotal.Text = FormatNumber(txtTotal.Text, 0) TxtBerat.Text = FormatNumber(TxtBerat.Text, 0) 'kursor ada diakhir TxtBerat.SelectionStart = Len(TxtBerat.Text) + 1 End Sub End Class

Public Class Form3 Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Txtrendah.TextChanged End Sub Private Sub Btnback_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Btnback.Click Me.Close() End Sub Private Sub BtnBrowse2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnBrowse2.Click Dim nama As String 'For x = 0 To Val(txtjum.Text) - 1 pilihan lain For x = 1 To Val(txtjum.Text) nama = InputBox("Nama Peserta ke-" & x, "Contoh For Next") ListBox1.Items.Add(nama) Next End Sub Private Sub BtnBrowse1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnBrowse1.Click Dim banyak As Integer Dim y As Integer Dim tinggi As Integer Dim rendah As Integer y = 1 Do While y <= Val(Txtbanyak.Text) banyak = InputBox("Angka ke-" & y, "Contoh Do While...Loop") ListBox2.Items.Add(banyak) If y = 1 Then tinggi = banyak : rendah = banyak ElseIf banyak > tinggi Then tinggi = banyak ElseIf banyak < rendah Then rendah = banyak End If y = y + 1 Loop txtTinggi.Text = tinggi : Txtrendah.Text = rendah End Sub End Class

Public Class Form4 Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged Select Case ComboBox1.SelectedIndex Case 0 TextBox2.Text = 12500 Case 1 TextBox2.Text = 10000 Case 2 TextBox2.Text = 9000 Case 3 TextBox2.Text = 3500 End Select TextBox2.Text = FormatNumber(TextBox2.Text, 0) TextBox3.Focus() 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 'memasukan menu, harga, jumlah, dan subtotal 'pada list view Dim LV As New ListViewItem LV = ListView1.Items.Add(ComboBox1.Text) 'Menu' LV.SubItems.Add(TextBox2.Text) 'harga LV.SubItems.Add(TextBox3.Text) 'jumlah LV.SubItems.Add(TextBox4.Text) ' sub total 'total seluruh = total seluruh + subtotal

TextBox5.Text = Val(Replace(TextBox5.Text, ".", "")) + Val(Replace(TextBox4.Text, ".", "")) TextBox5.Text = FormatNumber(TextBox5.Text, 0)

'kosongkan menu, harga, jumlah dan subtotal ComboBox1.SelectedIndex = -1 : TextBox2.Text = Nothing TextBox3.Text = Nothing : TextBox4.Text = Nothing End If End Sub

Private Sub TextBox3_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles TextBox3.TextChanged TextBox4.Text = Val(Replace(TextBox2.Text, ".", "")) * Val(TextBox3.Text) TextBox4.Text = FormatNumber(TextBox4.Text, 0) End Sub End Class

You might also like