Public Class Form1 Inherits System.Windows.Forms.Form #Region " Windows Form Designer generated code " Public Sub New() MyBase.New() 'This call is required by the Windows Form Designer. InitializeComponent() 'Add any initialization after the InitializeComponent() call End Sub 'Form overrides dispose to clean up the component list. Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean) If disposing Then If Not (components Is Nothing) Then components.Dispose() End If End If MyBase.Dispose(disposing) End Sub 'Required by the Windows Form Designer Private components As System.ComponentModel.IContainer 'NOTE: The following procedure is required by the Windows Form Designer 'It can be modified using the Windows Form Designer. 'Do not modify it using the code editor. Friend WithEvents Label1 As System.Windows.Forms.Label Friend WithEvents Button1 As System.Windows.Forms.Button Friend WithEvents Button2 As System.Windows.Forms.Button Friend WithEvents Button3 As System.Windows.Forms.Button Friend WithEvents GroupBox1 As System.Windows.Forms.GroupBox Friend WithEvents ComboBox1 As System.Windows.Forms.ComboBox Friend WithEvents GroupBox2 As System.Windows.Forms.GroupBox Friend WithEvents ComboBox2 As System.Windows.Forms.ComboBox Friend WithEvents GroupBox3 As System.Windows.Forms.GroupBox Friend WithEvents ComboBox3 As System.Windows.Forms.ComboBox Friend WithEvents GroupBox4 As System.Windows.Forms.GroupBox Friend WithEvents ListBox1 As System.Windows.Forms.ListBox Friend WithEvents GroupBox5 As System.Windows.Forms.GroupBox Friend WithEvents ListBox2 As System.Windows.Forms.ListBox Friend WithEvents ListBox3 As System.Windows.Forms.ListBox Friend WithEvents ListBox4 As System.Windows.Forms.ListBox Private Sub InitializeComponent() Me.Label1 = New System.Windows.Forms.Label Me.Button1 = New System.Windows.Forms.Button Me.Button2 = New System.Windows.Forms.Button Me.Button3 = New System.Windows.Forms.Button Me.GroupBox1 = New System.Windows.Forms.GroupBox Me.ComboBox1 = New System.Windows.Forms.ComboBox Me.GroupBox2 = New System.Windows.Forms.GroupBox Me.ComboBox2 = New System.Windows.Forms.ComboBox Me.GroupBox3 = New System.Windows.Forms.GroupBox Me.ComboBox3 = New System.Windows.Forms.ComboBox Me.GroupBox4 = New System.Windows.Forms.GroupBox Me.ListBox1 = New System.Windows.Forms.ListBox Me.GroupBox5 = New System.Windows.Forms.GroupBox Me.ListBox4 = New System.Windows.Forms.ListBox Me.ListBox3 = New System.Windows.Forms.ListBox Me.ListBox2 = New System.Windows.Forms.ListBox Me.GroupBox1.SuspendLayout() Me.GroupBox2.SuspendLayout() Me.GroupBox3.SuspendLayout() Me.GroupBox4.SuspendLayout() Me.GroupBox5.SuspendLayout() Me.SuspendLayout() ' 'Label1 ' Me.Label1.Font = New System.Drawing.Font("Microsoft Sans Serif", 14.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Label1.Location = New System.Drawing.Point(32, 8) Me.Label1.Name = "Label1" Me.Label1.Size = New System.Drawing.Size(296, 32) Me.Label1.TabIndex = 0 Me.Label1.Text = "High Tech Computer Store, Eh" ' 'Button1 ' Me.Button1.Font = New System.Drawing.Font("Microsoft Sans Serif", 12.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Button1.Location = New System.Drawing.Point(16, 16) Me.Button1.Name = "Button1" Me.Button1.Size = New System.Drawing.Size(88, 32) Me.Button1.TabIndex = 1 Me.Button1.Text = "Order" ' 'Button2 ' Me.Button2.Font = New System.Drawing.Font("Microsoft Sans Serif", 12.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Button2.Location = New System.Drawing.Point(120, 16) Me.Button2.Name = "Button2" Me.Button2.Size = New System.Drawing.Size(96, 32) Me.Button2.TabIndex = 2 Me.Button2.Text = "Reset" ' 'Button3 ' Me.Button3.Font = New System.Drawing.Font("Microsoft Sans Serif", 12.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Button3.Location = New System.Drawing.Point(232, 16) Me.Button3.Name = "Button3" Me.Button3.Size = New System.Drawing.Size(96, 32) Me.Button3.TabIndex = 3 Me.Button3.Text = "Close" ' 'GroupBox1 ' Me.GroupBox1.Controls.Add(Me.ComboBox1) Me.GroupBox1.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.GroupBox1.Location = New System.Drawing.Point(16, 40) Me.GroupBox1.Name = "GroupBox1" Me.GroupBox1.Size = New System.Drawing.Size(160, 48) Me.GroupBox1.TabIndex = 4 Me.GroupBox1.TabStop = False Me.GroupBox1.Text = "Manufacturer" ' 'ComboBox1 ' Me.ComboBox1.Items.AddRange(New Object() {"select", "Dell", "Hewlett Packard", "IBM", "Gateway"}) Me.ComboBox1.Location = New System.Drawing.Point(8, 16) Me.ComboBox1.Name = "ComboBox1" Me.ComboBox1.Size = New System.Drawing.Size(144, 23) Me.ComboBox1.TabIndex = 0 Me.ComboBox1.Text = "select" ' 'GroupBox2 ' Me.GroupBox2.Controls.Add(Me.ComboBox2) Me.GroupBox2.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.GroupBox2.Location = New System.Drawing.Point(16, 96) Me.GroupBox2.Name = "GroupBox2" Me.GroupBox2.Size = New System.Drawing.Size(160, 48) Me.GroupBox2.TabIndex = 5 Me.GroupBox2.TabStop = False Me.GroupBox2.Text = "Memory Package" ' 'ComboBox2 ' Me.ComboBox2.Items.AddRange(New Object() {"select ", "512 MB DDR 333", "1 GB DDR 333", "2 GB DDR 333", "3 GB DDR 333"}) Me.ComboBox2.Location = New System.Drawing.Point(8, 16) Me.ComboBox2.Name = "ComboBox2" Me.ComboBox2.Size = New System.Drawing.Size(144, 23) Me.ComboBox2.TabIndex = 0 Me.ComboBox2.Text = "select " ' 'GroupBox3 ' Me.GroupBox3.Controls.Add(Me.ComboBox3) Me.GroupBox3.Location = New System.Drawing.Point(16, 152) Me.GroupBox3.Name = "GroupBox3" Me.GroupBox3.Size = New System.Drawing.Size(160, 48) Me.GroupBox3.TabIndex = 6 Me.GroupBox3.TabStop = False Me.GroupBox3.Text = "Monitor Combo" ' 'ComboBox3 ' Me.ComboBox3.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.ComboBox3.Items.AddRange(New Object() {"select", "15 inch CRT", "17 inch CRT", "17 inch LCD", "19 inch LCD"}) Me.ComboBox3.Location = New System.Drawing.Point(8, 16) Me.ComboBox3.Name = "ComboBox3" Me.ComboBox3.Size = New System.Drawing.Size(144, 23) Me.ComboBox3.TabIndex = 0 Me.ComboBox3.Text = "select" ' 'GroupBox4 ' Me.GroupBox4.Controls.Add(Me.Button1) Me.GroupBox4.Controls.Add(Me.Button3) Me.GroupBox4.Controls.Add(Me.Button2) Me.GroupBox4.Location = New System.Drawing.Point(8, 312) Me.GroupBox4.Name = "GroupBox4" Me.GroupBox4.Size = New System.Drawing.Size(344, 56) Me.GroupBox4.TabIndex = 7 Me.GroupBox4.TabStop = False ' 'ListBox1 ' Me.ListBox1.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.ListBox1.ItemHeight = 15 Me.ListBox1.Items.AddRange(New Object() {" Welcome to Order Processing"}) Me.ListBox1.Location = New System.Drawing.Point(16, 208) Me.ListBox1.Name = "ListBox1" Me.ListBox1.Size = New System.Drawing.Size(336, 94) Me.ListBox1.TabIndex = 8 ' 'GroupBox5 ' Me.GroupBox5.Controls.Add(Me.ListBox4) Me.GroupBox5.Controls.Add(Me.ListBox3) Me.GroupBox5.Controls.Add(Me.ListBox2) Me.GroupBox5.Location = New System.Drawing.Point(192, 40) Me.GroupBox5.Name = "GroupBox5" Me.GroupBox5.Size = New System.Drawing.Size(160, 160) Me.GroupBox5.TabIndex = 9 Me.GroupBox5.TabStop = False Me.GroupBox5.Text = "Item Costs" ' 'ListBox4 ' Me.ListBox4.Font = New System.Drawing.Font("Microsoft Sans Serif", 12.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.ListBox4.ItemHeight = 20 Me.ListBox4.Location = New System.Drawing.Point(8, 120) Me.ListBox4.Name = "ListBox4" Me.ListBox4.Size = New System.Drawing.Size(136, 24) Me.ListBox4.TabIndex = 2 ' 'ListBox3 ' Me.ListBox3.Font = New System.Drawing.Font("Microsoft Sans Serif", 12.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.ListBox3.ItemHeight = 20 Me.ListBox3.Location = New System.Drawing.Point(8, 72) Me.ListBox3.Name = "ListBox3" Me.ListBox3.Size = New System.Drawing.Size(136, 24) Me.ListBox3.TabIndex = 1 ' 'ListBox2 ' Me.ListBox2.Font = New System.Drawing.Font("Microsoft Sans Serif", 12.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.ListBox2.ItemHeight = 20 Me.ListBox2.Location = New System.Drawing.Point(8, 16) Me.ListBox2.Name = "ListBox2" Me.ListBox2.Size = New System.Drawing.Size(136, 24) Me.ListBox2.TabIndex = 0 ' 'Form1 ' Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13) Me.BackColor = System.Drawing.SystemColors.InactiveCaption Me.ClientSize = New System.Drawing.Size(360, 373) Me.Controls.Add(Me.GroupBox5) Me.Controls.Add(Me.ListBox1) Me.Controls.Add(Me.GroupBox4) Me.Controls.Add(Me.GroupBox3) Me.Controls.Add(Me.GroupBox2) Me.Controls.Add(Me.GroupBox1) Me.Controls.Add(Me.Label1) Me.Name = "Form1" Me.Text = "Computer Store Ordering" Me.GroupBox1.ResumeLayout(False) Me.GroupBox2.ResumeLayout(False) Me.GroupBox3.ResumeLayout(False) Me.GroupBox4.ResumeLayout(False) Me.GroupBox5.ResumeLayout(False) Me.ResumeLayout(False) End Sub #End Region Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim brand_cost As Double Dim ram_cost As Double Dim mon_cost As Double Dim total As Double checker() ListBox1.Items.Clear() ListBox1.Items.Add(" Welcome to Order Processing") brand(brand_cost) memory(ram_cost) monitor(mon_cost) total = brand_cost + ram_cost + mon_cost ListBox1.Items.Add("Final Cost :" & Format(total, "currency")) End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click ListBox1.Items.Clear() ListBox2.Items.Clear() ListBox3.Items.Clear() ListBox4.Items.Clear() ComboBox1.Text = "select" ComboBox2.Text = "select" ComboBox3.Text = "select" End Sub Sub checker() If ComboBox1.Text = "select" Then MessageBox.Show("Please select brand", "Missing Information") Exit Sub End If If ComboBox2.Text = "select" Then MessageBox.Show("Please select RAM", "Missing Information") Exit Sub End If If ComboBox3.Text = "select" Then MessageBox.Show("Please select Monitor", "Missing Information") Exit Sub End If End Sub Sub brand(ByRef brand_cost As Double) Select Case ComboBox1.Text Case "Dell" ListBox2.Items.Clear() ListBox2.Items.Add("Item :" & Format(300, "currency")) brand_cost = 300 ListBox1.Items.Add("Dell :" & Format(300, "currency")) Case "Hewlett Packard" ListBox2.Items.Clear() ListBox2.Items.Add("Item :" & Format(200, "currency")) brand_cost = 200 ListBox1.Items.Add("Hewlett Packard :" & Format(200, "currency")) Case "IBM" ListBox2.Items.Clear() ListBox2.Items.Add("Item :" & Format(500, "currency")) brand_cost = 500 ListBox1.Items.Add("IBM :" & Format(500, "currency")) Case "Gateway" ListBox2.Items.Clear() ListBox2.Items.Add("Item :" & Format(250, "currency")) brand_cost = 250 ListBox1.Items.Add("Gateway :" & Format(250, "currency")) End Select End Sub Sub memory(ByRef ram_cost As Double) Select Case ComboBox2.Text Case "512 MB DDR 333" ListBox3.Items.Clear() ListBox3.Items.Add("Item :" & Format(50, "currency")) ram_cost = 50 ListBox1.Items.Add("512 MB RAM :" & Format(50, "currency")) Case "1 GB DDR 333" ListBox3.Items.Clear() ListBox3.Items.Add("Item :" & Format(75, "currency")) ram_cost = 75 ListBox1.Items.Add("1 GB RAM :" & Format(75, "currency")) Case "2 GB DDR 333" ListBox3.Items.Clear() ListBox3.Items.Add("Item :" & Format(125, "currency")) ram_cost = 125 ListBox1.Items.Add("2 GB RAM :" & Format(125, "currency")) Case "3 GB DDR 333" ListBox3.Items.Clear() ListBox3.Items.Add("Item :" & Format(200, "currency")) ram_cost = 200 ListBox1.Items.Add("3 GB RAM :" & Format(200, "currency")) End Select End Sub Sub monitor(ByRef mon_cost As Double) Select Case ComboBox3.Text Case "15 inch CRT" ListBox4.Items.Clear() ListBox4.Items.Add("Item :" & Format(50, "currency")) mon_cost = 50 ListBox1.Items.Add("15 Inch CRT :" & Format(50, "currency")) Case "17 inch CRT" ListBox4.Items.Clear() ListBox4.Items.Add("Item :" & Format(75, "currency")) mon_cost = 75 ListBox1.Items.Add("17 inch CRT :" & Format(75, "currency")) Case "17 inch LCD" ListBox4.Items.Clear() ListBox4.Items.Add("Item :" & Format(100, "currency")) mon_cost = 100 ListBox1.Items.Add("17 inch LCD :" & Format(100, "currency")) Case "19 inch LCD" ListBox4.Items.Clear() ListBox4.Items.Add("Item :" & Format(150, "currency")) mon_cost = 150 ListBox1.Items.Add("19 inch LCD :" & Format(150, "currency")) End Select End Sub Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click Me.Close() End Sub End Class