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

Visual Basic Form Application Code

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)
6 views5 pages

Visual Basic Form Application Code

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

Public Class Form1 Private Sub ContactPersonToolStripMenuItem_Click(ByVal sender As [Link], ByVal e As [Link]) Handles ContactPersonToolStripMenuItem.

Click MsgBox("0812-356-2589", 64, "Contact Person") End Sub Private Sub Timer1_Tick(ByVal sender As [Link], ByVal e As [Link]) Handles [Link] [Link](0).Text = Format(Now, "dddd") + "," + [Link] [Link](1).Text = [Link]() [Link](2).Text = "copyright @2010" End Sub Private Sub PerintahToolStripMenuItem_Click(ByVal sender As [Link], ByVal e As [Link]) Handles [Link] [Link] = Me [Link]() End Sub Private Sub KeluarAplikasiToolStripMenuItem_Click(ByVal sender As [Link], ByVal e As [Link]) Handles [Link] [Link]() End Sub Private Sub PengulanganLoopingToolStripMenuItem_Click(ByVal sender As [Link], ByVal e As [Link]) Handles [Link] [Link]() End Sub Private Sub ListViewToolStripMenuItem_Click(ByVal sender As [Link], ByVal e As [Link]) Handles [Link] [Link] = Me [Link]() End Sub End Class

Public Class FormKondisi Private Sub CmbJenis_SelectedIndexChanged(ByVal sender As [Link], ByVal e As [Link]) Handles [Link] Select Case [Link] Case 0 [Link] = 15000 Case 1 [Link] = 25000 End Select [Link] = FormatNumber([Link], 0) 'membuat format 5.000' End Sub Private Sub Btntutup_Click(ByVal sender As [Link], ByVal e As [Link]) Handles [Link] [Link]() End Sub Private Sub TxtBerat_TextChanged(ByVal sender As [Link], ByVal e As [Link]) Handles [Link] [Link] = Val(Replace([Link], ".", "")) * ([Link]) [Link] = FormatNumber([Link], 0) [Link] = FormatNumber([Link], 0) 'kursor ada diakhir [Link] = Len([Link]) + 1 End Sub End Class

Public Class Form3 Private Sub TextBox1_TextChanged(ByVal sender As [Link], ByVal e As [Link]) Handles [Link] End Sub Private Sub Btnback_Click(ByVal sender As [Link], ByVal e As [Link]) Handles [Link] [Link]() End Sub Private Sub BtnBrowse2_Click(ByVal sender As [Link], ByVal e As [Link]) Handles [Link] Dim nama As String 'For x = 0 To Val([Link]) - 1 pilihan lain For x = 1 To Val([Link]) nama = InputBox("Nama Peserta ke-" & x, "Contoh For Next") [Link](nama) Next End Sub Private Sub BtnBrowse1_Click(ByVal sender As [Link], ByVal e As [Link]) Handles [Link] Dim banyak As Integer Dim y As Integer Dim tinggi As Integer Dim rendah As Integer y = 1 Do While y <= Val([Link]) banyak = InputBox("Angka ke-" & y, "Contoh Do While...Loop") [Link](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 [Link] = tinggi : [Link] = rendah End Sub End Class

Public Class Form4 Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As [Link], ByVal e As [Link]) Handles [Link] Select Case [Link] Case 0 [Link] = 12500 Case 1 [Link] = 10000 Case 2 [Link] = 9000 Case 3 [Link] = 3500 End Select [Link] = FormatNumber([Link], 0) [Link]() End Sub Private Sub TextBox3_KeyPress(ByVal sender As Object, ByVal e As [Link]) Handles [Link] If [Link] = Chr(13) Then 'memasukan menu, harga, jumlah, dan subtotal 'pada list view Dim LV As New ListViewItem LV = [Link]([Link]) 'Menu' [Link]([Link]) 'harga [Link]([Link]) 'jumlah [Link]([Link]) ' sub total 'total seluruh = total seluruh + subtotal

[Link] = Val(Replace([Link], ".", "")) + Val(Replace([Link], ".", "")) [Link] = FormatNumber([Link], 0)

'kosongkan menu, harga, jumlah dan subtotal [Link] = -1 : [Link] = Nothing [Link] = Nothing : [Link] = Nothing End If End Sub

Private Sub TextBox3_TextChanged(ByVal sender As Object, ByVal e As [Link]) Handles [Link] [Link] = Val(Replace([Link], ".", "")) * Val([Link]) [Link] = FormatNumber([Link], 0) End Sub End Class

You might also like