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 ComboBox1 As System.Windows.Forms.ComboBox Friend WithEvents GroupBox1 As System.Windows.Forms.GroupBox Friend WithEvents Label1 As System.Windows.Forms.Label Friend WithEvents Label2 As System.Windows.Forms.Label Friend WithEvents Label3 As System.Windows.Forms.Label Friend WithEvents Label4 As System.Windows.Forms.Label Friend WithEvents Label5 As System.Windows.Forms.Label Friend WithEvents TextBox1 As System.Windows.Forms.TextBox Friend WithEvents TextBox2 As System.Windows.Forms.TextBox Friend WithEvents TextBox3 As System.Windows.Forms.TextBox Friend WithEvents ListBox1 As System.Windows.Forms.ListBox 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 Button4 As System.Windows.Forms.Button Private Sub InitializeComponent() Me.ComboBox1 = New System.Windows.Forms.ComboBox Me.GroupBox1 = New System.Windows.Forms.GroupBox Me.Label1 = New System.Windows.Forms.Label Me.Label2 = New System.Windows.Forms.Label Me.Label3 = New System.Windows.Forms.Label Me.Label4 = New System.Windows.Forms.Label Me.Label5 = New System.Windows.Forms.Label Me.TextBox1 = New System.Windows.Forms.TextBox Me.TextBox2 = New System.Windows.Forms.TextBox Me.TextBox3 = New System.Windows.Forms.TextBox Me.ListBox1 = New System.Windows.Forms.ListBox Me.Button1 = New System.Windows.Forms.Button Me.Button2 = New System.Windows.Forms.Button Me.Button3 = New System.Windows.Forms.Button Me.Button4 = New System.Windows.Forms.Button Me.GroupBox1.SuspendLayout() Me.SuspendLayout() ' 'ComboBox1 ' Me.ComboBox1.Items.AddRange(New Object() {"select", "Mutual Fund (7%)", "Bond Fund (6%)", "Treasury Fund (5%)", "Money Market (4%)"}) Me.ComboBox1.Location = New System.Drawing.Point(16, 16) Me.ComboBox1.Name = "ComboBox1" Me.ComboBox1.Size = New System.Drawing.Size(121, 21) Me.ComboBox1.TabIndex = 0 Me.ComboBox1.Text = "select" ' 'GroupBox1 ' Me.GroupBox1.Controls.Add(Me.ComboBox1) Me.GroupBox1.Location = New System.Drawing.Point(144, 40) Me.GroupBox1.Name = "GroupBox1" Me.GroupBox1.Size = New System.Drawing.Size(152, 40) Me.GroupBox1.TabIndex = 1 Me.GroupBox1.TabStop = False Me.GroupBox1.Text = "Investment Options" ' 'Label1 ' Me.Label1.Font = New System.Drawing.Font("Microsoft Sans Serif", 10.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Label1.Location = New System.Drawing.Point(24, 8) Me.Label1.Name = "Label1" Me.Label1.Size = New System.Drawing.Size(240, 24) Me.Label1.TabIndex = 2 Me.Label1.Text = "ABC Investment Company Program" ' 'Label2 ' Me.Label2.Location = New System.Drawing.Point(24, 56) Me.Label2.Name = "Label2" Me.Label2.TabIndex = 3 Me.Label2.Text = "Investment Type" ' 'Label3 ' Me.Label3.Location = New System.Drawing.Point(24, 88) Me.Label3.Name = "Label3" Me.Label3.TabIndex = 4 Me.Label3.Text = "Name" ' 'Label4 ' Me.Label4.Location = New System.Drawing.Point(24, 120) Me.Label4.Name = "Label4" Me.Label4.TabIndex = 5 Me.Label4.Text = "Amount Invested" ' 'Label5 ' Me.Label5.Location = New System.Drawing.Point(24, 144) Me.Label5.Name = "Label5" Me.Label5.TabIndex = 6 Me.Label5.Text = "Years Invested" ' 'TextBox1 ' Me.TextBox1.Location = New System.Drawing.Point(160, 88) Me.TextBox1.Name = "TextBox1" Me.TextBox1.TabIndex = 7 Me.TextBox1.Text = "" ' 'TextBox2 ' Me.TextBox2.Location = New System.Drawing.Point(160, 120) Me.TextBox2.Name = "TextBox2" Me.TextBox2.TabIndex = 8 Me.TextBox2.Text = "" ' 'TextBox3 ' Me.TextBox3.Location = New System.Drawing.Point(160, 144) Me.TextBox3.Name = "TextBox3" Me.TextBox3.TabIndex = 9 Me.TextBox3.Text = "" ' 'ListBox1 ' Me.ListBox1.Location = New System.Drawing.Point(8, 168) Me.ListBox1.Name = "ListBox1" Me.ListBox1.Size = New System.Drawing.Size(304, 108) Me.ListBox1.TabIndex = 10 ListBox1.Items.Add(" Welcome to our investment suite") ' 'Button1 ' Me.Button1.Location = New System.Drawing.Point(8, 288) Me.Button1.Name = "Button1" Me.Button1.Size = New System.Drawing.Size(64, 32) Me.Button1.TabIndex = 11 Me.Button1.Text = "Calculate" ' 'Button2 ' Me.Button2.Location = New System.Drawing.Point(88, 288) Me.Button2.Name = "Button2" Me.Button2.Size = New System.Drawing.Size(64, 32) Me.Button2.TabIndex = 12 Me.Button2.Text = "Update" ' 'Button3 ' Me.Button3.Location = New System.Drawing.Point(168, 288) Me.Button3.Name = "Button3" Me.Button3.Size = New System.Drawing.Size(64, 32) Me.Button3.TabIndex = 13 Me.Button3.Text = "Clear" ' 'Button4 ' Me.Button4.Location = New System.Drawing.Point(248, 288) Me.Button4.Name = "Button4" Me.Button4.Size = New System.Drawing.Size(64, 32) Me.Button4.TabIndex = 14 Me.Button4.Text = "Quit" ' 'Form1 ' Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13) Me.ClientSize = New System.Drawing.Size(320, 333) Me.Controls.Add(Me.Button4) Me.Controls.Add(Me.Button3) Me.Controls.Add(Me.Button2) Me.Controls.Add(Me.Button1) Me.Controls.Add(Me.ListBox1) Me.Controls.Add(Me.TextBox3) Me.Controls.Add(Me.TextBox2) Me.Controls.Add(Me.TextBox1) Me.Controls.Add(Me.Label5) Me.Controls.Add(Me.Label4) Me.Controls.Add(Me.Label3) Me.Controls.Add(Me.Label2) Me.Controls.Add(Me.Label1) Me.Controls.Add(Me.GroupBox1) Me.Name = "Form1" Me.Text = "ABC Investment Company" Me.GroupBox1.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 checker() Dim invest As String Dim name As String Dim amt As Double Dim years As Integer Dim percent As Double Dim current As Integer invest = ComboBox1.Text name = TextBox1.Text amt = CDbl(TextBox2.Text) years = CDbl(TextBox3.Text) current = 2004 Select Case ComboBox1.SelectedIndex Case 1 percent = 1.07 Case 2 percent = 1.06 Case 3 percent = 1.05 Case 4 percent = 1.04 Case 5 To 20 percent = 1.02 MessageBox.Show("For making up your own Investment Fund you have a 2% interest rate") End Select ListBox1.Items.Clear() ListBox1.Items.Add(name & " here is a report on your investment") ListBox1.Items.Add(Format(amt, "currency") & " Invested for " & years & " years in " & invest) For current = 2004 To (current + years) Step 1 ListBox1.Items.Add("In " & current & " your investment will be worth " & Format(amt, "currency")) amt = amt * percent Next ListBox1.Items.Add("We hope you are satisfied with the value of your investment") End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click Dim value As Integer Dim hold As Integer Dim name As String Dim finale As Integer value = MessageBox.Show("Do you want to delete an Investment", "Delete Investment", MessageBoxButtons.YesNo) If value = DialogResult.Yes Then hold = ComboBox1.SelectedIndex ComboBox1.Items.RemoveAt(hold) End If value = MessageBox.Show("Do you want to replace an Investment", "Replace Investment", MessageBoxButtons.YesNo) If value = DialogResult.Yes Then hold = ComboBox1.SelectedIndex name = InputBox("Enter new Investment", "Enter Investment") ComboBox1.Items.RemoveAt(hold) ComboBox1.Items.Insert(hold, name) Else name = InputBox("Enter new Investment", "Enter Investment") hold = ComboBox1.SelectedIndex Do While finale < 1 If ComboBox1.SelectedText = "" Then finale = 1 ComboBox1.Items.Add(name) Else hold = hold + 1 End If Loop End If End Sub Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click ComboBox1.Text = "select" TextBox1.Clear() TextBox2.Clear() TextBox3.Clear() ListBox1.Items.Clear() ListBox1.Items.Add(" Welcome to our investment suite") End Sub Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click Me.Close() End Sub Sub checker() If ComboBox1.Text = "select" Then MessageBox.Show("Please select brand", "Missing Information") Exit Sub End If If TextBox1.Text = "" Then MessageBox.Show("Please Enter Name", "Missing Information") Exit Sub End If If TextBox2.Text = "" Then MessageBox.Show("Please Enter Amount", "Missing Information") Exit Sub End If If TextBox3.Text = "" Then MessageBox.Show("Please Enter Years", "Missing Information") Exit Sub End If End Sub End Class