There is no button1 in your code. There is a btnExit though. In future post correct code and information to avoid confusion.

You problem is a common one. You have 2 btnExit variables. An instance...