Imports System.Math

Public Class frmMathProject
  Inherits System.Windows.Forms.Form

#Region " Windows Form Designer generated code "

  Public Sub New()
    MyBase.New()

    'This call is required by the Windows Form Designer.
    InitializeComponent()

    'Add any initialization after the InitializeComponent() call

  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.IContainer

  '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.
  Friend WithEvents lblNumber As System.Windows.Forms.Label
  Friend WithEvents txtNumber As System.Windows.Forms.TextBox
  Friend WithEvents Label1 As System.Windows.Forms.Label
  Friend WithEvents Label2 As System.Windows.Forms.Label
  Friend WithEvents btnCalc As System.Windows.Forms.Button
  Friend WithEvents btnExit As System.Windows.Forms.Button
  Friend WithEvents txtSquare As System.Windows.Forms.TextBox
  Friend WithEvents txtSquareRoot As System.Windows.Forms.TextBox
  <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
    Me.lblNumber = New System.Windows.Forms.Label()
    Me.txtNumber = New System.Windows.Forms.TextBox()
    Me.txtSquare = New System.Windows.Forms.TextBox()
    Me.Label1 = New System.Windows.Forms.Label()
    Me.txtSquareRoot = New System.Windows.Forms.TextBox()
    Me.Label2 = New System.Windows.Forms.Label()
    Me.btnCalc = New System.Windows.Forms.Button()
    Me.btnExit = New System.Windows.Forms.Button()
    Me.SuspendLayout()
    '
    'lblNumber
    '
    Me.lblNumber.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D
    Me.lblNumber.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
    Me.lblNumber.Location = New System.Drawing.Point(8, 32)
    Me.lblNumber.Name = "lblNumber"
    Me.lblNumber.Size = New System.Drawing.Size(100, 20)
    Me.lblNumber.TabIndex = 0
    Me.lblNumber.Text = "Enter a number:"
    Me.lblNumber.TextAlign = System.Drawing.ContentAlignment.MiddleRight
    '
    'txtNumber
    '
    Me.txtNumber.Location = New System.Drawing.Point(107, 32)
    Me.txtNumber.Name = "txtNumber"
    Me.txtNumber.Size = New System.Drawing.Size(128, 20)
    Me.txtNumber.TabIndex = 1
    Me.txtNumber.Text = ""
    '
    'txtSquare
    '
    Me.txtSquare.Location = New System.Drawing.Point(107, 56)
    Me.txtSquare.Name = "txtSquare"
    Me.txtSquare.Size = New System.Drawing.Size(128, 20)
    Me.txtSquare.TabIndex = 3
    Me.txtSquare.Text = ""
    '
    'Label1
    '
    Me.Label1.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D
    Me.Label1.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
    Me.Label1.Location = New System.Drawing.Point(8, 56)
    Me.Label1.Name = "Label1"
    Me.Label1.Size = New System.Drawing.Size(100, 20)
    Me.Label1.TabIndex = 2
    Me.Label1.Text = "Square:"
    Me.Label1.TextAlign = System.Drawing.ContentAlignment.MiddleRight
    '
    'txtSquareRoot
    '
    Me.txtSquareRoot.Location = New System.Drawing.Point(107, 80)
    Me.txtSquareRoot.Name = "txtSquareRoot"
    Me.txtSquareRoot.Size = New System.Drawing.Size(128, 20)
    Me.txtSquareRoot.TabIndex = 5
    Me.txtSquareRoot.Text = ""
    '
    'Label2
    '
    Me.Label2.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D
    Me.Label2.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
    Me.Label2.Location = New System.Drawing.Point(8, 80)
    Me.Label2.Name = "Label2"
    Me.Label2.Size = New System.Drawing.Size(100, 20)
    Me.Label2.TabIndex = 4
    Me.Label2.Text = "Square Root:"
    Me.Label2.TextAlign = System.Drawing.ContentAlignment.MiddleRight
    '
    'btnCalc
    '
    Me.btnCalc.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
    Me.btnCalc.Location = New System.Drawing.Point(8, 120)
    Me.btnCalc.Name = "btnCalc"
    Me.btnCalc.Size = New System.Drawing.Size(104, 24)
    Me.btnCalc.TabIndex = 2
    Me.btnCalc.Text = "&Calculate"
    '
    'btnExit
    '
    Me.btnExit.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
    Me.btnExit.Location = New System.Drawing.Point(128, 120)
    Me.btnExit.Name = "btnExit"
    Me.btnExit.Size = New System.Drawing.Size(104, 24)
    Me.btnExit.TabIndex = 7
    Me.btnExit.Text = "E&xit"
    '
    'frmMathProject
    '
    Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
    Me.ClientSize = New System.Drawing.Size(240, 181)
    Me.Controls.AddRange(New System.Windows.Forms.Control() {Me.btnExit, Me.btnCalc, Me.txtSquareRoot, Me.Label2, Me.txtSquare, Me.Label1, Me.txtNumber, Me.lblNumber})
    Me.Name = "frmMathProject"
    Me.Text = "Math Test"
    Me.ResumeLayout(False)

  End Sub

#End Region

  Private Sub txtNumber_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtNumber.TextChanged

  End Sub



  Private Sub btnCalc_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCalc.Click
    Dim Square As Double, SquareRoot As Double

    Square = CDbl(txtNumber.Text)
    txtSquare.Text = CStr(Square * Square)
    txtSquareRoot.Text = CStr(Sqrt(Square))


  End Sub

  Private Sub btnExit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnExit.Click
    Me.Dispose()
  End Sub
End Class
