Option Strict Off
Imports System.IO
Public Class 供應商管理
    Dim RI As Integer = -1
    Dim SK As String = "要查找的 KEY"
    Dim Str As String = Application.StartupPath
    Private ReadOnly 對話框(11) As String
    Private Sub 讀取供應商料表()
        Dim ds As New DataSet : 廠商清單_dgv.DataSource = Nothing : ds.Clear()
        廠商清單_dgv.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
        廠商清單_dgv.ColumnHeadersHeight = 25 : 廠商清單_dgv.AllowUserToAddRows = False : 廠商清單_dgv.RowTemplate.Height = 35

        SQL_建築物料供應商資料管理_清單()
        列印用SQL = SQL1 : da.Fill(ds) : 廠商清單_dgv.DataSource = ds.Tables(0)

        廠商清單_dgv.Columns(0).FillWeight = 80 : 廠商清單_dgv.Columns(1).FillWeight = 150 : 廠商清單_dgv.Columns(2).FillWeight = 200
        廠商清單_dgv.Columns(3).FillWeight = 400 : 廠商清單_dgv.Columns(4).FillWeight = 120 : 廠商清單_dgv.Columns(5).Visible = False
        廠商清單_dgv.Columns(6).Visible = False : 廠商清單_dgv.Columns(7).FillWeight = 120 : 廠商清單_dgv.Columns(8).Visible = False
        廠商清單_dgv.Columns(9).Visible = False : 廠商清單_dgv.Columns(10).FillWeight = 120 : 廠商清單_dgv.Columns(11).FillWeight = 120
        廠商清單_dgv.Columns(12).Visible = False
        廠商清單_dgv.Columns(13).Visible = False : 廠商清單_dgv.Columns(14).Visible = False : 廠商清單_dgv.Columns(15).Visible = False
        廠商清單_dgv.Columns(16).Visible = False : 廠商清單_dgv.Columns(17).Visible = False : 廠商清單_dgv.Columns(18).Visible = False
        廠商清單_dgv.Columns(19).Visible = False : 廠商清單_dgv.Columns(20).Visible = False : 廠商清單_dgv.Columns(21).Visible = False
        廠商清單_dgv.Columns(22).Visible = False : 廠商清單_dgv.Columns(23).FillWeight = 30

        For I As Integer = 0 To 22 : 廠商清單_dgv.Columns(I).ReadOnly = True : Next
        For I As Integer = 0 To 廠商清單_dgv.Rows.Count - 1 : If IsDBNull(廠商清單_dgv(23, I).Value) Then : 廠商清單_dgv(23, I).Value = False : End If : Next
    End Sub
    Private Sub 格式設定1()
        供應商編號_tb.Enabled = False : 確認新增_bt.Enabled = False : 新增_bt.Enabled = True
        If 深色風格 = False Then
            簡稱_lb.ForeColor = Color.Black : 公司名_ib.ForeColor = Color.Black : 公司地址_lb.ForeColor = Color.Black : 公司電話1_lb.ForeColor = Color.Black : 傳真1_lb.ForeColor = Color.Black
        Else
            簡稱_lb.ForeColor = Color.White : 公司名_ib.ForeColor = Color.White : 公司地址_lb.ForeColor = Color.White : 公司電話1_lb.ForeColor = Color.White : 傳真1_lb.ForeColor = Color.White
        End If
    End Sub
    Private Sub 格式設定2()
        If 深色風格 = False Then
            簡稱_lb.ForeColor = Color.Red : 公司名_ib.ForeColor = Color.Red : 公司地址_lb.ForeColor = Color.Red : 公司電話1_lb.ForeColor = Color.Red : 傳真1_lb.ForeColor = Color.Red
        Else
            簡稱_lb.ForeColor = Color.LightPink : 公司名_ib.ForeColor = Color.LightPink : 公司地址_lb.ForeColor = Color.LightPink
            公司電話1_lb.ForeColor = Color.LightPink : 傳真1_lb.ForeColor = Color.LightPink
        End If
    End Sub
    Private Sub Set_語言()
        語言_dgv.DataSource = Nothing
        語言_dgv.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
        語言_dgv.ColumnHeadersHeight = 25
        語言_dgv.AllowUserToAddRows = False
        For i As Integer = 0 To 語言_dgv.Rows.Count - 1 : 語言_dgv.Rows.RemoveAt(0) : Next
        If File.Exists(Str + "\LANGUAGE_FILE.csv") Then
            Dim filereader = My.Computer.FileSystem.OpenTextFileReader(Str + "\LANGUAGE_FILE.csv", System.Text.Encoding.Default)
            Dim line As String = filereader.ReadLine()
            While Not (line Is Nothing)
                line = filereader.ReadLine()
                If line <> Nothing Then
                    line = line.Replace("""", "")
                    If Strings.Left(line, 4) = "G000" Or Strings.Left(line, 8) = "H001-167" Or Strings.Left(line, 4) = 介面 Then
                        If 系統語言 = "繁體中文" Then
                            If Strings.Mid(line, 10, 2) = "CH" Then : 語言_dgv.Rows.Insert(0)
                                語言_dgv.Rows(0).Cells(0).Value = Strings.Left(line, 11)
                                If Strings.Mid(line, 13, 300).EndsWith(",") Then
                                    語言_dgv.Rows(0).Cells(1).Value = Strings.Mid(line, 13, 300).Substring(0, Strings.Mid(line, 13, 300).Length - 1)
                                Else : 語言_dgv.Rows(0).Cells(1).Value = Strings.Mid(line, 13, 300) : End If
                            End If
                        ElseIf 系統語言 = "English" Then
                            If Strings.Mid(line, 10, 2) = "EN" Then : 語言_dgv.Rows.Insert(0)
                                語言_dgv.Rows(0).Cells(0).Value = Strings.Left(line, 11)
                                If Strings.Mid(line, 13, 300).EndsWith(",") Then
                                    語言_dgv.Rows(0).Cells(1).Value = Strings.Mid(line, 13, 300).Substring(0, Strings.Mid(line, 13, 300).Length - 1)
                                Else : 語言_dgv.Rows(0).Cells(1).Value = Strings.Mid(line, 13, 300) : End If
                            End If
                        ElseIf 系統語言 = "Indonesian" Then
                            If Strings.Mid(line, 10, 2) = "IN" Then : 語言_dgv.Rows.Insert(0)
                                語言_dgv.Rows(0).Cells(0).Value = Strings.Left(line, 11)
                                If Strings.Mid(line, 13, 300).EndsWith(",") Then
                                    語言_dgv.Rows(0).Cells(1).Value = Strings.Mid(line, 13, 300).Substring(0, Strings.Mid(line, 13, 300).Length - 1)
                                Else : 語言_dgv.Rows(0).Cells(1).Value = Strings.Mid(line, 13, 300) : End If
                            End If
                        End If
                    End If
                End If
            End While
            filereader.Close()
        End If
    End Sub
    Private Sub Set_語言查詢()
        RI = -1 : For Each row As DataGridViewRow In 語言_dgv.Rows
            If Strings.Left(row.Cells(0).Value.ToString(), 8) = SK Then
                RI = row.Index : Exit For
            End If
        Next
    End Sub
    Private Sub 語言轉換讀取()
        Set_語言()
        SK = "H001-167" : Set_語言查詢() : Me.Text = 語言_dgv(1, RI).Value.ToString : SK = "G000-108" : Set_語言查詢() : ToolTip1.ToolTipTitle = 語言_dgv(1, RI).Value.ToString
        SK = "H299-100" : Set_語言查詢() : 公司名_ib.Text = 語言_dgv(1, RI).Value.ToString : SK = "H299-101" : Set_語言查詢() : 公司地址_lb.Text = 語言_dgv(1, RI).Value.ToString
        SK = "H299-102" : Set_語言查詢() : 公司電話1_lb.Text = 語言_dgv(1, RI).Value.ToString : SK = "H299-103" : Set_語言查詢() : 公司電話2_lb.Text = 語言_dgv(1, RI).Value.ToString
        SK = "H299-104" : Set_語言查詢() : 公司電話3_lb.Text = 語言_dgv(1, RI).Value.ToString : SK = "H299-105" : Set_語言查詢() : 對話框(11) = 語言_dgv(1, RI).Value.ToString
        SK = "H299-106" : Set_語言查詢() : 供應商編號_lb.Text = 語言_dgv(1, RI).Value.ToString : SK = "H299-107" : Set_語言查詢() : 對話框(7) = 語言_dgv(1, RI).Value.ToString
        SK = "H299-108" : Set_語言查詢() : 對話框(10) = 語言_dgv(1, RI).Value.ToString : SK = "H299-109" : Set_語言查詢() : 表頭(51) = 語言_dgv(1, RI).Value.ToString
        SK = "H299-110" : Set_語言查詢() : 表頭(53) = 語言_dgv(1, RI).Value.ToString : SK = "H299-111" : Set_語言查詢() : 表頭(54) = 語言_dgv(1, RI).Value.ToString
        SK = "H299-112" : Set_語言查詢() : 表頭(55) = 語言_dgv(1, RI).Value.ToString : SK = "H299-113" : Set_語言查詢() : 表頭(52) = 語言_dgv(1, RI).Value.ToString
        SK = "H299-114" : Set_語言查詢() : 表頭(56) = 語言_dgv(1, RI).Value.ToString : SK = "H299-115" : Set_語言查詢() : 表頭(57) = 語言_dgv(1, RI).Value.ToString
        SK = "H299-116" : Set_語言查詢() : 表頭(58) = 語言_dgv(1, RI).Value.ToString : SK = "H299-117" : Set_語言查詢() : 表頭(49) = 語言_dgv(1, RI).Value.ToString
        SK = "H299-118" : Set_語言查詢() : 表頭(59) = 語言_dgv(1, RI).Value.ToString : SK = "H299-119" : Set_語言查詢() : 表頭(60) = 語言_dgv(1, RI).Value.ToString
        SK = "H299-120" : Set_語言查詢() : 表頭(61) = 語言_dgv(1, RI).Value.ToString : SK = "H299-121" : Set_語言查詢() : 表頭(50) = 語言_dgv(1, RI).Value.ToString
        SK = "H299-122" : Set_語言查詢() : 傳真1_lb.Text = 語言_dgv(1, RI).Value.ToString : SK = "H299-123" : Set_語言查詢() : 傳真2_lb.Text = 語言_dgv(1, RI).Value.ToString
        SK = "H299-124" : Set_語言查詢() : 傳真3_lb.Text = 語言_dgv(1, RI).Value.ToString : SK = "H299-125" : Set_語言查詢() : 對話框(8) = 語言_dgv(1, RI).Value.ToString
        SK = "H299-126" : Set_語言查詢() : 對話框(0) = 語言_dgv(1, RI).Value.ToString : SK = "H299-127" : Set_語言查詢() : 對話框(1) = 語言_dgv(1, RI).Value.ToString
        SK = "H299-128" : Set_語言查詢() : 對話框(2) = 語言_dgv(1, RI).Value.ToString : SK = "H299-129" : Set_語言查詢() : 對話框(3) = 語言_dgv(1, RI).Value.ToString
        SK = "H299-130" : Set_語言查詢() : 對話框(4) = 語言_dgv(1, RI).Value.ToString : SK = "H299-131" : Set_語言查詢() : 對話框(5) = 語言_dgv(1, RI).Value.ToString
        SK = "H299-132" : Set_語言查詢() : 對話框(9) = 語言_dgv(1, RI).Value.ToString : SK = "H299-133" : Set_語言查詢() : 聯繫人1_lb.Text = 語言_dgv(1, RI).Value.ToString
        SK = "H299-134" : Set_語言查詢() : 聯繫人2_lb.Text = 語言_dgv(1, RI).Value.ToString : SK = "H299-135" : Set_語言查詢() : 聯繫人3_lb.Text = 語言_dgv(1, RI).Value.ToString
        SK = "H299-136" : Set_語言查詢() : 聯繫人信箱1_lb.Text = 語言_dgv(1, RI).Value.ToString : SK = "H299-137" : Set_語言查詢() : 聯繫人信箱2_lb.Text = 語言_dgv(1, RI).Value.ToString
        SK = "H299-138" : Set_語言查詢() : 聯繫人信箱3_lb.Text = 語言_dgv(1, RI).Value.ToString : SK = "H299-139" : Set_語言查詢() : 聯繫人電話1_lb.Text = 語言_dgv(1, RI).Value.ToString
        SK = "H299-140" : Set_語言查詢() : 聯繫人電話2_lb.Text = 語言_dgv(1, RI).Value.ToString : SK = "H299-141" : Set_語言查詢() : 聯繫人電話3_lb.Text = 語言_dgv(1, RI).Value.ToString
        SK = "H299-142" : Set_語言查詢() : 聯繫人職稱1_lb.Text = 語言_dgv(1, RI).Value.ToString : SK = "H299-143" : Set_語言查詢() : 聯繫人職稱2_lb.Text = 語言_dgv(1, RI).Value.ToString
        SK = "H299-144" : Set_語言查詢() : 聯繫人職稱3_lb.Text = 語言_dgv(1, RI).Value.ToString : SK = "H299-145" : Set_語言查詢() : 簡稱_lb.Text = 語言_dgv(1, RI).Value.ToString
        SK = "H299-146" : Set_語言查詢() : 對話框(6) = 語言_dgv(1, RI).Value.ToString
    End Sub
    Private Sub 類別管理_bt_MouseEnter(sender As Object, e As EventArgs) Handles 類別管理_bt.MouseEnter
        ToolTip1.SetToolTip(Me.類別管理_bt, 對話框(6))
    End Sub
    Private Sub 查詢_bt_MouseEnter(sender As Object, e As EventArgs) Handles 查詢_bt.MouseEnter
        ToolTip1.SetToolTip(Me.查詢_bt, 對話框(7))
    End Sub
    Private Sub 新增_bt_MouseEnter(sender As Object, e As EventArgs) Handles 新增_bt.MouseEnter
        ToolTip1.SetToolTip(Me.新增_bt, 對話框(8))
    End Sub
    Private Sub 確認新增_bt_MouseEnter(sender As Object, e As EventArgs) Handles 確認新增_bt.MouseEnter
        ToolTip1.SetToolTip(Me.確認新增_bt, 對話框(9))
    End Sub
    Private Sub 修改_bt_MouseEnter(sender As Object, e As EventArgs) Handles 修改_bt.MouseEnter
        ToolTip1.SetToolTip(Me.修改_bt, 對話框(10))
    End Sub
    Private Sub 刪除_bt_MouseEnter(sender As Object, e As EventArgs) Handles 刪除_bt.MouseEnter
        ToolTip1.SetToolTip(Me.刪除_bt, 對話框(11))
    End Sub
    Private Sub 類別管理_cb_下拉表單資料載入()
        SQL_供應商類別_下拉清單() : 類別管理_cb.Items.Clear()
        While (dr.Read()) : 類別管理_cb.Items.Add(dr("類別")) : End While : conn.Close()
    End Sub
    Private Sub 供應商管理_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        Me.MdiParent = HX_PGS_ERP_SYS : Me.WindowState = 2 : Me.AutoScroll = True
        風格() : H(299) = True : 介面 = "H299" : 顯示說明(999, False) : 語言轉換讀取() : PA = "" : Panel1.SendToBack()
        If CC(12) = False Then : 新增_bt.Enabled = False : 修改_bt.Enabled = False : End If
        If CC(13) = False Then : 刪除_bt.Enabled = False : End If
        清單字體大小調整()
    End Sub
    Private Sub 供應商管理_Shown(sender As Object, e As EventArgs) Handles MyBase.Shown
        格式設定1() : 讀取供應商料表() : 類別管理_cb_下拉表單資料載入()
    End Sub
    Private Sub 供應商管理_SizeChanged(sender As Object, e As EventArgs) Handles MyBase.SizeChanged
        清單字體大小調整()
    End Sub
    Private Sub 清單字體大小調整()
        MyMod.清單字體大小調整()
        廠商清單_dgv.RowsDefaultCellStyle.Font = New System.Drawing.Font("微軟正黑體", HX_PGS_ERP_SYS.字體_NUD.Value)
    End Sub
    Private Sub 採購單詢價_Closed(sender As Object, e As EventArgs) Handles MyBase.Closed
        H(299) = False : MyMod.虛擬桌面開啟()
    End Sub
    Private Sub 語轉扭_bt_Click(sender As Object, e As EventArgs) Handles 語轉扭_bt.Click
        介面 = "H299" : 語言轉換讀取() : 讀取供應商料表() : 類別管理_cb_下拉表單資料載入()
    End Sub
    Private Sub 登入閒置控制_MouseMove(sender As Object, e As EventArgs) Handles MyBase.MouseMove
        timeNow = 0 : HX_PGS_ERP_SYS.Timer1.Enabled = False : HX_PGS_ERP_SYS.Timer1.Enabled = True
    End Sub
    Private Sub 登入閒置控制_KeyPress(sender As Object, e As EventArgs) Handles MyBase.KeyPress
        timeNow = 0 : HX_PGS_ERP_SYS.Timer1.Enabled = False : HX_PGS_ERP_SYS.Timer1.Enabled = True
    End Sub
    Private Sub 廠商清單_dgv_CellClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles 廠商清單_dgv.CellClick
        If e.RowIndex = -1 Then : Else
            供應商編號_tb.Text = 廠商清單_dgv(0, e.RowIndex).Value.ToString : 供應商簡稱_tb.Text = 廠商清單_dgv(22, e.RowIndex).Value.ToString
            公司名_tb.Text = 廠商清單_dgv(2, e.RowIndex).Value.ToString : 地址_tb.Text = 廠商清單_dgv(3, e.RowIndex).Value.ToString
            電話1_tb.Text = 廠商清單_dgv(4, e.RowIndex).Value.ToString : 電話2_tb.Text = 廠商清單_dgv(5, e.RowIndex).Value.ToString
            電話3_tb.Text = 廠商清單_dgv(6, e.RowIndex).Value.ToString : 傳真1_tb.Text = 廠商清單_dgv(7, e.RowIndex).Value.ToString
            傳真2_tb.Text = 廠商清單_dgv(8, e.RowIndex).Value.ToString : 傳真3_tb.Text = 廠商清單_dgv(9, e.RowIndex).Value.ToString
            聯繫人1_tb.Text = 廠商清單_dgv(10, e.RowIndex).Value.ToString : 聯繫人2_tb.Text = 廠商清單_dgv(11, e.RowIndex).Value.ToString
            聯繫人3_tb.Text = 廠商清單_dgv(12, e.RowIndex).Value.ToString : 職稱1_tb.Text = 廠商清單_dgv(13, e.RowIndex).Value.ToString
            職稱2_tb.Text = 廠商清單_dgv(14, e.RowIndex).Value.ToString : 職稱3_tb.Text = 廠商清單_dgv(15, e.RowIndex).Value.ToString
            聯繫電話1_tb.Text = 廠商清單_dgv(16, e.RowIndex).Value.ToString : 聯繫電話2_tb.Text = 廠商清單_dgv(17, e.RowIndex).Value.ToString
            聯繫電話3_tb.Text = 廠商清單_dgv(18, e.RowIndex).Value.ToString : 信箱1_tb.Text = 廠商清單_dgv(19, e.RowIndex).Value.ToString
            信箱2_tb.Text = 廠商清單_dgv(20, e.RowIndex).Value.ToString : 信箱3_tb.Text = 廠商清單_dgv(21, e.RowIndex).Value.ToString
            特殊_ch.Checked = 廠商清單_dgv(23, e.RowIndex).Value
            If 廠商清單_dgv(1, e.RowIndex).Value.ToString = "" Then : 類別管理_cb_下拉表單資料載入() : Else : 類別管理_cb.Text = 廠商清單_dgv(1, e.RowIndex).Value.ToString : End If
        End If
    End Sub
    Private Sub 新增_bt_Click(sender As Object, e As EventArgs) Handles 新增_bt.Click
        供應商簡稱_tb.Text = "" : 公司名_tb.Text = "" : 地址_tb.Text = "" : 電話1_tb.Text = "" : 電話2_tb.Text = "" : 電話3_tb.Text = "" : 傳真1_tb.Text = ""
        傳真2_tb.Text = "" : 傳真3_tb.Text = "" : 聯繫人1_tb.Text = "" : 聯繫人2_tb.Text = "" : 聯繫人3_tb.Text = "" : 職稱1_tb.Text = "" : 職稱2_tb.Text = ""
        職稱3_tb.Text = "" : 聯繫電話1_tb.Text = "" : 聯繫電話2_tb.Text = "" : 聯繫電話3_tb.Text = "" : 信箱1_tb.Text = "" : 信箱2_tb.Text = "" : 信箱3_tb.Text = ""

        SQL_建築物料供應商資料管理_最後一筆資料()
        If dr.Read() Then : 供應商編號_tb.Text = dr("供應商編碼").ToString : Else : 供應商編號_tb.Text = "DS000" : End If : conn.Close()
        Dim NUM1 As Integer = Double.Parse(Strings.Right(供應商編號_tb.Text, 3)) + 1
        If NUM1 < 10 Then : 供應商編號_tb.Text = "DS" & "00" & NUM1
        ElseIf NUM1 > 9 And NUM1 < 100 Then : 供應商編號_tb.Text = "DS" & "0" & NUM1
        ElseIf NUM1 > 99 Then : 供應商編號_tb.Text = "DS" & NUM1 : End If : 格式設定2() : 確認新增_bt.Enabled = True : 新增_bt.Enabled = False
    End Sub
    Private Sub 確認新增_bt_Click(sender As Object, e As EventArgs) Handles 確認新增_bt.Click
        If 供應商簡稱_tb.Text = "" Or 公司名_tb.Text = "" Or 地址_tb.Text = "" Or 電話1_tb.Text = "" Or 傳真1_tb.Text = "" Then : MGB(對話框(0), 1)
        Else : SQL_供應商資料表_新增() : conn.Close() : MGB(對話框(1), 1) : 格式設定1() : 讀取供應商料表() : End If
    End Sub
    Private Sub 修改_bt_Click(sender As Object, e As EventArgs) Handles 修改_bt.Click
        SQL_供應商資料表_修改() : conn.Close() : MGB(對話框(2), 1) : 讀取供應商料表()
    End Sub
    Private Sub 刪除_bt_Click(sender As Object, e As EventArgs) Handles 刪除_bt.Click
        MGB(對話框(3), 2) : If 訊息回應 = "YES" Then : SQL_供應商資料表_刪除() : conn.Close() : MGB(對話框(4), 1) : 讀取供應商料表() : End If
    End Sub
    Private Sub 查詢_bt_Click(sender As Object, e As EventArgs) Handles 查詢_bt.Click
        INB(對話框(5)) : PA = 訊息回應 : 讀取供應商料表() : PA = ""
    End Sub
    Private Sub 類別管理_bt_Click_1(sender As Object, e As EventArgs) Handles 類別管理_bt.Click
        供應商類別管理.ShowDialog() : 供應商類別管理.BringToFront() : 類別管理_cb_下拉表單資料載入()
    End Sub
    Private Sub 類別管理_cb_SelectedIndexChanged(sender As Object, e As EventArgs) Handles 類別管理_cb.SelectedIndexChanged
        PA20 = 類別管理_cb.Text : SQL_供應商類別管理_查詢() : If dr.Read() Then : 供應商簡稱_tb.Text = dr("編碼").ToString : Else : 供應商簡稱_tb.Text = "" : End If
    End Sub

    Private Sub 風格()
        If 深色風格 = False Then
            Me.BackColor = SystemColors.Control
            '----------------黑-------------------------------------------
            簡稱_lb.ForeColor = Color.Black : 公司地址_lb.ForeColor = Color.Black : 公司電話1_lb.ForeColor = Color.Black : 傳真1_lb.ForeColor = Color.Black
            公司名_ib.ForeColor = Color.Black
            '----------------紅-------------------------------------------
            供應商編號_lb.ForeColor = Color.Red
            '----------------綠-------------------------------------------
            聯繫人1_lb.ForeColor = Color.Green : 聯繫人職稱1_lb.ForeColor = Color.Green : 聯繫人電話1_lb.ForeColor = Color.Green : 聯繫人信箱1_lb.ForeColor = Color.Green
            '----------------藍-------------------------------------------
            聯繫人2_lb.ForeColor = Color.Blue : 聯繫人職稱2_lb.ForeColor = Color.Blue : 聯繫人電話2_lb.ForeColor = Color.Blue : 聯繫人信箱2_lb.ForeColor = Color.Blue
            '----------------紫-------------------------------------------
            聯繫人3_lb.ForeColor = Color.Purple : 聯繫人職稱3_lb.ForeColor = Color.Purple : 聯繫人電話3_lb.ForeColor = Color.Purple : 聯繫人信箱3_lb.ForeColor = Color.Purple

            供應商編號_tb.BackColor = Color.White : 供應商編號_tb.ForeColor = Color.Black : 地址_tb.BackColor = Color.White : 地址_tb.ForeColor = Color.Black
            電話1_tb.BackColor = Color.White : 電話1_tb.ForeColor = Color.Black : 傳真1_tb.BackColor = Color.White : 傳真1_tb.ForeColor = Color.Black
            公司名_tb.BackColor = Color.White : 公司名_tb.ForeColor = Color.Black : 聯繫人1_tb.BackColor = Color.White : 聯繫人1_tb.ForeColor = Color.Black
            聯繫人2_tb.BackColor = Color.White : 聯繫人2_tb.ForeColor = Color.Black : 聯繫人3_tb.BackColor = Color.White : 聯繫人3_tb.ForeColor = Color.Black
            職稱1_tb.BackColor = Color.White : 職稱1_tb.ForeColor = Color.Black : 職稱2_tb.BackColor = Color.White : 職稱2_tb.ForeColor = Color.Black
            職稱3_tb.BackColor = Color.White : 職稱3_tb.ForeColor = Color.Black : 聯繫電話1_tb.BackColor = Color.White : 聯繫電話1_tb.ForeColor = Color.Black
            聯繫電話2_tb.BackColor = Color.White : 聯繫電話2_tb.ForeColor = Color.Black : 聯繫電話3_tb.BackColor = Color.White : 聯繫電話3_tb.ForeColor = Color.Black
            信箱1_tb.BackColor = Color.White : 信箱1_tb.ForeColor = Color.Black : 信箱2_tb.BackColor = Color.White : 信箱2_tb.ForeColor = Color.Black
            語轉扭_bt.BackColor = Color.White : 語轉扭_bt.ForeColor = Color.Black : 信箱3_tb.BackColor = Color.White : 信箱3_tb.ForeColor = Color.Black
            R_bt.BackColor = Color.White : R_bt.ForeColor = Color.Black

            類別管理_bt.BackColor = Color.White : 查詢_bt.BackColor = Color.White : 新增_bt.BackColor = Color.White : 確認新增_bt.BackColor = Color.White
            修改_bt.BackColor = Color.White : 刪除_bt.BackColor = Color.White

            廠商清單_dgv.EnableHeadersVisualStyles = True : 廠商清單_dgv.BackgroundColor = Color.White : 廠商清單_dgv.ColumnHeadersDefaultCellStyle.ForeColor = Color.Black
            廠商清單_dgv.DefaultCellStyle.BackColor = Color.White : 廠商清單_dgv.DefaultCellStyle.ForeColor = Color.Black
        Else
            Me.BackColor = Color.Black
            '----------------黑-------------------------------------------
            簡稱_lb.ForeColor = Color.White : 公司地址_lb.ForeColor = Color.White : 公司電話1_lb.ForeColor = Color.White : 傳真1_lb.ForeColor = Color.White
            公司名_ib.ForeColor = Color.White
            '----------------紅-------------------------------------------
            供應商編號_lb.ForeColor = Color.LightPink
            '----------------綠-------------------------------------------
            聯繫人1_lb.ForeColor = Color.LightGreen : 聯繫人職稱1_lb.ForeColor = Color.LightGreen : 聯繫人電話1_lb.ForeColor = Color.LightGreen : 聯繫人信箱1_lb.ForeColor = Color.LightGreen
            '----------------藍-------------------------------------------
            聯繫人2_lb.ForeColor = Color.LightBlue : 聯繫人職稱2_lb.ForeColor = Color.LightBlue : 聯繫人電話2_lb.ForeColor = Color.LightBlue : 聯繫人信箱2_lb.ForeColor = Color.LightBlue
            '----------------紫-------------------------------------------
            聯繫人3_lb.ForeColor = Color.Violet : 聯繫人職稱3_lb.ForeColor = Color.Violet : 聯繫人電話3_lb.ForeColor = Color.Violet : 聯繫人信箱3_lb.ForeColor = Color.Violet

            供應商編號_tb.BackColor = Color.DimGray : 供應商編號_tb.ForeColor = Color.White : 地址_tb.BackColor = Color.DimGray : 地址_tb.ForeColor = Color.White
            電話1_tb.BackColor = Color.DimGray : 電話1_tb.ForeColor = Color.White : 傳真1_tb.BackColor = Color.DimGray : 傳真1_tb.ForeColor = Color.White
            公司名_tb.BackColor = Color.DimGray : 公司名_tb.ForeColor = Color.White : 聯繫人1_tb.BackColor = Color.DimGray : 聯繫人1_tb.ForeColor = Color.White
            聯繫人2_tb.BackColor = Color.DimGray : 聯繫人2_tb.ForeColor = Color.White : 聯繫人3_tb.BackColor = Color.DimGray : 聯繫人3_tb.ForeColor = Color.White
            職稱1_tb.BackColor = Color.DimGray : 職稱1_tb.ForeColor = Color.White : 職稱2_tb.BackColor = Color.DimGray : 職稱2_tb.ForeColor = Color.White
            職稱3_tb.BackColor = Color.DimGray : 職稱3_tb.ForeColor = Color.White : 聯繫電話1_tb.BackColor = Color.DimGray : 聯繫電話1_tb.ForeColor = Color.White
            聯繫電話2_tb.BackColor = Color.DimGray : 聯繫電話2_tb.ForeColor = Color.White : 聯繫電話3_tb.BackColor = Color.DimGray : 聯繫電話3_tb.ForeColor = Color.White
            信箱1_tb.BackColor = Color.DimGray : 信箱1_tb.ForeColor = Color.White : 信箱2_tb.BackColor = Color.DimGray : 信箱2_tb.ForeColor = Color.White
            語轉扭_bt.BackColor = Color.DimGray : 語轉扭_bt.ForeColor = Color.White : 信箱3_tb.BackColor = Color.DimGray : 信箱3_tb.ForeColor = Color.White
            R_bt.BackColor = Color.DimGray : R_bt.ForeColor = Color.White

            類別管理_bt.BackColor = Color.DimGray : 查詢_bt.BackColor = Color.DimGray : 新增_bt.BackColor = Color.DimGray : 確認新增_bt.BackColor = Color.DimGray
            修改_bt.BackColor = Color.DimGray : 刪除_bt.BackColor = Color.DimGray

            廠商清單_dgv.EnableHeadersVisualStyles = False : 廠商清單_dgv.BackgroundColor = Color.DimGray : 廠商清單_dgv.ColumnHeadersDefaultCellStyle.ForeColor = Color.White
            廠商清單_dgv.ColumnHeadersDefaultCellStyle.BackColor = Color.Black
            廠商清單_dgv.DefaultCellStyle.BackColor = Color.Black : 廠商清單_dgv.DefaultCellStyle.ForeColor = Color.White
        End If
    End Sub
End Class