Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Public Class LibraryMenu
- Private Sub LibraryMenu_Load(sender As Object, e As EventArgs) Handles MyBase.Load
- If Security = 1 Then 'if the access level linked to the user is 1 then:
- btn_Members.BackColor = Color.Gray 'make the colour of the member form button gray to show that it is inaccessible
- Me.Text = "Menu: Librarian" 'rename the form to show the access level of the user
- btn_Members.Enabled = False 'disable the use of the member button
- End If
- If Security = 2 Then 'if the access level linked to the user is 2 then:
- Me.Text = "Menu: Receptionist" 'rename the form to show the access level of the user
- End If
- If Security = 3 Then 'if the access level linked to the user is 3 then:
- Me.Text = "Menu: Admin" 'rename the form to show the access level of the user
- End If
- End Sub
- Private Sub pbx_ExitButton_Click(sender As Object, e As EventArgs) Handles pbx_ExitButton.Click
- If MsgBox("Are you sure you want to quit the program?", vbYesNo) = vbYes Then
- 'when the exit button is clicked, exit the program if yes is selected
- Application.Exit() 'exit the program
- End If
- End Sub
- Private Sub btn_Staff_Click(sender As Object, e As EventArgs) Handles btn_Staff.Click
- Dim staff As New Staff 'creates new instance of the staff form
- staff.Show() 'shows the staff form
- Me.Close() 'closes the currrent form
- End Sub
- Private Sub btn_Members_Click(sender As Object, e As EventArgs) Handles btn_Members.Click
- Dim member As New Member 'creates new instance of the member form
- member.Show() 'shows the member form
- Me.Close() 'closes the currrent form
- End Sub
- Private Sub btn_Books_Click(sender As Object, e As EventArgs) Handles btn_Books.Click
- Dim books As New Books 'creates new instance of the books form
- books.Show() 'shows the books form
- Me.Close() 'closes the currrent form
- End Sub
- Private Sub btn_Help_Click(sender As Object, e As EventArgs) Handles btn_Help.Click
- Help.txt_help.Text = "This is the menu form. Click on one of the three buttons to be redirected to the respective form. " _
- & "If you click the cross button in the top right of the form, you will exit the program."
- Help.Show()
- End Sub
- End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement