Public Class MainForm
    Public Sub closeFRM()
        For Each frm As Form In Me.MdiChildren
            frm.Close()
        Next
    End Sub
    Public Sub showFRM(frm As Form)
        With frm
            .MdiParent = Me
            .StartPosition = FormStartPosition.CenterScreen
            .Show()
        End With
    End Sub
    Private Sub MainForm_Load(sender As Object, e As EventArgs) Handles MyBase.Load

    End Sub

    Private Sub btnCustomer_Click(sender As Object, e As EventArgs) Handles btnCustomer.Click
        closeFRM()
        showFRM(New customer)
    End Sub

    Private Sub btnRent_Click(sender As Object, e As EventArgs) Handles btnRent.Click
        closeFRM()
        showFRM(New Rent)
    End Sub

    Private Sub btnTransaction_Click(sender As Object, e As EventArgs) Handles btnTransaction.Click
        closeFRM()
        showFRM(New TransactionViewer)
    End Sub

    Private Sub btnUser_Click(sender As Object, e As EventArgs) Handles btnUser.Click
        closeFRM()
        showFRM(New AddUser)
    End Sub

    Private Sub btnReports_Click(sender As Object, e As EventArgs) Handles btnListUserReports.Click
        closeFRM()
        showFRM(New userlist)
    End Sub

    Private Sub btnrptCus_Click(sender As Object, e As EventArgs) Handles btnrptCus.Click
        closeFRM()
        showFRM(New cusReport)
    End Sub

    Private Sub btnRptTrans_Click(sender As Object, e As EventArgs) Handles btnRptTrans.Click
        closeFRM()
        showFRM(New report)
    End Sub

    Private Sub btnRptInventory_Click(sender As Object, e As EventArgs) Handles btnRptInventory.Click
        closeFRM()
        showFRM(New report)
    End Sub

    Private Sub btnLogout_Click(sender As Object, e As EventArgs) Handles btnLogout.Click
        Me.Close()
        LoginForm.Show()
    End Sub
End Class