Public Class Form1
    Inherits System.Windows.Forms.Form
  Enum MyDay
    Monday = 1
    Tuesday = 2
    Wednesday = 3
    Thursday = 4
    Friday = 5
    Saturday = 6
    Sunday = 7
  End Enum

#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 btnExit As System.Windows.Forms.Button
  Friend WithEvents btnTest As System.Windows.Forms.Button
  Friend WithEvents Label3 As System.Windows.Forms.Label
  Friend WithEvents txtResult As System.Windows.Forms.TextBox
  Friend WithEvents Label1 As System.Windows.Forms.Label
  Friend WithEvents txtNumber As System.Windows.Forms.TextBox
  <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
    Me.btnExit = New System.Windows.Forms.Button()
    Me.btnTest = New System.Windows.Forms.Button()
    Me.txtNumber = New System.Windows.Forms.TextBox()
    Me.Label3 = New System.Windows.Forms.Label()
    Me.txtResult = New System.Windows.Forms.TextBox()
    Me.Label1 = New System.Windows.Forms.Label()
    Me.SuspendLayout()
    '
    '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(144, 88)
    Me.btnExit.Name = "btnExit"
    Me.btnExit.Size = New System.Drawing.Size(104, 24)
    Me.btnExit.TabIndex = 18
    Me.btnExit.Text = "E&xit"
    '
    'btnTest
    '
    Me.btnTest.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
    Me.btnTest.Location = New System.Drawing.Point(8, 88)
    Me.btnTest.Name = "btnTest"
    Me.btnTest.Size = New System.Drawing.Size(104, 24)
    Me.btnTest.TabIndex = 17
    Me.btnTest.Text = "&Test"
    '
    'txtNumber
    '
    Me.txtNumber.Location = New System.Drawing.Point(120, 16)
    Me.txtNumber.Name = "txtNumber"
    Me.txtNumber.Size = New System.Drawing.Size(128, 20)
    Me.txtNumber.TabIndex = 15
    Me.txtNumber.Text = "txtNumber"
    '
    '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, 16)
    Me.Label3.Name = "Label3"
    Me.Label3.Size = New System.Drawing.Size(112, 20)
    Me.Label3.TabIndex = 14
    Me.Label3.Text = "Enter an Integer: "
    Me.Label3.TextAlign = System.Drawing.ContentAlignment.MiddleRight
    '
    'txtResult
    '
    Me.txtResult.Location = New System.Drawing.Point(120, 48)
    Me.txtResult.Name = "txtResult"
    Me.txtResult.Size = New System.Drawing.Size(128, 20)
    Me.txtResult.TabIndex = 20
    Me.txtResult.Text = "txtResult"
    '
    '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, 48)
    Me.Label1.Name = "Label1"
    Me.Label1.Size = New System.Drawing.Size(112, 20)
    Me.Label1.TabIndex = 19
    Me.Label1.Text = "The number is: "
    Me.Label1.TextAlign = System.Drawing.ContentAlignment.MiddleRight
    '
    'Form1
    '
    Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
    Me.ClientSize = New System.Drawing.Size(264, 141)
    Me.Controls.AddRange(New System.Windows.Forms.Control() {Me.txtResult, Me.Label1, Me.btnExit, Me.btnTest, Me.txtNumber, Me.Label3})
    Me.Name = "Form1"
    Me.Text = "If Statement Program"
    Me.ResumeLayout(False)

  End Sub

#End Region

  Private Sub btnTest_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnTest.Click
    Dim Number As Integer

    Number = CInt(txtNumber.Text)

    If Number > 65 OrElse OddEven(Number) > 0 Then
      MessageBox.Show("Both true")
    Else
      MessageBox.Show("At least one is not true")
    End If
  End Sub
  Public Function OddEven(ByVal Number As Integer) As Integer
    ' Purpose:  This function returns 1 if the number is odd,
    '           and returns 0 otherwise.
    '
    ' Arguments:
    '   Number      The integer number to test
    '
    ' Return Value:
    '   integer     1 if odd, 0 if even
    '
    OddEven = Number Mod 2
  End Function

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

End Class
