Imports System.Windows.Forms
Public Class 楠晉鞋業AAS
    Dim screenWidth = Screen.PrimaryScreen.Bounds.Width
    Dim screenHeight = Screen.PrimaryScreen.Bounds.Height
    Private Sub ShowNewForm(ByVal sender As Object, ByVal e As EventArgs) Handles NewWindowToolStripMenuItem.Click
        ' 建立子表單的新執行個體。
        Dim ChildForm As New System.Windows.Forms.Form
        ' 將它變成這個 MDI 表單的子表單，然後才顯示。
        ChildForm.MdiParent = Me
        m_ChildFormNumber += 1
        ChildForm.Text = "視窗 " & m_ChildFormNumber
        ChildForm.Show()
    End Sub
    Private Sub OpenFile(ByVal sender As Object, ByVal e As EventArgs)
        Dim OpenFileDialog As New OpenFileDialog
        OpenFileDialog.InitialDirectory = My.Computer.FileSystem.SpecialDirectories.MyDocuments
        OpenFileDialog.Filter = "文字檔 (*.txt)|*.txt|所有檔案 (*.*)|*.*"
        If (OpenFileDialog.ShowDialog(Me) = System.Windows.Forms.DialogResult.OK) Then
            Dim FileName As String = OpenFileDialog.FileName
            ' TODO: 在此加入開啟檔案的程式碼。
        End If
    End Sub
    Private Sub SaveAsToolStripMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs)
        Dim SaveFileDialog As New SaveFileDialog
        SaveFileDialog.InitialDirectory = My.Computer.FileSystem.SpecialDirectories.MyDocuments
        SaveFileDialog.Filter = "文字檔 (*.txt)|*.txt|所有檔案 (*.*)|*.*"
        If (SaveFileDialog.ShowDialog(Me) = System.Windows.Forms.DialogResult.OK) Then
            Dim FileName As String = SaveFileDialog.FileName
            ' TODO: 在此加入程式碼，將表單目前的內容儲存成檔案。
        End If
    End Sub
    Private Sub ExitToolsStripMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs) Handles ExitToolStripMenuItem.Click
        Me.Close()
    End Sub
    Private Sub CascadeToolStripMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs) Handles CascadeToolStripMenuItem.Click
        Me.LayoutMdi(MdiLayout.Cascade)
    End Sub
    Private Sub TileVerticalToolStripMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs) Handles TileVerticalToolStripMenuItem.Click
        Me.LayoutMdi(MdiLayout.TileVertical)
    End Sub
    Private Sub TileHorizontalToolStripMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs) Handles TileHorizontalToolStripMenuItem.Click
        Me.LayoutMdi(MdiLayout.TileHorizontal)
    End Sub
    Private Sub ArrangeIconsToolStripMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs) Handles ArrangeIconsToolStripMenuItem.Click
        Me.LayoutMdi(MdiLayout.ArrangeIcons)
    End Sub
    Private Sub CloseAllToolStripMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs) Handles CloseAllToolStripMenuItem.Click
        ' 關閉父表單的所有子表單。
        For Each ChildForm As Form In Me.MdiChildren
            ChildForm.Close()
        Next
    End Sub
    Private m_ChildFormNumber As Integer
    Private Sub 楠晉鞋業AAS_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        Me.Text = Me.Text & "  --  " & g_conn_type & "  --  " & gUserName & "  --  系統版本  :" & 版本
    End Sub
    Private Sub 楠晉鞋業AAS_Unload(sender As Object, e As EventArgs) Handles MyBase.Closing
        LoginForm1.Close()
    End Sub
    Private Sub 楠晉鞋業AAS_Resize(sender As Object, e As EventArgs) Handles MyBase.Resize, MyBase.Resize
        If screenWidth = 1920 And screenHeight = 1080 Then : Me.BackgroundImage = My.Resources._1980X1010
        ElseIf screenWidth = 1366 And screenHeight = 768 Then : Me.BackgroundImage = My.Resources._1366X719
        ElseIf screenWidth = 1440 And screenHeight = 900 Then : Me.BackgroundImage = My.Resources._1440X828
        ElseIf screenWidth = 1280 And screenHeight = 1024 Then : Me.BackgroundImage = My.Resources._1280X956
        ElseIf screenWidth = 1600 And screenHeight = 900 Then : Me.BackgroundImage = My.Resources._1601X896
        End If
        Me.BackgroundImageLayout = 3
    End Sub
    Private Sub 系統使用者資料ToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles 系統使用者資料ToolStripMenuItem.Click
        系統使用者管理.Show() : 系統使用者管理.BringToFront()
    End Sub
    Private Sub 人員名單入錄ToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles 人員名單入錄ToolStripMenuItem.Click
        人員名單入錄.Show() : 人員名單入錄.BringToFront()
    End Sub
    Private Sub 系統資料庫維護ToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles 系統資料庫維護ToolStripMenuItem.Click
        系統資料庫維護.Show() : 系統資料庫維護.BringToFront()
    End Sub
    Private Sub 考勤管理人員ToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles 考勤管理人員ToolStripMenuItem.Click
        考勤管理_依人員.Show() : 考勤管理_依人員.BringToFront()
    End Sub
    Private Sub 考勤管理依日期ToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles 考勤管理依日期ToolStripMenuItem.Click
        考勤管理_依日期.Show() : 考勤管理_依日期.BringToFront()
    End Sub
End Class
