Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Public Class MainMenu 'main menu form
- Private Sub MainMenu_Load(sender As Object, e As EventArgs) Handles MyBase.Load
- Me.CenterToScreen()
- btn_customerData.Visible = False 'Hide the buttons so that they can be revealed for the correct level of access
- btn_borrowingData.Visible = False
- btn_loginData.Visible = False
- btn_backup.Visible = False
- Dim startupPath As String 'store the location the file is running
- startupPath = Application.StartupPath
- If levelOfAccess = 3 Then
- Me.BackColor = Color.FromArgb(247, 220, 143) 'For admins use yellow
- End If
- If levelOfAccess = 2 Then
- Me.BackColor = Color.FromArgb(140, 227, 245) 'For librarians use a blue background instead of the standard green
- End If
- If levelOfAccess = 1 Then
- Me.BackColor = Color.FromArgb(163, 255, 166) 'For customers use standard green
- End If
- If levelOfAccess = 3 Then
- btn_loginData.Visible = True 'Make the login details form only accessible by admins
- btn_backup.Visible = True
- End If
- If levelOfAccess > 1 Then
- btn_customerData.Visible = True 'Make the customer data form and borrowing data form not available to customers
- btn_borrowingData.Visible = True
- End If
- pbx_logo.ImageLocation = startupPath & "\PennardLibraryLogo.png" 'set image locations
- pbx_exit.ImageLocation = startupPath & "\Exit.png"
- End Sub
- Private Sub pbx_exit_MouseHover(sender As Object, e As EventArgs) Handles pbx_exit.MouseHover 'rollover
- Dim startupPath As String 'store the location the file is running
- startupPath = Application.StartupPath
- pbx_exit.ImageLocation = startupPath & "\ExitRollover.png" 'rollover image
- End Sub
- Private Sub pbx_exit_MouseLeave(sender As Object, e As EventArgs) Handles pbx_exit.MouseLeave
- Dim startupPath As String 'store the location the file is running
- startupPath = Application.StartupPath
- pbx_exit.ImageLocation = startupPath & "\Exit.png" 'back to normal image
- End Sub
- Private Sub pbx_exit_Click(sender As Object, e As EventArgs) Handles pbx_exit.Click
- Application.Exit() 'close program
- End Sub
- Private Sub btn_logout_Click(sender As Object, e As EventArgs) Handles btn_logout.Click
- Dim Login As New Login 'new instance of login form
- Login.Show() 'show new form
- Me.Close() 'close old form
- End Sub
- Private Sub btn_catalogue_Click(sender As Object, e As EventArgs) Handles btn_catalogue.Click
- Dim Catalogue As New Catalogue 'new instance of catalogue form
- Catalogue.Show() 'show new form
- Me.Close() 'close current form
- End Sub
- Private Sub btn_dueDates_Click(sender As Object, e As EventArgs) Handles btn_dueDates.Click
- Dim DueDates As New DueDates 'new instance of due dates form
- DueDates.Show() 'show new form
- Me.Close() 'close current form
- End Sub
- Private Sub btn_customerData_Click(sender As Object, e As EventArgs) Handles btn_customerData.Click
- Dim CustomerData As New CustomerData 'new instance of customer data form
- CustomerData.Show() 'show new form
- Me.Close() 'close current form
- End Sub
- Private Sub btn_borrowingData_Click(sender As Object, e As EventArgs) Handles btn_borrowingData.Click
- Dim BorrowingData As New BorrowingData 'new instance of borrowing data form
- BorrowingData.Show() 'show new form
- Me.Close() 'close current form
- End Sub
- Private Sub btn_loginData_Click(sender As Object, e As EventArgs) Handles btn_loginData.Click
- Dim LoginData As New LoginData 'new instance of login data form
- LoginData.Show() 'show new form
- Me.Close() 'close current form
- End Sub
- Private Sub btn_backup_Click(sender As Object, e As EventArgs) Handles btn_backup.Click
- Dim Backup As New Backup 'new instance of backup form
- Backup.Show() 'show new form
- Me.Close() 'close current form
- End Sub
- End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement