home *** CD-ROM | disk | FTP | other *** search
- VERSION 5.00
- Begin VB.Form frm7_2_2
- Caption = "Stocks"
- ClientHeight = 3840
- ClientLeft = 1080
- ClientTop = 2025
- ClientWidth = 4680
- BeginProperty Font
- Name = "MS Sans Serif"
- Size = 8.25
- Charset = 0
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- LinkTopic = "Form1"
- PaletteMode = 1 'UseZOrder
- ScaleHeight = 3840
- ScaleWidth = 4680
- Begin VB.PictureBox picStocks
- Height = 2535
- Left = 120
- ScaleHeight = 2475
- ScaleWidth = 4395
- TabIndex = 4
- Top = 1200
- Width = 4455
- End
- Begin VB.CommandButton cmdSummarize
- Caption = "Summarize"
- Height = 375
- Left = 3360
- TabIndex = 3
- Top = 720
- Width = 1215
- End
- Begin VB.CommandButton cmdRecord
- Caption = "Record Name"
- Height = 375
- Left = 1800
- TabIndex = 2
- Top = 720
- Width = 1455
- End
- Begin VB.TextBox txtCompany
- Height = 285
- Left = 1800
- TabIndex = 1
- Text = " "
- Top = 360
- Width = 2775
- End
- Begin VB.Label lblInstructions
- Caption = "Enter up to 100 companies whose stock you own."
- Height = 255
- Left = 120
- TabIndex = 5
- Top = 0
- Width = 4335
- End
- Begin VB.Label lblName
- Caption = "Name of company:"
- Height = 255
- Left = 120
- TabIndex = 0
- Top = 360
- Width = 1695
- End
- Attribute VB_Name = "frm7_2_2"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- Dim stock(1 To 100) As String
- Dim counter As Integer
- Private Sub cmdRecord_Click()
- If (counter < 100) Then
- counter = counter + 1
- stock(counter) = txtCompany.Text
- txtCompany.Text = ""
- txtCompany.SetFocus
- Else
- MsgBox "No space to record additional companies.", , ""
- txtCompany.Text = ""
- cmdSummarize.SetFocus
- End If
- End Sub
- Private Sub cmdSummarize_Click()
- Dim i As Integer
- 'List stock company that have been recorded
- picStocks.Cls
- picStocks.Print "You own the following"; counter; "stocks."
- For i = 1 To counter
- picStocks.Print stock(i) & " ";
- 'Move to new line after every 5 stocks
- If Int(i / 5) = i / 5 Then
- picStocks.Print
- End If
- Next i
- End Sub
- Private Sub Form_Load()
- 'Initialize count of companies
- counter = 0
- End Sub
-