home *** CD-ROM | disk | FTP | other *** search
- VERSION 2.00
- Begin Form Main_Form
- BackColor = &H00C0C0C0&
- Caption = "WindChill Calculator"
- ClientHeight = 3870
- ClientLeft = 1290
- ClientTop = 2205
- ClientWidth = 7425
- Height = 4560
- Icon = MAIN_FOR.FRX:0000
- Left = 1230
- LinkMode = 1 'Source
- LinkTopic = "Form1"
- MaxButton = 0 'False
- ScaleHeight = 3870
- ScaleWidth = 7425
- Top = 1575
- Width = 7545
- Begin CommandButton Command2
- BackColor = &H00C0C0C0&
- Caption = "Another"
- Height = 495
- Left = 3960
- TabIndex = 12
- Top = 3000
- Width = 3255
- End
- Begin CommandButton Command1
- BackColor = &H00C0C0C0&
- Caption = "Convert"
- Default = -1 'True
- Height = 495
- Left = 3960
- TabIndex = 11
- Top = 2520
- Width = 3255
- End
- Begin PictureBox Picture3
- BackColor = &H00C0C0C0&
- BorderStyle = 0 'None
- Height = 975
- Left = 240
- ScaleHeight = 975
- ScaleWidth = 3375
- TabIndex = 16
- Top = 2520
- Width = 3375
- Begin Label Label9
- Alignment = 2 'Center
- BackColor = &H00C0C0C0&
- ForeColor = &H00FF0000&
- Height = 255
- Left = 1800
- TabIndex = 0
- Top = 360
- Width = 1455
- End
- Begin Label Label10
- Alignment = 2 'Center
- BackColor = &H00C0C0C0&
- Caption = "WindChill is =>"
- Height = 255
- Left = 120
- TabIndex = 1
- Top = 360
- Width = 1575
- End
- End
- Begin PictureBox Picture2
- BackColor = &H00C0C0C0&
- BorderStyle = 0 'None
- Height = 1815
- Left = 3960
- ScaleHeight = 1815
- ScaleWidth = 3255
- TabIndex = 13
- Top = 360
- Width = 3255
- Begin Label Label8
- Alignment = 2 'Center
- BackColor = &H00C0C0C0&
- Caption = "Degrees Celcius"
- Height = 255
- Left = 1320
- TabIndex = 2
- Top = 1200
- Width = 1815
- End
- Begin Label Label6
- Alignment = 2 'Center
- BackColor = &H00C0C0C0&
- ForeColor = &H00FF0000&
- Height = 255
- Left = 120
- TabIndex = 4
- Top = 1200
- Width = 1095
- End
- Begin Label Label7
- Alignment = 2 'Center
- BackColor = &H00C0C0C0&
- Caption = "Meters/Second"
- Height = 255
- Left = 1320
- TabIndex = 3
- Top = 600
- Width = 1815
- End
- Begin Label Label5
- Alignment = 2 'Center
- BackColor = &H00C0C0C0&
- ForeColor = &H00FF0000&
- Height = 255
- Left = 120
- TabIndex = 5
- Top = 600
- Width = 1095
- End
- Begin Label Label4
- BackColor = &H00C0C0C0&
- Caption = "Conversion"
- Height = 255
- Left = 240
- TabIndex = 15
- Top = 120
- Width = 1575
- End
- End
- Begin PictureBox Picture1
- BackColor = &H00C0C0C0&
- BorderStyle = 0 'None
- Height = 1815
- Left = 240
- ScaleHeight = 1815
- ScaleWidth = 3375
- TabIndex = 8
- Top = 360
- Width = 3375
- Begin TextBox Text2
- BackColor = &H00C0C0C0&
- BorderStyle = 0 'None
- ForeColor = &H00FF0000&
- Height = 255
- Left = 120
- TabIndex = 10
- Top = 1200
- Width = 855
- End
- Begin TextBox Text1
- BackColor = &H00C0C0C0&
- BorderStyle = 0 'None
- ForeColor = &H00FF0000&
- Height = 255
- Left = 120
- TabIndex = 9
- Top = 600
- Width = 855
- End
- Begin Label Label2
- Alignment = 2 'Center
- BackColor = &H00C0C0C0&
- Caption = "Temperature Degrees F."
- Height = 255
- Left = 1080
- TabIndex = 6
- Top = 1200
- Width = 2175
- End
- Begin Label Label1
- Alignment = 2 'Center
- BackColor = &H00C0C0C0&
- Caption = " Wind Speed MPH"
- Height = 255
- Left = 1080
- TabIndex = 7
- Top = 600
- Width = 2175
- End
- Begin Label Label3
- BackColor = &H00C0C0C0&
- Caption = "Enter Here"
- Height = 255
- Left = 120
- TabIndex = 14
- Top = 120
- Width = 1695
- End
- End
- Begin Menu FileCmd
- Caption = "&File"
- Begin Menu AboutCmd
- Caption = "About"
- Shortcut = ^A
- End
- Begin Menu spacer
- Caption = "-"
- End
- Begin Menu ExitCmd
- Caption = "Exit"
- Shortcut = ^E
- End
- End
- Begin Menu HelpCmd
- Caption = "&Help"
- End
- Sub AboutCmd_Click ()
- about.Show
- End Sub
- Sub BorderBox (source1 As Control, source2 As Control)
- bleft% = source1.Left - 45
- btop% = source1.Top - 20
- bwide% = source1.Width + 40
- bhigh% = source1.Height + 15
- source2.Line (bleft%, btop%)-Step(bwide%, 0), 0
- source2.Line -Step(0, bhigh%), &HFFFFFF
- source2.Line -Step(-bwide%, 0), &HFFFFFF
- source2.Line -Step(0, -bhigh%), 0
- End Sub
- Sub BorderBoxRaised (source1 As Control, source2 As Form)
- bleft% = source1.Left - 20
- btop% = source1.Top - 20
- bwide% = source1.Width + 15
- bhigh% = source1.Height + 15
- source2.Line (bleft%, btop%)-Step(bwide%, 0), &HFFFFFF
- source2.Line -Step(0, bhigh%), 0
- source2.Line -Step(-bwide%, 0), 0
- source2.Line -Step(0, -bhigh%), &HFFFFFF
- End Sub
- Sub Command1_Click ()
- Dim s#, t#, ms#, c#, wc#, a, b
- msg$ = "You must enter both MPH and
- title$ = "Entry Error"
- s# = Val(text1.text)
- t# = Val(text2.text)
- If s# = 0 Or t# = 0 Then 'forgot to enter both numbers
- MsgBox msg$, 64, title$
- If s# = 0 Then text1.SetFocus
- If t# = 0 Then text2.SetFocus
- Exit Sub
- End If
- ms# = s# * .444 'convert to meters/second
- c# = ((t# - 32) * 5 / 9)'convert to degrees Celcius
- 'MAIN WIND CHILL FORMULA
- wc# = 1.8 * (33 - (((Sqr(100 * ms#) + 10.45 - ms#) * (33 - (t# - 32) * .55))) / 22.066) + 32
- label5.caption = Format$(ms#, "##,###.00")
- label6.caption = Format$(c#, "##,###.00")
- label9.caption = Format$(wc#, "##,###.0") + "
- End Sub
- Sub Command2_Click ()
- text1.text = ""
- text2.text = ""
- label5.caption = ""
- label6.caption = ""
- label9.caption = ""
- text1.SetFocus
- End Sub
- Sub ExitCmd_Click ()
- End
- End Sub
- Sub Form_Load ()
- Width = Screen.Width * .8 ' Set height of form.
- Height = Screen.Height * .65 ' Set width of form.
- Left = (Screen.Width - Width) / 2 ' Center form horizontally.
- Top = (Screen.Height - Height) / 2 ' Center form vertically.
- End Sub
- Sub Form_Paint ()
- 'SYNTAX FOR BORDERBOXRAISED
- 'PICTURE, FORM NAME
- BorderBoxRaised picture1, main_form
- BorderBoxRaised picture2, main_form
- BorderBoxRaised picture3, main_form
- 'SYNTAX FOR BORDERBOX
- 'TEXT or LABEL, PICTURE
- BorderBox text1, picture1
- BorderBox text2, picture1
- BorderBox label1, picture1
- BorderBox label2, picture1
- BorderBox label5, picture2
- BorderBox label6, picture2
- BorderBox label7, picture2
- BorderBox label8, picture2
- BorderBox label9, picture3
- BorderBox label10, picture3
- text1.SetFocus
- End Sub
- Sub HelpCmd_Click ()
- help.Show
- End Sub
- Sub Text1_Change ()
- msg$ = "Your number is restricted" + Chr$(13) + Chr$(10) + "to a maximum of 4 digits."
- title$ = "Entry Error"
- If Len(text1.text) > 4 Then
- MsgBox msg$, 64, title$
- text1.text = ""
- End If
- End Sub
- Sub Text1_KeyPress (keyascii As Integer)
- a% = keyascii 'TRAP FOR POSTIVE WHOLE NUMBERS
- Select Case keyascii
- Case 0 To 7
- GoSub EntryError
- Case 9 To 46
- GoSub EntryError
- Case 58 To 255
- GoSub EntryError
- End Select
- Exit Sub
- EntryError:
- keyascii = 0
- msg$ = "Enter Postive Whole Numbers Only"
- title$ = "Entry Error"
- MsgBox (msg$), 48, title$
- Return
- End Sub
- Sub Text2_Change ()
- msg$ = "Your number is restricted" + Chr$(13) + Chr$(10) + "to a maximum of 4 digits."
- title$ = "Entry Error"
- If Len(text2.text) > 5 Then
- MsgBox msg$, 64, title$
- text2.text = ""
- End If
- End Sub
- Sub Text2_KeyPress (keyascii As Integer)
- a% = keyascii 'TRAP FOR WHOLE NUMBERS
- Select Case keyascii
- Case 0 To 7
- GoSub EntryError2
- Case 9 To 44
- GoSub EntryError2
- Case 46
- GoSub EntryError2
- Case 58 To 255
- GoSub EntryError2
- End Select
- Exit Sub
- EntryError2:
- keyascii = 0
- msg$ = "Enter Whole Numbers Only"
- title$ = "Entry Error"
- MsgBox (msg$), 48, title$
- Return
- End Sub
-