Public Class frmArithmeticOperators
  Inherits System.Windows.Forms.Form
  Dim WhichOne As Integer
#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 Label1 As System.Windows.Forms.Label
  Friend WithEvents GroupBox1 As System.Windows.Forms.GroupBox
  Friend WithEvents txtOperand2 As System.Windows.Forms.TextBox
  Friend WithEvents txtOperand1 As System.Windows.Forms.TextBox
  Friend WithEvents RadioButton1 As System.Windows.Forms.RadioButton
  Friend WithEvents RadioButton2 As System.Windows.Forms.RadioButton
  Friend WithEvents RadioButton3 As System.Windows.Forms.RadioButton
  Friend WithEvents RadioButton4 As System.Windows.Forms.RadioButton
  Friend WithEvents RadioButton5 As System.Windows.Forms.RadioButton
  Friend WithEvents RadioButton6 As System.Windows.Forms.RadioButton
  Friend WithEvents RadioButton7 As System.Windows.Forms.RadioButton
  Friend WithEvents RadioButton8 As System.Windows.Forms.RadioButton
  Friend WithEvents RadioButton9 As System.Windows.Forms.RadioButton
  Friend WithEvents Label3 As System.Windows.Forms.Label
  Friend WithEvents txtResult As System.Windows.Forms.TextBox
  Friend WithEvents Label4 As System.Windows.Forms.Label
  Friend WithEvents btnCalc As System.Windows.Forms.Button
  Friend WithEvents btnExit As System.Windows.Forms.Button
  Friend WithEvents lblOp2 As System.Windows.Forms.Label
  <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
    Me.txtOperand1 = New System.Windows.Forms.TextBox()
    Me.Label1 = New System.Windows.Forms.Label()
    Me.GroupBox1 = New System.Windows.Forms.GroupBox()
    Me.RadioButton9 = New System.Windows.Forms.RadioButton()
    Me.RadioButton8 = New System.Windows.Forms.RadioButton()
    Me.RadioButton7 = New System.Windows.Forms.RadioButton()
    Me.RadioButton6 = New System.Windows.Forms.RadioButton()
    Me.RadioButton5 = New System.Windows.Forms.RadioButton()
    Me.RadioButton4 = New System.Windows.Forms.RadioButton()
    Me.RadioButton3 = New System.Windows.Forms.RadioButton()
    Me.RadioButton2 = New System.Windows.Forms.RadioButton()
    Me.RadioButton1 = New System.Windows.Forms.RadioButton()
    Me.lblOp2 = New System.Windows.Forms.Label()
    Me.txtOperand2 = New System.Windows.Forms.TextBox()
    Me.Label3 = New System.Windows.Forms.Label()
    Me.txtResult = New System.Windows.Forms.TextBox()
    Me.Label4 = New System.Windows.Forms.Label()
    Me.btnCalc = New System.Windows.Forms.Button()
    Me.btnExit = New System.Windows.Forms.Button()
    Me.GroupBox1.SuspendLayout()
    Me.SuspendLayout()
    '
    'txtOperand1
    '
    Me.txtOperand1.Location = New System.Drawing.Point(128, 112)
    Me.txtOperand1.Name = "txtOperand1"
    Me.txtOperand1.Size = New System.Drawing.Size(80, 20)
    Me.txtOperand1.TabIndex = 0
    Me.txtOperand1.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(128, 96)
    Me.Label1.Name = "Label1"
    Me.Label1.Size = New System.Drawing.Size(80, 16)
    Me.Label1.TabIndex = 1
    Me.Label1.Text = "Operand1"
    Me.Label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter
    '
    'GroupBox1
    '
    Me.GroupBox1.Controls.AddRange(New System.Windows.Forms.Control() {Me.RadioButton9, Me.RadioButton8, Me.RadioButton7, Me.RadioButton6, Me.RadioButton5, Me.RadioButton4, Me.RadioButton3, Me.RadioButton2, Me.RadioButton1})
    Me.GroupBox1.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
    Me.GroupBox1.Location = New System.Drawing.Point(232, 32)
    Me.GroupBox1.Name = "GroupBox1"
    Me.GroupBox1.Size = New System.Drawing.Size(96, 184)
    Me.GroupBox1.TabIndex = 2
    Me.GroupBox1.TabStop = False
    Me.GroupBox1.Text = "Operator:"
    '
    'RadioButton9
    '
    Me.RadioButton9.Location = New System.Drawing.Point(8, 144)
    Me.RadioButton9.Name = "RadioButton9"
    Me.RadioButton9.Size = New System.Drawing.Size(72, 16)
    Me.RadioButton9.TabIndex = 8
    Me.RadioButton9.Text = "- (unary)"
    '
    'RadioButton8
    '
    Me.RadioButton8.Location = New System.Drawing.Point(8, 128)
    Me.RadioButton8.Name = "RadioButton8"
    Me.RadioButton8.Size = New System.Drawing.Size(72, 16)
    Me.RadioButton8.TabIndex = 7
    Me.RadioButton8.Text = "+ (unary)"
    '
    'RadioButton7
    '
    Me.RadioButton7.Location = New System.Drawing.Point(8, 112)
    Me.RadioButton7.Name = "RadioButton7"
    Me.RadioButton7.Size = New System.Drawing.Size(72, 16)
    Me.RadioButton7.TabIndex = 6
    Me.RadioButton7.Text = "Mod"
    '
    'RadioButton6
    '
    Me.RadioButton6.Location = New System.Drawing.Point(8, 96)
    Me.RadioButton6.Name = "RadioButton6"
    Me.RadioButton6.Size = New System.Drawing.Size(72, 16)
    Me.RadioButton6.TabIndex = 5
    Me.RadioButton6.Text = "^"
    '
    'RadioButton5
    '
    Me.RadioButton5.Location = New System.Drawing.Point(8, 80)
    Me.RadioButton5.Name = "RadioButton5"
    Me.RadioButton5.Size = New System.Drawing.Size(80, 16)
    Me.RadioButton5.TabIndex = 4
    Me.RadioButton5.Text = "\   (integer)"
    '
    'RadioButton4
    '
    Me.RadioButton4.Location = New System.Drawing.Point(8, 64)
    Me.RadioButton4.Name = "RadioButton4"
    Me.RadioButton4.Size = New System.Drawing.Size(72, 16)
    Me.RadioButton4.TabIndex = 3
    Me.RadioButton4.Text = "/"
    '
    'RadioButton3
    '
    Me.RadioButton3.Location = New System.Drawing.Point(8, 48)
    Me.RadioButton3.Name = "RadioButton3"
    Me.RadioButton3.Size = New System.Drawing.Size(72, 16)
    Me.RadioButton3.TabIndex = 2
    Me.RadioButton3.Text = "*"
    '
    'RadioButton2
    '
    Me.RadioButton2.Location = New System.Drawing.Point(8, 32)
    Me.RadioButton2.Name = "RadioButton2"
    Me.RadioButton2.Size = New System.Drawing.Size(72, 16)
    Me.RadioButton2.TabIndex = 1
    Me.RadioButton2.Text = "-"
    '
    'RadioButton1
    '
    Me.RadioButton1.Location = New System.Drawing.Point(8, 16)
    Me.RadioButton1.Name = "RadioButton1"
    Me.RadioButton1.Size = New System.Drawing.Size(72, 16)
    Me.RadioButton1.TabIndex = 0
    Me.RadioButton1.Text = "+"
    '
    'lblOp2
    '
    Me.lblOp2.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D
    Me.lblOp2.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
    Me.lblOp2.Location = New System.Drawing.Point(344, 96)
    Me.lblOp2.Name = "lblOp2"
    Me.lblOp2.Size = New System.Drawing.Size(80, 16)
    Me.lblOp2.TabIndex = 4
    Me.lblOp2.Text = "Operand2"
    Me.lblOp2.TextAlign = System.Drawing.ContentAlignment.MiddleCenter
    '
    'txtOperand2
    '
    Me.txtOperand2.Location = New System.Drawing.Point(344, 112)
    Me.txtOperand2.Name = "txtOperand2"
    Me.txtOperand2.Size = New System.Drawing.Size(80, 20)
    Me.txtOperand2.TabIndex = 3
    Me.txtOperand2.Text = ""
    '
    'Label3
    '
    Me.Label3.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D
    Me.Label3.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
    Me.Label3.Location = New System.Drawing.Point(8, 96)
    Me.Label3.Name = "Label3"
    Me.Label3.Size = New System.Drawing.Size(80, 16)
    Me.Label3.TabIndex = 6
    Me.Label3.Text = "Result"
    Me.Label3.TextAlign = System.Drawing.ContentAlignment.MiddleCenter
    '
    'txtResult
    '
    Me.txtResult.Location = New System.Drawing.Point(8, 112)
    Me.txtResult.Name = "txtResult"
    Me.txtResult.Size = New System.Drawing.Size(80, 20)
    Me.txtResult.TabIndex = 5
    Me.txtResult.Text = ""
    '
    'Label4
    '
    Me.Label4.Location = New System.Drawing.Point(88, 104)
    Me.Label4.Name = "Label4"
    Me.Label4.Size = New System.Drawing.Size(40, 24)
    Me.Label4.TabIndex = 7
    Me.Label4.Text = "="
    Me.Label4.TextAlign = System.Drawing.ContentAlignment.MiddleCenter
    '
    '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(24, 232)
    Me.btnCalc.Name = "btnCalc"
    Me.btnCalc.Size = New System.Drawing.Size(104, 24)
    Me.btnCalc.TabIndex = 8
    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(320, 232)
    Me.btnExit.Name = "btnExit"
    Me.btnExit.Size = New System.Drawing.Size(104, 24)
    Me.btnExit.TabIndex = 9
    Me.btnExit.Text = "E&xit"
    '
    'frmArithmeticOperators
    '
    Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
    Me.ClientSize = New System.Drawing.Size(440, 273)
    Me.Controls.AddRange(New System.Windows.Forms.Control() {Me.btnExit, Me.btnCalc, Me.Label4, Me.Label3, Me.txtResult, Me.lblOp2, Me.txtOperand2, Me.GroupBox1, Me.Label1, Me.txtOperand1})
    Me.Name = "frmArithmeticOperators"
    Me.Text = "Arithmetic Operators"
    Me.GroupBox1.ResumeLayout(False)
    Me.ResumeLayout(False)

  End Sub

#End Region


  Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    RadioButton1.Checked = True

  End Sub

  Private Sub RadioButton1_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton1.CheckedChanged
    WhichOne = 1
  End Sub

  Private Sub RadioButton2_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton2.CheckedChanged
    WhichOne = 2

  End Sub

  Private Sub RadioButton3_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton3.CheckedChanged
    WhichOne = 3

  End Sub

  Private Sub RadioButton4_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton4.CheckedChanged
    WhichOne = 4

  End Sub

  Private Sub RadioButton5_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton5.CheckedChanged
    WhichOne = 5

  End Sub

  Private Sub RadioButton6_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton6.CheckedChanged
    WhichOne = 6

  End Sub

  Private Sub RadioButton7_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton7.CheckedChanged
    WhichOne = 7

  End Sub

  Private Sub RadioButton8_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton8.CheckedChanged
    txtOperand2.Text = ""
    WhichOne = 8

  End Sub

  Private Sub RadioButton9_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton9.CheckedChanged
    txtOperand2.Text = ""
    WhichOne = 9

  End Sub

  Private Sub btnCalc_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCalc.Click
    Select Case WhichOne
      Case 1
        txtResult.Text = CStr(CDbl(txtOperand1.Text) + CDbl(txtOperand2.Text))
      Case 2
        txtResult.Text = CStr(CDbl(txtOperand1.Text) - CDbl(txtOperand2.Text))
      Case 3
        txtResult.Text = CStr(CDbl(txtOperand1.Text) * CDbl(txtOperand2.Text))
      Case 4
        txtResult.Text = CStr(CDbl(txtOperand1.Text) / CDbl(txtOperand2.Text))
      Case 5
        txtResult.Text = CStr(CInt(txtOperand1.Text) \ CInt(txtOperand2.Text))
      Case 6
        txtResult.Text = CStr(CDbl(txtOperand1.Text) ^ CDbl(txtOperand2.Text))
      Case 7
        txtResult.Text = CStr(CInt(txtOperand1.Text) Mod CInt(txtOperand2.Text))
      Case 8
        txtResult.Text = +(CDbl(txtOperand1.Text))
      Case 9
        txtResult.Text = -(CDbl(txtOperand1.Text))
    End Select
    'WhichOne = 1
    '    txtOperand2.Visible = True
    '    lblOp2.Visible = True

  End Sub

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

  End Sub

  Private Sub txtResult_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtResult.TextChanged

  End Sub
End Class
