I am having a problem with my code.
I was trying to make an application. the application is very simple but when i was typing the code it said there was two errors. The first error was ('ElseIf' must be preceded by a matching 'If' or 'ElseIf'.) The second error was ('End If' must be preceded by a matching 'If'.) I really need help to get this code error free. The code is at the end of this page. Thanks for helping.
The code
Public Class Form1
Dim door As String = "locked"
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If door = "locked" Then Button1.Text = "Unlock"
Label1.Text = "The door is locked"
MessageBox.Show("The door is locked.")
door = "unlocked"
ElseIf door = "unlocked" Then Button1.Text = "Lock"
MessageBox.Show("The door is unlocked.")
Label1.Text = "The door is unlocked"
door = "locked"
End if
End Sub
End Class

