I copied the exact codes from my textbook and I have the following errors.
Error 3 'txtOutput' is not declared. It may be inaccessible due to its protection level. C:\Users\Woong-Sup\AppData\Local\Temporary Projects\WindowsApplication1\Form1.vb 13 17 WindowsApplication1
Error 4 'txtOutput' is not declared. It may be inaccessible due to its protection level. C:\Users\Woong-Sup\AppData\Local\Temporary Projects\WindowsApplication1\Form1.vb 15 17 WindowsApplication1
Error 1 Handles clause requires a WithEvents variable defined in the containing type or one of its base types. C:\Users\Woong-Sup\AppData\Local\Temporary Projects\WindowsApplication1\Form1.vb 2 44 WindowsApplication1
Could anyone please tell me what the problem is? And I would appreciate if I could add you on my msn and ask some more questions! thanks
Public Class Form1
Private Sub btnDisplay_Click() Handles btnDisplay.Click
Dim anyDate As Date
anyDate = CDate(InputBox("Input a date. (mm/dd/yyyy)"))
ShowCentury(anyDate)
End Sub
Sub ShowCentury(ByVal anyDate As Date)
Select Case anyDate
Case Is >= #1/1/2000#
txtOutput.Text = "twenty-first century"
Case Is >= #1/1/1900#
txtOutput.Text = "twentieth century"
Case Else
txtOutput.Text = "prior to the twentieth century"
End Select
End Sub
End Class