Public Class frmMain
    Private Sub frmMain_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        Me.FormBorderStyle = FormBorderStyle.None
        Me.WindowState = FormWindowState.Maximized
    End Sub

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

    End Sub

    Private Sub EForm_Click(sender As Object, e As EventArgs) Handles btnEForm.Click
        Dim f As frmEForm = New frmEForm()
        f.TopLevel = False
        f.FormBorderStyle = FormBorderStyle.None
        f.WindowState = FormWindowState.Maximized
        f.Visible = True
        Panel2.Controls.Clear()
        Panel2.Controls.Add(f)
        sql = "SELECT CONCAT(`NAME`, `STRT`) AS 'AUTO' FROM `autonumber` WHERE `ID`=1"
        filltxtAuto(sql, f.txtStudentId)
    End Sub

    Private Sub btnEnroll_Click(sender As Object, e As EventArgs) Handles btnEnroll.Click
        Dim f As frmenrollment = New frmenrollment()
        f.TopLevel = False
        f.FormBorderStyle = FormBorderStyle.None
        f.WindowState = FormWindowState.Maximized
        f.Visible = True
        Panel2.Controls.Clear()
        Panel2.Controls.Add(f)
    End Sub

    Private Sub btnStudent_Click(sender As Object, e As EventArgs) Handles btnStudent.Click
        'frmStudents.Show()
        'frmStudents.Focus()
        ''frmStudents.TabControl1.Controls.Add(frmStudents.TabPage1)
        ''frmStudents.TabControl1.Controls.Add(frmStudents.TabPage5)
        'frmStudents.TabControl1.Controls.Remove(frmStudents.TabPage2)

        Dim f As frmManageStudents = New frmManageStudents()
        f.TopLevel = False
        f.FormBorderStyle = FormBorderStyle.None
        f.WindowState = FormWindowState.Maximized
        f.Visible = True
        Panel2.Controls.Clear()
        Panel2.Controls.Add(f)
    End Sub

    Private Sub btnSubjects_Click(sender As Object, e As EventArgs) Handles btnSubjects.Click
        Dim f As frmManageSubjects = New frmManageSubjects()
        f.TopLevel = False
        f.FormBorderStyle = FormBorderStyle.None
        f.WindowState = FormWindowState.Maximized
        f.Visible = True
        Panel2.Controls.Clear()
        Panel2.Controls.Add(f)
    End Sub

    Private Sub btnUsers_Click(sender As Object, e As EventArgs) Handles btnUsers.Click
        Dim f As frmManageUsers = New frmManageUsers()
        f.TopLevel = False
        f.FormBorderStyle = FormBorderStyle.None
        f.WindowState = FormWindowState.Maximized
        f.Visible = True
        Panel2.Controls.Clear()
        Panel2.Controls.Add(f)
    End Sub

    Private Sub btnReports_Click(sender As Object, e As EventArgs) Handles btnReports.Click
        Dim f As frmreports = New frmreports()
        'f.TopLevel = False
        f.FormBorderStyle = FormBorderStyle.None
        f.WindowState = FormWindowState.Maximized
        'f.Dock = DockStyle.Fill
        'f.Visible = True
        'f.BringToFront()
        f.ShowDialog()
        'Panel2.Controls.Clear()
        'Panel2.Controls.Add(f)
    End Sub

    Private Sub btnSettings_Click(sender As Object, e As EventArgs) Handles btnSettings.Click
        Dim f As frmsettings = New frmsettings()
        f.TopLevel = False
        f.FormBorderStyle = FormBorderStyle.None
        f.WindowState = FormWindowState.Maximized
        f.Visible = True
        Panel2.Controls.Clear()
        Panel2.Controls.Add(f)
    End Sub
End Class