home *** CD-ROM | disk | FTP | other *** search
- VERSION 5.00
- Begin VB.Form frm5_2_2
- Caption = "Profit/Loss"
- ClientHeight = 2250
- ClientLeft = 2190
- ClientTop = 1740
- ClientWidth = 2415
- 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 = 2250
- ScaleWidth = 2415
- Begin VB.PictureBox picResult
- Height = 255
- Left = 120
- ScaleHeight = 195
- ScaleWidth = 2115
- TabIndex = 5
- Top = 1800
- Width = 2175
- End
- Begin VB.CommandButton cmdShow
- Caption = "Show Financial Status"
- Height = 495
- Left = 120
- TabIndex = 4
- Top = 1080
- Width = 2175
- End
- Begin VB.TextBox txtRev
- Height = 285
- Left = 1080
- TabIndex = 3
- Top = 600
- Width = 1215
- End
- Begin VB.TextBox txtCosts
- Height = 285
- Left = 1080
- TabIndex = 1
- Top = 120
- Width = 1215
- End
- Begin VB.Label lblRev
- Alignment = 1 'Right Justify
- Caption = "Revenue"
- Height = 255
- Left = 0
- TabIndex = 2
- Top = 600
- Width = 855
- End
- Begin VB.Label lblCosts
- Alignment = 1 'Right Justify
- Caption = "Costs"
- Height = 255
- Left = 240
- TabIndex = 0
- Top = 120
- Width = 615
- End
- Attribute VB_Name = "frm5_2_2"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- Private Sub cmdShow_Click()
- Dim costs As Single, revenue As Single, profit As Single, loss As Single
- costs = Val(txtCosts.Text)
- revenue = Val(txtRev.Text)
- picResult.Cls
- If costs = revenue Then
- picResult.Print "Break even"
- Else
- If costs < revenue Then
- profit = revenue - costs
- picResult.Print "Profit is "; FormatCurrency(profit)
- Else
- loss = costs - revenue
- picResult.Print "Loss is "; FormatCurrency(loss)
- End If
- End If
- End Sub
-