VERSION 5.00 Object = "{F7DEA2C9-BA8F-446E-A292-B4840F3BD661}#1.0#0"; "mscemenubar.dll" Begin VB.Form frmMain Appearance = 0 'Flat BackColor = &H00FF8080& Caption = "ENVIT-Converter" ClientHeight = 3615 ClientLeft = 60 ClientTop = 840 ClientWidth = 3480 ForeColor = &H80000008& ScaleHeight = 3615 ScaleWidth = 3480 ShowOK = -1 'True Begin MenuBarLib.MenuBar mnuBar Left = 0 Top = 3360 _cx = 6165 _cy = 450 Enabled = -1 'True NewButton = 0 'False End Begin VBCE.Frame frameTemp Height = 2295 Left = 360 TabIndex = 2 Top = 960 Visible = 0 'False Width = 2655 _cx = 4683 _cy = 4048 BackColor = -2147483643 BorderStyle = 0 Caption = "" Enabled = -1 'True BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} Name = "Tahoma" Size = 8.25 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty ForeColor = -2147483640 ClipControls = -1 'True Begin VBCE.CommandButton commReset Height = 375 Left = 1440 TabIndex = 8 Top = 1800 Width = 735 _cx = 1296 _cy = 661 BackColor = 12632256 Caption = "Reset" Enabled = -1 'True BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} Name = "Tahoma" Size = 8.25 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Style = 0 End Begin VBCE.TextBox TxtTmpOut Height = 375 Left = 120 TabIndex = 7 Top = 1200 Width = 2415 _cx = 4260 _cy = 661 BackColor = -2147483643 BorderStyle = 1 Enabled = 0 'False BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} Name = "Tahoma" Size = 8.25 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty ForeColor = -2147483640 Text = "" Alignment = 0 HideSelection = -1 'True Locked = -1 'True MaxLength = 0 MultiLine = 0 'False PasswordChar = "" ScrollBars = 0 End Begin VBCE.CommandButton commConvert Height = 375 Left = 360 TabIndex = 6 Top = 1800 Width = 735 _cx = 1296 _cy = 661 BackColor = 12632256 Caption = "Convert" Enabled = -1 'True BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} Name = "Tahoma" Size = 8.25 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Style = 0 End Begin VBCE.TextBox TxtTmpIn Height = 375 Left = 120 TabIndex = 5 Top = 720 Width = 2415 _cx = 4260 _cy = 661 BackColor = -2147483643 BorderStyle = 1 Enabled = -1 'True BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} Name = "Tahoma" Size = 8.25 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty ForeColor = -2147483640 Text = "" Alignment = 0 HideSelection = -1 'True Locked = 0 'False MaxLength = 0 MultiLine = 0 'False PasswordChar = "" ScrollBars = 0 End Begin VBCE.ComboBox cmbTo Height = 300 Left = 1560 TabIndex = 4 Top = 240 Width = 975 List = "frmMain.frx":0000 ItemData = "frmMain.frx":0030 _cx = 1720 _cy = 529 BackColor = -2147483643 Enabled = -1 'True BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} Name = "Tahoma" Size = 8.25 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty ForeColor = -2147483640 Text = "To" IntegralHeight = -1 'True Locked = 0 'False Sorted = 0 'False Style = 0 End Begin VBCE.ComboBox cmbFrom Height = 300 Left = 120 TabIndex = 3 Top = 240 Width = 975 List = "frmMain.frx":0060 ItemData = "frmMain.frx":0090 _cx = 1720 _cy = 529 BackColor = -2147483643 Enabled = -1 'True BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} Name = "Tahoma" Size = 8.25 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty ForeColor = -2147483640 Text = "From" IntegralHeight = -1 'True Locked = 0 'False Sorted = 0 'False Style = 0 End End Begin VBCE.Label lblTitle Height = 375 Left = 240 TabIndex = 1 Top = 120 Width = 3015 _cx = 5318 _cy = 661 AutoSize = 0 'False BackColor = 16744576 BackStyle = 1 BorderStyle = 0 Caption = "ENVIT Unit Converter for Field Sampling" Enabled = -1 'True BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} Name = "Tahoma" Size = 8.25 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty ForeColor = 192 Alignment = 2 UseMnemonic = -1 'True WordWrap = 0 'False End Begin VBCE.ComboBox cmbSelect Height = 300 Left = 360 TabIndex = 0 Top = 480 Width = 2655 List = "frmMain.frx":00C0 ItemData = "frmMain.frx":0142 _cx = 4683 _cy = 529 BackColor = -2147483643 Enabled = -1 'True BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} Name = "Tahoma" Size = 8.25 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty ForeColor = -2147483640 Text = "Select a Measurement" IntegralHeight = -1 'True Locked = 0 'False Sorted = 0 'False Style = 0 End End Attribute VB_Name = "frmMain" Attribute VB_GlobalNameSpace = False Attribute VB_Creatable = False Attribute VB_PredeclaredId = True Attribute VB_Exposed = False Option Explicit Dim fromUnit As Integer Dim toUnit As Integer Private Sub Form_OKClick() App.End End Sub Private Sub Form_Load() Dim mnuFile As MenuBarWelcome Set mnuFile = mnuBar.Controls.AddMenu("File", "mnuFile") mnuFile.Items.Add 1, "mnuFileExit", "Exit" toUnit = 0 fromUnit = 0 End Sub Private Sub mnuBar_MenuClick(ByVal Item As MenuBarLib.Item) Select Case Item.Key Case "mnuFileExit" App.End End Select End Sub Private Sub mnuBarWelcome_MenuClick(ByVal Item As MenuBarLib.Item) Select Case Item.Key Case "mnuFileExit" App.End End Select End Sub Private Sub cmbSelect_Click() Dim intItemData As Integer intItemData = cmbSelect.ItemData(cmbSelect.ListIndex) If intItemData = 0 Then frameTemp.Visible = True End If End Sub Private Sub cmbFrom_Click() Dim intID As Integer intID = cmbFrom.ItemData(cmbFrom.ListIndex) If intID = 1 Then fromUnit = 1 End If If intID = 2 Then fromUnit = 2 End If End Sub Private Sub cmbTo_Click() Dim intID As Integer intID = cmbFrom.ItemData(cmbTo.ListIndex) If intID = 1 Then toUnit = 1 End If If intID = 2 Then toUnit = 2 End If End Sub Private Sub commConvert_Click() Dim NumberIn As Double Dim Opt As Integer Dim MsgV 'MsgV = MsgBox(toUnit) If fromUnit = 0 Then MsgV = MsgBox("Please Specify From Unit") End If If toUnit = 0 Then MsgV = MsgBox("Please Specify To Unit") End If If fromUnit = 1 Then If toUnit = 2 Then Opt = 0 End If If toUnit = 1 Then Opt = 2 End If End If If fromUnit = 2 Then If toUnit = 1 Then Opt = 0 End If If toUnit = 2 Then Opt = 1 End If End If NumberIn = TxtTmpIn.Text 'No conversion If Opt = 0 Then TxtTmpOut.Text = NumberIn End If 'F to C conversion If Opt = 1 Then TxtTmpOut.Text = (5# / 9#) * (NumberIn - 32) End If 'C to F conversion If Opt = 2 Then TxtTmpOut.Text = ((9# / 5#) * (NumberIn)) + 32 End If End Sub Private Sub commReset_Click() TxtTmpOut.Text = "" TxtTmpIn.Text = "" End Sub