Option Strict Off
Option Explicit On
Friend Class Form1
	Inherits System.Windows.Forms.Form

#Region "Windows Form Designer generated code "
  Public Sub New()
    MyBase.New()
    If m_vb6FormDefInstance Is Nothing Then
      If m_InitializingDefInstance Then
        m_vb6FormDefInstance = Me
      Else
        Try
          'For the start-up form, the first instance created is the default instance.
          If System.Reflection.Assembly.GetExecutingAssembly.EntryPoint.DeclaringType Is Me.GetType Then
            m_vb6FormDefInstance = Me
          End If
        Catch
        End Try
      End If
    End If
    'This call is required by the Windows Form Designer.
    InitializeComponent()
  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.Container
  Public ToolTip1 As System.Windows.Forms.ToolTip
  Public WithEvents btClosit As System.Windows.Forms.Button
  Public WithEvents btConvert As System.Windows.Forms.Button
  Public WithEvents opFahr As System.Windows.Forms.RadioButton
  Public WithEvents opCelsius As System.Windows.Forms.RadioButton
  Public WithEvents Frame1 As System.Windows.Forms.GroupBox
  Public WithEvents txTemperature As System.Windows.Forms.TextBox
  Public WithEvents lbNewtemp As System.Windows.Forms.Label
  Public WithEvents Label2 As System.Windows.Forms.Label
  Public WithEvents Label1 As System.Windows.Forms.Label
  '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.
  <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
    Me.components = New System.ComponentModel.Container()
    Me.ToolTip1 = New System.Windows.Forms.ToolTip(components)
    Me.ToolTip1.Active = True
    Me.btClosit = New System.Windows.Forms.Button()
    Me.btConvert = New System.Windows.Forms.Button()
    Me.Frame1 = New System.Windows.Forms.GroupBox()
    Me.opFahr = New System.Windows.Forms.RadioButton()
    Me.opCelsius = New System.Windows.Forms.RadioButton()
    Me.txTemperature = New System.Windows.Forms.TextBox()
    Me.lbNewtemp = New System.Windows.Forms.Label()
    Me.Label2 = New System.Windows.Forms.Label()
    Me.Label1 = New System.Windows.Forms.Label()
    Me.Text = "Convert temperatures"
    Me.ClientSize = New System.Drawing.Size(312, 213)
    Me.Location = New System.Drawing.Point(4, 23)
    Me.StartPosition = System.Windows.Forms.FormStartPosition.WindowsDefaultLocation
    Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
    Me.BackColor = System.Drawing.SystemColors.Control
    Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.Sizable
    Me.ControlBox = True
    Me.Enabled = True
    Me.KeyPreview = False
    Me.MaximizeBox = True
    Me.MinimizeBox = True
    Me.Cursor = System.Windows.Forms.Cursors.Default
    Me.RightToLeft = System.Windows.Forms.RightToLeft.No
    Me.ShowInTaskbar = True
    Me.HelpButton = False
    Me.WindowState = System.Windows.Forms.FormWindowState.Normal
    Me.Name = "Form1"
    Me.btClosit.TextAlign = System.Drawing.ContentAlignment.MiddleCenter
    Me.btClosit.Text = "Close"
    Me.btClosit.Size = New System.Drawing.Size(65, 25)
    Me.btClosit.Location = New System.Drawing.Point(168, 176)
    Me.btClosit.TabIndex = 6
    Me.btClosit.BackColor = System.Drawing.SystemColors.Control
    Me.btClosit.CausesValidation = True
    Me.btClosit.Enabled = True
    Me.btClosit.Cursor = System.Windows.Forms.Cursors.Default
    Me.btClosit.RightToLeft = System.Windows.Forms.RightToLeft.No
    Me.btClosit.TabStop = True
    Me.btClosit.Name = "btClosit"
    Me.btConvert.TextAlign = System.Drawing.ContentAlignment.MiddleCenter
    Me.btConvert.Text = "Convert"
    Me.btConvert.Size = New System.Drawing.Size(65, 25)
    Me.btConvert.Location = New System.Drawing.Point(48, 176)
    Me.btConvert.TabIndex = 5
    Me.btConvert.BackColor = System.Drawing.SystemColors.Control
    Me.btConvert.CausesValidation = True
    Me.btConvert.Enabled = True
    Me.btConvert.Cursor = System.Windows.Forms.Cursors.Default
    Me.btConvert.RightToLeft = System.Windows.Forms.RightToLeft.No
    Me.btConvert.TabStop = True
    Me.btConvert.Name = "btConvert"
    Me.Frame1.Text = "Select conversion"
    Me.Frame1.Size = New System.Drawing.Size(153, 65)
    Me.Frame1.Location = New System.Drawing.Point(72, 48)
    Me.Frame1.TabIndex = 2
    Me.Frame1.BackColor = System.Drawing.SystemColors.Control
    Me.Frame1.Enabled = True
    Me.Frame1.ForeColor = System.Drawing.SystemColors.ControlText
    Me.Frame1.RightToLeft = System.Windows.Forms.RightToLeft.No
    Me.Frame1.Visible = True
    Me.Frame1.Name = "Frame1"
    Me.opFahr.TextAlign = System.Drawing.ContentAlignment.MiddleLeft
    Me.opFahr.Text = "to Fahrenheit"
    Me.opFahr.Size = New System.Drawing.Size(105, 13)
    Me.opFahr.Location = New System.Drawing.Point(8, 40)
    Me.opFahr.TabIndex = 4
    Me.opFahr.CheckAlign = System.Drawing.ContentAlignment.MiddleLeft
    Me.opFahr.BackColor = System.Drawing.SystemColors.Control
    Me.opFahr.CausesValidation = True
    Me.opFahr.Enabled = True
    Me.opFahr.ForeColor = System.Drawing.SystemColors.ControlText
    Me.opFahr.Cursor = System.Windows.Forms.Cursors.Default
    Me.opFahr.RightToLeft = System.Windows.Forms.RightToLeft.No
    Me.opFahr.Appearance = System.Windows.Forms.Appearance.Normal
    Me.opFahr.TabStop = True
    Me.opFahr.Checked = False
    Me.opFahr.Visible = True
    Me.opFahr.Name = "opFahr"
    Me.opCelsius.TextAlign = System.Drawing.ContentAlignment.MiddleLeft
    Me.opCelsius.Text = "to Celsius"
    Me.opCelsius.Size = New System.Drawing.Size(89, 17)
    Me.opCelsius.Location = New System.Drawing.Point(8, 16)
    Me.opCelsius.TabIndex = 3
    Me.opCelsius.Checked = True
    Me.opCelsius.CheckAlign = System.Drawing.ContentAlignment.MiddleLeft
    Me.opCelsius.BackColor = System.Drawing.SystemColors.Control
    Me.opCelsius.CausesValidation = True
    Me.opCelsius.Enabled = True
    Me.opCelsius.ForeColor = System.Drawing.SystemColors.ControlText
    Me.opCelsius.Cursor = System.Windows.Forms.Cursors.Default
    Me.opCelsius.RightToLeft = System.Windows.Forms.RightToLeft.No
    Me.opCelsius.Appearance = System.Windows.Forms.Appearance.Normal
    Me.opCelsius.TabStop = True
    Me.opCelsius.Visible = True
    Me.opCelsius.Name = "opCelsius"
    Me.txTemperature.AutoSize = False
    Me.txTemperature.Size = New System.Drawing.Size(89, 25)
    Me.txTemperature.Location = New System.Drawing.Point(136, 8)
    Me.txTemperature.TabIndex = 1
    Me.txTemperature.AcceptsReturn = True
    Me.txTemperature.TextAlign = System.Windows.Forms.HorizontalAlignment.Left
    Me.txTemperature.BackColor = System.Drawing.SystemColors.Window
    Me.txTemperature.CausesValidation = True
    Me.txTemperature.Enabled = True
    Me.txTemperature.ForeColor = System.Drawing.SystemColors.WindowText
    Me.txTemperature.HideSelection = True
    Me.txTemperature.ReadOnly = False
    Me.txTemperature.MaxLength = 0
    Me.txTemperature.Cursor = System.Windows.Forms.Cursors.IBeam
    Me.txTemperature.Multiline = False
    Me.txTemperature.RightToLeft = System.Windows.Forms.RightToLeft.No
    Me.txTemperature.ScrollBars = System.Windows.Forms.ScrollBars.None
    Me.txTemperature.TabStop = True
    Me.txTemperature.Visible = True
    Me.txTemperature.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D
    Me.txTemperature.Name = "txTemperature"
    Me.lbNewtemp.BackColor = System.Drawing.Color.White
    Me.lbNewtemp.Text = " "
    Me.lbNewtemp.Size = New System.Drawing.Size(57, 25)
    Me.lbNewtemp.Location = New System.Drawing.Point(112, 128)
    Me.lbNewtemp.TabIndex = 8
    Me.lbNewtemp.TextAlign = System.Drawing.ContentAlignment.TopLeft
    Me.lbNewtemp.Enabled = True
    Me.lbNewtemp.ForeColor = System.Drawing.SystemColors.ControlText
    Me.lbNewtemp.Cursor = System.Windows.Forms.Cursors.Default
    Me.lbNewtemp.RightToLeft = System.Windows.Forms.RightToLeft.No
    Me.lbNewtemp.UseMnemonic = True
    Me.lbNewtemp.Visible = True
    Me.lbNewtemp.AutoSize = False
    Me.lbNewtemp.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D
    Me.lbNewtemp.Name = "lbNewtemp"
    Me.Label2.Text = "Converted temperature"
    Me.Label2.Size = New System.Drawing.Size(73, 25)
    Me.Label2.Location = New System.Drawing.Point(16, 120)
    Me.Label2.TabIndex = 7
    Me.Label2.TextAlign = System.Drawing.ContentAlignment.TopLeft
    Me.Label2.BackColor = System.Drawing.SystemColors.Control
    Me.Label2.Enabled = True
    Me.Label2.ForeColor = System.Drawing.SystemColors.ControlText
    Me.Label2.Cursor = System.Windows.Forms.Cursors.Default
    Me.Label2.RightToLeft = System.Windows.Forms.RightToLeft.No
    Me.Label2.UseMnemonic = True
    Me.Label2.Visible = True
    Me.Label2.AutoSize = False
    Me.Label2.BorderStyle = System.Windows.Forms.BorderStyle.None
    Me.Label2.Name = "Label2"
    Me.Label1.Text = "Enter temperature"
    Me.Label1.Size = New System.Drawing.Size(105, 17)
    Me.Label1.Location = New System.Drawing.Point(8, 8)
    Me.Label1.TabIndex = 0
    Me.Label1.TextAlign = System.Drawing.ContentAlignment.TopLeft
    Me.Label1.BackColor = System.Drawing.SystemColors.Control
    Me.Label1.Enabled = True
    Me.Label1.ForeColor = System.Drawing.SystemColors.ControlText
    Me.Label1.Cursor = System.Windows.Forms.Cursors.Default
    Me.Label1.RightToLeft = System.Windows.Forms.RightToLeft.No
    Me.Label1.UseMnemonic = True
    Me.Label1.Visible = True
    Me.Label1.AutoSize = False
    Me.Label1.BorderStyle = System.Windows.Forms.BorderStyle.None
    Me.Label1.Name = "Label1"
    Me.Controls.Add(btClosit)
    Me.Controls.Add(btConvert)
    Me.Controls.Add(Frame1)
    Me.Controls.Add(txTemperature)
    Me.Controls.Add(lbNewtemp)
    Me.Controls.Add(Label2)
    Me.Controls.Add(Label1)
    Me.Frame1.Controls.Add(opFahr)
    Me.Frame1.Controls.Add(opCelsius)
  End Sub
#End Region
#Region "Upgrade Support "
  Private Shared m_vb6FormDefInstance As Form1
  Private Shared m_InitializingDefInstance As Boolean
  Public Shared Property DefInstance() As Form1
    Get
      If m_vb6FormDefInstance Is Nothing OrElse m_vb6FormDefInstance.IsDisposed Then
        m_InitializingDefInstance = True
        m_vb6FormDefInstance = New Form1()
        m_InitializingDefInstance = False
      End If
      DefInstance = m_vb6FormDefInstance
    End Get
    Set(ByVal Value As Form1)
      m_vb6FormDefInstance = Value
    End Set
  End Property
#End Region

  Private Sub btClosit_Click(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles btClosit.Click
    End
  End Sub

  Private Sub btConvert_Click(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles btConvert.Click
    Dim enterTemp, newTemp As Single
    enterTemp = Val(txTemperature.Text)

    If opFahr.Checked Then
      newTemp = 9 * (enterTemp / 5) + 32
    Else
      newTemp = 5 * (enterTemp - 32) / 9
    End If

    lbNewtemp.Text = Str(newTemp)
  End Sub
End Class