Imports System.Windows.Forms.DataVisualization.Charting Imports System.IO Public Class 物料採購統計表 Dim 物料規格, 資料(100), 頁面 As String Dim 可繪圖 As Boolean Dim NA1, 關鍵字數量, 移動位置, 關鍵字位置(1000) As Integer Dim 群組碼(21), 對話框(2) As String Private Sub Set_群組清單() Dim ds1 As New DataSet : 群組分類_dgv.DataSource = Nothing : ds1.Clear() 群組分類_dgv.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing 群組分類_dgv.ColumnHeadersHeight = 25 : 群組分類_dgv.AllowUserToAddRows = False : 群組分類_dgv.RowTemplate.Height = 45 SQL_物料群組() : da.Fill(ds1) : 群組分類_dgv.DataSource = ds1.Tables(0) : conn.Close() : 次項變形() End Sub Private Sub Set_清單() Dim ds1 As New DataSet : 物料清單_dgv.DataSource = Nothing : ds1.Clear() 物料清單_dgv.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing 物料清單_dgv.ColumnHeadersHeight = 40 : 物料清單_dgv.AllowUserToAddRows = False : 物料清單_dgv.RowTemplate.Height = 45 PA20 = 關鍵字查詢_tb.Text If 採購平均單價_ch.Checked = False And 採購數量_ch.Checked = True Then : SQL_採購數量清單() ElseIf 採購平均單價_ch.Checked = True And 採購數量_ch.Checked = False Then : SQL_採購平均單價清單() End If da.Fill(ds1) : 物料清單_dgv.DataSource = ds1.Tables(0) : conn.Close() 物料清單_dgv.Columns(0).Visible = False : 物料清單_dgv.Columns(1).Width = 120 : 物料清單_dgv.Columns(2).Width = 170 For I As Integer = 0 To 物料清單_dgv.Rows.Count - 1 : 物料清單_dgv.Rows(I).Cells(3).Value = "0" For II As Integer = 0 To 品名_dgv.Rows.Count - 1 '-------------------------規格合併呈現---------------------------------------------------------------------------------------------------------------------------------------- If 物料清單_dgv.Rows(I).Cells("料號").Value.ToString = 品名_dgv.Rows(II).Cells("料號").Value.ToString Then PA3 = 品名_dgv.Rows(II).Cells("規格庫抬頭指定").Value : SQL_規格庫抬頭讀取() If dr.Read() Then AAA1 = dr("A1") : AAA2 = dr("A2") : AAA3 = dr("A3") : AAA4 = dr("A4") : AAA5 = dr("A5") : AAA6 = dr("A6") : AAA7 = dr("A7") : AAA8 = dr("A8") End If : conn.Close() Dim ZA1, ZA2, ZA3, ZA4, ZA5, ZA6, ZA7, ZA8 As String : 物料規格 = "" If 詳細資料2_ch.Checked = True Then If 品名_dgv.Rows(II).Cells("A1").Value.ToString <> "" Then ZA1 = AAA1 & "=" & 品名_dgv.Rows(II).Cells("A1").Value.ToString : 物料規格 = ZA1 : End If If 品名_dgv.Rows(II).Cells("A2").Value.ToString <> "" Then : ZA2 = AAA2 & "=" & 品名_dgv.Rows(II).Cells("A2").Value If 物料規格 = "" Then : 物料規格 = ZA2 : Else : 物料規格 = 物料規格 + "、" + ZA2 : End If : End If If 品名_dgv.Rows(II).Cells("A3").Value.ToString <> "" Then : ZA3 = AAA3 & "=" & 品名_dgv.Rows(II).Cells("A3").Value If 物料規格 = "" Then : 物料規格 = ZA3 : Else : 物料規格 = 物料規格 + "、" + ZA3 : End If : End If If 品名_dgv.Rows(II).Cells("A4").Value.ToString <> "" Then : ZA4 = AAA4 & "=" & 品名_dgv.Rows(II).Cells("A4").Value If 物料規格 = "" Then : 物料規格 = ZA4 : Else : 物料規格 = 物料規格 + "、" + ZA4 : End If : End If If 品名_dgv.Rows(II).Cells("A5").Value.ToString <> "" Then : ZA5 = AAA5 & "=" & 品名_dgv.Rows(II).Cells("A5").Value If 物料規格 = "" Then : 物料規格 = ZA5 : Else : 物料規格 = 物料規格 + "、" + ZA5 : End If : End If If 品名_dgv.Rows(II).Cells("A6").Value.ToString <> "" Then : ZA6 = AAA6 & "=" & 品名_dgv.Rows(II).Cells("A6").Value If 物料規格 = "" Then : 物料規格 = ZA6 : Else : 物料規格 = 物料規格 + "、" + ZA6 : End If : End If If 品名_dgv.Rows(II).Cells("A7").Value.ToString <> "" Then : ZA7 = AAA7 & "=" & 品名_dgv.Rows(II).Cells("A7").Value If 物料規格 = "" Then : 物料規格 = ZA7 : Else : 物料規格 = 物料規格 + "、" + ZA7 : End If : End If If 品名_dgv.Rows(II).Cells("A8").Value.ToString <> "" Then : ZA8 = AAA8 & "=" & 品名_dgv.Rows(II).Cells("A8").Value If 物料規格 = "" Then : 物料規格 = ZA8 : Else : 物料規格 = 物料規格 + "、" + ZA8 : End If : End If Else If 品名_dgv.Rows(II).Cells("A1").Value.ToString <> "" Then : ZA1 = 品名_dgv.Rows(II).Cells("A1").Value.ToString : 物料規格 = ZA1 : End If If 品名_dgv.Rows(II).Cells("A2").Value.ToString <> "" Then ZA2 = 品名_dgv.Rows(II).Cells("A2").Value : If 物料規格 = "" Then : 物料規格 = ZA2 : Else : 物料規格 = 物料規格 + "、" + ZA2 : End If : End If If 品名_dgv.Rows(II).Cells("A3").Value.ToString <> "" Then ZA3 = 品名_dgv.Rows(II).Cells("A3").Value : If 物料規格 = "" Then : 物料規格 = ZA3 : Else : 物料規格 = 物料規格 + "、" + ZA3 : End If : End If If 品名_dgv.Rows(II).Cells("A4").Value.ToString <> "" Then ZA4 = 品名_dgv.Rows(II).Cells("A4").Value : If 物料規格 = "" Then : 物料規格 = ZA4 : Else : 物料規格 = 物料規格 + "、" + ZA4 : End If : End If If 品名_dgv.Rows(II).Cells("A5").Value.ToString <> "" Then ZA5 = 品名_dgv.Rows(II).Cells("A5").Value : If 物料規格 = "" Then : 物料規格 = ZA5 : Else : 物料規格 = 物料規格 + "、" + ZA5 : End If : End If If 品名_dgv.Rows(II).Cells("A6").Value.ToString <> "" Then ZA6 = 品名_dgv.Rows(II).Cells("A6").Value : If 物料規格 = "" Then : 物料規格 = ZA6 : Else : 物料規格 = 物料規格 + "、" + ZA6 : End If : End If If 品名_dgv.Rows(II).Cells("A7").Value.ToString <> "" Then ZA7 = 品名_dgv.Rows(II).Cells("A7").Value : If 物料規格 = "" Then : 物料規格 = ZA7 : Else : 物料規格 = 物料規格 + "、" + ZA7 : End If : End If If 品名_dgv.Rows(II).Cells("A8").Value.ToString <> "" Then ZA8 = 品名_dgv.Rows(II).Cells("A8").Value : If 物料規格 = "" Then : 物料規格 = ZA8 : Else : 物料規格 = 物料規格 + "、" + ZA8 : End If : End If End If 物料清單_dgv.Rows(I).Cells(2).Value = 物料規格 : Exit For End If Next For II As Integer = 4 To 15 If 物料清單_dgv.Rows(I).Cells(II).Value.ToString = "" Then : 物料清單_dgv.Rows(I).Cells(II).Value = "0" : End If 物料清單_dgv.Rows(I).Cells(3).Value = CInt(物料清單_dgv.Rows(I).Cells(3).Value.ToString) + CInt(物料清單_dgv.Rows(I).Cells(II).Value.ToString) Next Next If 採購平均單價_ch.Checked = False And 採購數量_ch.Checked = True Then 物料清單_dgv.Columns(3).FillWeight = 50 : 物料清單_dgv.Columns(3).Visible = True ElseIf 採購平均單價_ch.Checked = True And 採購數量_ch.Checked = False Then 物料清單_dgv.Columns(3).FillWeight = 50 : 物料清單_dgv.Columns(3).Visible = False End If For II As Integer = 4 To 11 + 4 物料清單_dgv.Columns(II).FillWeight = 50 : 物料清單_dgv.Columns(II).DefaultCellStyle.Format = "#,##0" 物料清單_dgv.Columns(II).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter Next 物料清單_dgv.Columns("總採購量").DefaultCellStyle.Format = "#,##0" 物料清單_dgv.Columns("總採購量").DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter 物料清單_dgv.Sort(物料清單_dgv.Columns(0), System.ComponentModel.ListSortDirection.Descending) End Sub Private Sub Set_採購日清單() Dim ds1 As New DataSet : 採購日_dgv.DataSource = Nothing : ds1.Clear() 採購日_dgv.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing 採購日_dgv.ColumnHeadersHeight = 25 : 採購日_dgv.AllowUserToAddRows = False SQL_採購日清單() da.Fill(ds1) : 採購日_dgv.DataSource = ds1.Tables(0) : conn.Close() 採購日_dgv.Sort(採購日_dgv.Columns("採購日"), System.ComponentModel.ListSortDirection.Ascending) PA10 = 採購日_dgv.Rows(0).Cells("採購日").Value.ToString() For I As Integer = 0 To 採購日_dgv.Rows.Count - 1 If I = 0 Then : 清單列表 = "[" & 採購日_dgv.Rows(I).Cells(0).Value.ToString() Else : 清單列表 = 清單列表 & "], [" & 採購日_dgv.Rows(I).Cells(0).Value.ToString() : End If If I = 採購日_dgv.Rows.Count - 1 Then : 清單列表 &= "]" : End If : NN1 = I PA11 = 採購日_dgv.Rows(I).Cells("採購日").Value.ToString() Next End Sub Private Sub Set_品名清單() Dim ds1 As New DataSet : 品名_dgv.DataSource = Nothing : ds1.Clear() 品名_dgv.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing 品名_dgv.ColumnHeadersHeight = 25 : 品名_dgv.AllowUserToAddRows = False SQL_品名清單() da.Fill(ds1) : 品名_dgv.DataSource = ds1.Tables(0) : conn.Close() End Sub Private Sub Set_繪圖清單() Dim ds1 As New DataSet : 繪圖1_dgv.DataSource = Nothing : ds1.Clear() 繪圖1_dgv.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing 繪圖1_dgv.ColumnHeadersHeight = 25 : 繪圖1_dgv.AllowUserToAddRows = False SQL_繪圖清單1() da.Fill(ds1) : 繪圖1_dgv.DataSource = ds1.Tables(0) : conn.Close() For i As Integer = 0 To 繪圖1_dgv.Rows.Count - 1 If IsDBNull(繪圖1_dgv.Rows(i).Cells("採購數量").Value) = True Then 繪圖1_dgv.Rows(i).Cells("採購數量").Value = "0" : 繪圖1_dgv.Rows(i).Cells("料號").Value = PA1 : 繪圖1_dgv.Rows(i).Cells("平均單價").Value = "0" End If Next End Sub Private Sub 語言轉換讀取() If 系統語言 = "繁體中文" Then : 語言 = "CH" : ElseIf 系統語言 = "English" Then : 語言 = "EN" : ElseIf 系統語言 = "Indonesian" Then : 語言 = "IN" : End If Me.Text = 系統語言字典("H001-160-" & 語言) : ToolTip1.ToolTipTitle = 系統語言字典("G000-108-" & 語言) : 對話框(0) = 系統語言字典("H211-108-" & 語言) 詳細資料2_ch.Text = 系統語言字典("H211-100-" & 語言) : 關鍵字_lb.Text = 系統語言字典("H211-101-" & 語言) : 採購平均單價_ch.Text = 系統語言字典("H211-102-" & 語言) 採購數量_ch.Text = 系統語言字典("H211-103-" & 語言) : 長條圖_ch.Text = 系統語言字典("H211-104-" & 語言) : 折線圖_ch.Text = 系統語言字典("H211-105-" & 語言) 表頭(12) = 系統語言字典("H211-106-" & 語言) : 表頭(13) = 系統語言字典("H211-107-" & 語言) : 對話框(1) = 系統語言字典("H211-109-" & 語言) 對話框(2) = 系統語言字典("H211-110-" & 語言) End Sub Private Sub 關鍵字查詢_bt_MouseEnter(sender As Object, e As EventArgs) Handles 關鍵字查詢_bt.MouseEnter ToolTip1.SetToolTip(Me.關鍵字查詢_bt, 系統語言字典("H211-111-" & 語言)) End Sub Private Sub 上一筆_bt_MouseEnter(sender As Object, e As EventArgs) Handles 上一筆_bt.MouseEnter ToolTip1.SetToolTip(Me.上一筆_bt, 系統語言字典("H211-112-" & 語言)) End Sub Private Sub 下一筆_bt_MouseEnter(sender As Object, e As EventArgs) Handles 下一筆_bt.MouseEnter ToolTip1.SetToolTip(Me.下一筆_bt, 系統語言字典("H211-113-" & 語言)) End Sub Private Sub 查詢入圖_bt_MouseEnter(sender As Object, e As EventArgs) Handles 查詢入圖_bt.MouseEnter ToolTip1.SetToolTip(Me.查詢入圖_bt, 系統語言字典("H211-114-" & 語言)) End Sub Private Sub 清除查詢_bt_MouseEnter(sender As Object, e As EventArgs) Handles 清除查詢_bt.MouseEnter ToolTip1.SetToolTip(Me.清除查詢_bt, 系統語言字典("H211-115-" & 語言)) End Sub Private Sub 清除圖表_bt_MouseEnter(sender As Object, e As EventArgs) Handles 清除圖表_bt.MouseEnter ToolTip1.SetToolTip(Me.清除圖表_bt, 系統語言字典("H211-116-" & 語言)) End Sub Private Sub 回首頁_bt_MouseEnter(sender As Object, e As EventArgs) Handles 回首頁_bt.MouseEnter ToolTip1.SetToolTip(Me.回首頁_bt, 系統語言字典("G000-183-" & 語言)) End Sub Private Sub 回次頁_bt_MouseEnter(sender As Object, e As EventArgs) Handles 回次頁_bt.MouseEnter ToolTip1.SetToolTip(Me.回次頁_bt, 系統語言字典("G000-184-" & 語言)) End Sub Private Sub 管材_bt_MouseEnter(sender As Object, e As EventArgs) Handles 管材_bt.MouseEnter ToolTip1.SetToolTip(Me.管材_bt, 系統語言字典("G000-185-" & 語言)) End Sub Private Sub 電線_bt_MouseEnter(sender As Object, e As EventArgs) Handles 電線_bt.MouseEnter ToolTip1.SetToolTip(Me.電線_bt, 系統語言字典("G000-186-" & 語言)) End Sub Private Sub 電料_bt_MouseEnter(sender As Object, e As EventArgs) Handles 電料_bt.MouseEnter ToolTip1.SetToolTip(Me.電料_bt, 系統語言字典("G000-187-" & 語言)) End Sub Private Sub 槽架_bt_MouseEnter(sender As Object, e As EventArgs) Handles 槽架_bt.MouseEnter ToolTip1.SetToolTip(Me.槽架_bt, 系統語言字典("G000-188-" & 語言)) End Sub Private Sub 建材_bt_MouseEnter(sender As Object, e As EventArgs) Handles 建材_bt.MouseEnter ToolTip1.SetToolTip(Me.建材_bt, 系統語言字典("G000-189-" & 語言)) End Sub Private Sub 五金_bt_MouseEnter(sender As Object, e As EventArgs) Handles 五金_bt.MouseEnter ToolTip1.SetToolTip(Me.五金_bt, 系統語言字典("G000-190-" & 語言)) End Sub Private Sub 設備_bt_MouseEnter(sender As Object, e As EventArgs) Handles 設備_bt.MouseEnter ToolTip1.SetToolTip(Me.設備_bt, 系統語言字典("G000-191-" & 語言)) End Sub Private Sub 工具_bt_MouseEnter(sender As Object, e As EventArgs) Handles 工具_bt.MouseEnter ToolTip1.SetToolTip(Me.工具_bt, 系統語言字典("G000-192-" & 語言)) End Sub Private Sub 日用_bt_MouseEnter(sender As Object, e As EventArgs) Handles 日用_bt.MouseEnter ToolTip1.SetToolTip(Me.日用_bt, 系統語言字典("G000-193-" & 語言)) End Sub Private Sub 其他_bt_MouseEnter(sender As Object, e As EventArgs) Handles 其他_bt.MouseEnter ToolTip1.SetToolTip(Me.其他_bt, 系統語言字典("G000-194-" & 語言)) 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(211) = True : 介面 = "H211" : 語言轉換讀取() : 顯示說明(999, True) Panel1.SendToBack() : 主頁_p.BringToFront() : Chart1.Visible = False Set_採購日清單() 物料採購統計表_Siz() End Sub Private Sub 物料採購統計表_Siz() 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 MyMod.虛擬桌面開啟() 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 語轉扭_bt_Click(sender As Object, e As EventArgs) Handles 語轉扭_bt.Click 介面 = "H211" : 語言轉換讀取() End Sub Private Sub 繪圖() If 折線圖_ch.Checked = True Then Chart1.Series.Add(資料(NA1) & "_1") : Chart1.Series(資料(NA1) & "_1").ChartType = SeriesChartType.Line Chart1.Series(資料(NA1) & "_1").IsVisibleInLegend = False End If If 長條圖_ch.Checked = True Then Chart1.Series.Add(資料(NA1)) : Chart1.Series(資料(NA1)).ChartType = SeriesChartType.Column End If Chart1.ChartAreas(0).BackColor = Color.Transparent : Chart1.Legends(0).BackColor = Color.Transparent Chart1.ChartAreas(0).AxisY.LabelStyle.Font = New Font("Arial", 8) : Chart1.ChartAreas(0).AxisY.LabelStyle.Format = "#,##0" & " M" Dim NUDAA As Integer If 數列_NUD.Value >= 繪圖1_dgv.Rows.Count - 1 Or 數列_NUD.Value = 0 Then : NUDAA = 繪圖1_dgv.Rows.Count - 1 ElseIf 數列_NUD.Value < 繪圖1_dgv.Rows.Count - 1 Then : NUDAA = 數列_NUD.Value : End If For II As Integer = 0 To NUDAA If 採購平均單價_ch.Checked = False And 採購數量_ch.Checked = True Then If 長條圖_ch.Checked = True Then Chart1.Series(資料(NA1)).Points.AddXY(繪圖1_dgv.Rows(NUDAA - II).Cells("採購日").Value.ToString, 繪圖1_dgv.Rows(NUDAA - II).Cells("採購數量").Value.ToString) End If If 折線圖_ch.Checked = True Then Chart1.Series(資料(NA1) & "_1").Points.AddXY(繪圖1_dgv.Rows(NUDAA - II).Cells("採購日").Value.ToString, 繪圖1_dgv.Rows(NUDAA - II).Cells("採購數量").Value.ToString) End If ElseIf 採購平均單價_ch.Checked = True And 採購數量_ch.Checked = False Then If 長條圖_ch.Checked = True Then Chart1.Series(資料(NA1)).Points.AddXY(繪圖1_dgv.Rows(NUDAA - II).Cells("採購日").Value.ToString, 繪圖1_dgv.Rows(NUDAA - II).Cells("平均單價").Value.ToString) End If If 折線圖_ch.Checked = True Then Chart1.Series(資料(NA1) & "_1").Points.AddXY(繪圖1_dgv.Rows(NUDAA - II).Cells("採購日").Value.ToString, 繪圖1_dgv.Rows(NUDAA - II).Cells("平均單價").Value.ToString) End If End If Next : NA1 = NA1 + 1 If 深色風格 = False Then Chart1.Legends(0).ForeColor = Color.Black Chart1.ChartAreas(0).AxisX.MajorGrid.LineColor = Color.Black : Chart1.ChartAreas(0).AxisY.MajorGrid.LineColor = Color.Black Chart1.ChartAreas(0).AxisX.LineColor = Color.Black : Chart1.ChartAreas(0).AxisY.LineColor = Color.Black Chart1.ChartAreas(0).AxisX.LabelStyle.ForeColor = Color.Black : Chart1.ChartAreas(0).AxisY.LabelStyle.ForeColor = Color.Black Else Chart1.Legends(0).ForeColor = Color.White Chart1.ChartAreas(0).AxisX.MajorGrid.LineColor = Color.White : Chart1.ChartAreas(0).AxisY.MajorGrid.LineColor = Color.White Chart1.ChartAreas(0).AxisX.LineColor = Color.White : Chart1.ChartAreas(0).AxisY.LineColor = Color.White Chart1.ChartAreas(0).AxisX.LabelStyle.ForeColor = Color.White : Chart1.ChartAreas(0).AxisY.LabelStyle.ForeColor = Color.White End If End Sub Private Sub 物料清單_dgv_CellClick(ByVal sender As System.Object, ByVal e As DataGridViewCellEventArgs) Handles 物料清單_dgv.CellClick If e.RowIndex = -1 Then : Else PA1 = 物料清單_dgv.Rows(e.RowIndex).Cells("料號").Value.ToString : Set_繪圖清單() If 繪圖1_dgv.Rows.Count > 0 Then For i As Integer = 0 To NA1 可繪圖 = True If 資料(i) = 物料清單_dgv.Rows(e.RowIndex).Cells(表頭(12)).Value.ToString & " " & 物料清單_dgv.Rows(e.RowIndex).Cells(表頭(13)).Value.ToString Then 可繪圖 = False : Exit For End If Next If 可繪圖 = True Then Try 資料(NA1) = 物料清單_dgv.Rows(e.RowIndex).Cells(表頭(12)).Value.ToString & " " & 物料清單_dgv.Rows(e.RowIndex).Cells(表頭(13)).Value.ToString : 繪圖() Catch ex As Exception : MGB(ex.Message, 1) : End Try End If End If End If End Sub Private Sub 查詢入圖_bt_Click(sender As Object, e As EventArgs) Handles 查詢入圖_bt.Click Chart1.Series.Clear() For I As Integer = 0 To 關鍵字數量 If 關鍵字位置(I) = 1 Then PA1 = 物料清單_dgv.Rows(I).Cells("料號").Value.ToString : Set_繪圖清單() If 繪圖1_dgv.Rows.Count > 0 Then For II As Integer = 0 To NA1 可繪圖 = True If 資料(II) = 物料清單_dgv.Rows(I).Cells(表頭(12)).Value.ToString & " " & 物料清單_dgv.Rows(I).Cells(表頭(13)).Value.ToString Then 可繪圖 = False : Exit For End If Next If 可繪圖 = True Then Try 資料(NA1) = 物料清單_dgv.Rows(I).Cells(表頭(12)).Value.ToString & " " & 物料清單_dgv.Rows(I).Cells(表頭(13)).Value.ToString : 繪圖() Catch ex As Exception : MGB(ex.Message, 1) : End Try End If End If End If Next End Sub Private Sub 詳細資料2_ch_CheckedChanged(sender As Object, e As EventArgs) Handles 詳細資料2_ch.Click If 詳細資料2_ch.Checked = True Then : 詳細資料2_ch.Checked = True : Else : 詳細資料2_ch.Checked = False : End If : Set_清單() End Sub Private Sub 採購平均單價_ch_CheckedChanged(sender As Object, e As EventArgs) Handles 採購平均單價_ch.Click 採購平均單價_ch.Checked = True : 採購數量_ch.Checked = False : 清除圖表_bt.PerformClick() : Set_清單() End Sub Private Sub 採購數量_ch_CheckedChanged(sender As Object, e As EventArgs) Handles 採購數量_ch.Click 採購平均單價_ch.Checked = False : 採購數量_ch.Checked = True : 清除圖表_bt.PerformClick() : Set_清單() End Sub Private Sub 關鍵字查詢_bt_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles 關鍵字查詢_bt.Click If 關鍵字查詢_tb.Text = "" Then : MGB(對話框(0), 1) : Else Set_清單() : 關鍵字數量 = 0 : For I As Integer = 0 To 1000 : 關鍵字位置(I) = 0 : Next Dim Str1, Str2 As String For I As Integer = 0 To 物料清單_dgv.Rows.Count - 1 物料清單_dgv.Rows(I).DefaultCellStyle.BackColor = Color.White Str1 = 物料清單_dgv.Rows(I).Cells(表頭(12)).Value.ToString() : Str2 = 關鍵字查詢_tb.Text Dim Stu As Boolean = Str1.Contains(Str2) If Stu = True Then If 深色風格 = False Then 物料清單_dgv.Rows(I).DefaultCellStyle.BackColor = Color.LightPink Else 物料清單_dgv.Rows(I).DefaultCellStyle.BackColor = Color.Red End If : 關鍵字位置(I) = 1 : 關鍵字數量 = I : 移動位置 = 0 End If Next : 下一筆_bt.PerformClick() End If End Sub Private Sub 長條圖_ch_CheckedChanged(sender As Object, e As EventArgs) Handles 長條圖_ch.Click If 長條圖_ch.Checked = False And 折線圖_ch.Checked = False Then : 長條圖_ch.Checked = True : End If End Sub Private Sub 折線圖_ch_CheckedChanged(sender As Object, e As EventArgs) Handles 折線圖_ch.Click If 長條圖_ch.Checked = False And 折線圖_ch.Checked = False Then : 折線圖_ch.Checked = True : End If End Sub Private Sub 清除查詢_bt_Click(sender As Object, e As EventArgs) Handles 清除查詢_bt.Click 關鍵字數量 = 0 : For I As Integer = 0 To 1000 : 關鍵字位置(I) = 0 : Next : 清除圖表_bt.PerformClick() 關鍵字查詢_tb.Text = "%%" : 關鍵字查詢_bt.PerformClick() : 關鍵字查詢_tb.Text = "" For I As Integer = 0 To 物料清單_dgv.Rows.Count - 1 If 深色風格 = False Then 物料清單_dgv.Rows(I).DefaultCellStyle.BackColor = Color.White Else 物料清單_dgv.Rows(I).DefaultCellStyle.BackColor = Color.DimGray End If Next End Sub Private Sub 上一筆_bt_Click(sender As Object, e As EventArgs) Handles 上一筆_bt.Click If 移動位置 = 0 Then : MGB(對話框(1), 1) : Else Dim 減項 As Integer = 移動位置 For I As Integer = 0 To 移動位置 減項 -= 1 If 關鍵字位置(減項) = 1 Then : 物料清單_dgv.CurrentCell = 物料清單_dgv.Rows(減項).Cells(1) : 移動位置 = 減項 : Exit For : End If If 減項 = 0 Then : 移動位置 = 0 : Exit Sub : End If Next End If End Sub Private Sub 下一筆_bt_Click(sender As Object, e As EventArgs) Handles 下一筆_bt.Click If 移動位置 >= 關鍵字數量 Then : MGB(對話框(2), 1) : Else For I As Integer = 移動位置 To 關鍵字數量 If 關鍵字位置(I) = 1 Then : 物料清單_dgv.CurrentCell = 物料清單_dgv.Rows(I).Cells(1) : 移動位置 = I + 1 : Exit For : End If If 移動位置 = 關鍵字數量 Then : 移動位置 = 關鍵字數量 : End If Next End If End Sub Private Sub 清除圖表_bt_Click(sender As Object, e As EventArgs) Handles 清除圖表_bt.Click Chart1.Series.Clear() : For i As Integer = 0 To NA1 : 資料(i) = "" : Next : NA1 = 0 End Sub Private Sub 回首頁_bt_Click(sender As Object, e As EventArgs) Handles 回首頁_bt.Click 物料查詢 = False : 主頁_p.BringToFront() End Sub Private Sub 回次頁_bt_Click(sender As Object, e As EventArgs) Handles 回次頁_bt.Click If 頁面 = "1" Then : 主頁_p.BringToFront() : ElseIf 頁面 = "2" Then : 次頁_p.BringToFront() : Else : 主頁_p.BringToFront() : End If End Sub Private Sub 次項變形() For i As Integer = 1 To 21 : Dim 選擇 As Panel = CType(Me.Controls.Find("AP" & i, True)(0), Panel) : 選擇.Visible = False : Next Dim SS As Integer If 群組分類_dgv.Rows.Count > 21 Then : SS = 21 : Else : SS = 群組分類_dgv.Rows.Count : End If For i As Integer = 1 To SS : Dim 選擇 As Panel = CType(Me.Controls.Find("AP" & i, True)(0), Panel) : 選擇.Visible = True : Next Dim 轉檔 As Boolean For i As Integer = 0 To 群組分類_dgv.Rows.Count - 1 Dim 選擇 As PictureBox = CType(Me.Controls.Find("PB_" & i + 1, True)(0), PictureBox) If IsDBNull(群組分類_dgv.Rows(i).Cells(2).Value) = True Then : 轉檔 = False : Else : 轉檔 = True : End If While 轉檔 = True Dim unused As Byte() = New Byte(-1) {} Dim bytes As Byte() = DirectCast(群組分類_dgv.Rows(i).Cells(2).Value, Byte()) Dim oStream As New MemoryStream(bytes) 選擇.Image = Bitmap.FromStream(oStream) : 轉檔 = False End While : conn.Close() : 選擇.SizeMode = 4 Dim 選擇1 As TextBox = CType(Me.Controls.Find("TB_" & i + 1, True)(0), TextBox) : 選擇1.Text = 群組分類_dgv.Rows(i).Cells(1).Value.ToString '---------未做換頁計算--------------------------------------------- 群組碼(i + 1) = 群組分類_dgv.Rows(i).Cells(0).Value.ToString Next End Sub Private Sub 管材_bt_Click(sender As Object, e As EventArgs) Handles 管材_bt.Click 頁面 = "1" : PA1 = "管材" : Set_群組清單() : 次頁_p.BringToFront() End Sub Private Sub 電線_bt_Click(sender As Object, e As EventArgs) Handles 電線_bt.Click 頁面 = "1" : PA1 = "電線" : Set_群組清單() : 次頁_p.BringToFront() End Sub Private Sub 電料_bt_Click(sender As Object, e As EventArgs) Handles 電料_bt.Click 頁面 = "1" : PA1 = "電料" : Set_群組清單() : 次頁_p.BringToFront() End Sub Private Sub 槽架_bt_Click(sender As Object, e As EventArgs) Handles 槽架_bt.Click 頁面 = "1" : PA1 = "槽架" : Set_群組清單() : 次頁_p.BringToFront() End Sub Private Sub 建材_bt_Click(sender As Object, e As EventArgs) Handles 建材_bt.Click 頁面 = "1" : PA1 = "建材" : Set_群組清單() : 次頁_p.BringToFront() End Sub Private Sub 五金_bt_Click(sender As Object, e As EventArgs) Handles 五金_bt.Click 頁面 = "1" : PA1 = "五金" : Set_群組清單() : 次頁_p.BringToFront() End Sub Private Sub 設備_bt_Click(sender As Object, e As EventArgs) Handles 設備_bt.Click 頁面 = "1" : PA1 = "設備" : Set_群組清單() : 次頁_p.BringToFront() End Sub Private Sub 工具_bt_Click(sender As Object, e As EventArgs) Handles 工具_bt.Click 頁面 = "1" : PA1 = "工具" : Set_群組清單() : 次頁_p.BringToFront() End Sub Private Sub 日用_bt_Click(sender As Object, e As EventArgs) Handles 日用_bt.Click 頁面 = "1" : PA1 = "日用" : Set_群組清單() : 次頁_p.BringToFront() End Sub Private Sub 其他_bt_Click(sender As Object, e As EventArgs) Handles 其他_bt.Click 頁面 = "1" : PA1 = "其他" : Set_群組清單() : 次頁_p.BringToFront() End Sub Private Sub 載入時繪圖() Chart1.Series.Clear() If 物料清單_dgv.Rows.Count > 0 Then : PA1 = 物料清單_dgv.Rows(0).Cells("料號").Value.ToString : Set_繪圖清單() If 繪圖1_dgv.Rows.Count > 0 Then For i As Integer = 0 To NA1 可繪圖 = True If 資料(i) = 物料清單_dgv.Rows(0).Cells(表頭(12)).Value.ToString & " " & 物料清單_dgv.Rows(0).Cells(表頭(13)).Value.ToString Then : 可繪圖 = False : Exit For : End If Next If 可繪圖 = True Then Try 資料(NA1) = 物料清單_dgv.Rows(0).Cells(表頭(12)).Value.ToString & " " & 物料清單_dgv.Rows(0).Cells(表頭(13)).Value.ToString : 繪圖() Catch ex As Exception : MGB(ex.Message, 1) : End Try End If End If End If End Sub Private Sub PB_1_Click(sender As Object, e As EventArgs) Handles PB_1.Click 頁面 = "2" : PA2 = 群組碼(1) : 主頁_p.SendToBack() : 次頁_p.SendToBack() : Set_品名清單() : Chart1.Visible = True : Set_清單() : NA1 = 0 : 載入時繪圖() End Sub Private Sub PB_2_Click(sender As Object, e As EventArgs) Handles PB_2.Click 頁面 = "2" : PA2 = 群組碼(2) : 主頁_p.SendToBack() : 次頁_p.SendToBack() : Set_品名清單() : Chart1.Visible = True : Set_清單() : NA1 = 0 : 載入時繪圖() End Sub Private Sub PB_3_Click(sender As Object, e As EventArgs) Handles PB_3.Click 頁面 = "2" : PA2 = 群組碼(3) : 主頁_p.SendToBack() : 次頁_p.SendToBack() : Set_品名清單() : Chart1.Visible = True : Set_清單() : NA1 = 0 : 載入時繪圖() End Sub Private Sub PB_4_Click(sender As Object, e As EventArgs) Handles PB_4.Click 頁面 = "2" : PA2 = 群組碼(4) : 主頁_p.SendToBack() : 次頁_p.SendToBack() : Set_品名清單() : Chart1.Visible = True : Set_清單() : NA1 = 0 : 載入時繪圖() End Sub Private Sub PB_5_Click(sender As Object, e As EventArgs) Handles PB_5.Click 頁面 = "2" : PA2 = 群組碼(5) : 主頁_p.SendToBack() : 次頁_p.SendToBack() : Set_品名清單() : Chart1.Visible = True : Set_清單() : NA1 = 0 : 載入時繪圖() End Sub Private Sub PB_6_Click(sender As Object, e As EventArgs) Handles PB_6.Click 頁面 = "2" : PA2 = 群組碼(6) : 主頁_p.SendToBack() : 次頁_p.SendToBack() : Set_品名清單() : Chart1.Visible = True : Set_清單() : NA1 = 0 : 載入時繪圖() End Sub Private Sub PB_7_Click(sender As Object, e As EventArgs) Handles PB_7.Click 頁面 = "2" : PA2 = 群組碼(7) : 主頁_p.SendToBack() : 次頁_p.SendToBack() : Set_品名清單() : Chart1.Visible = True : Set_清單() : NA1 = 0 : 載入時繪圖() End Sub Private Sub PB_8_Click(sender As Object, e As EventArgs) Handles PB_8.Click 頁面 = "2" : PA2 = 群組碼(8) : 主頁_p.SendToBack() : 次頁_p.SendToBack() : Set_品名清單() : Chart1.Visible = True : Set_清單() : NA1 = 0 : 載入時繪圖() End Sub Private Sub PB_9_Click(sender As Object, e As EventArgs) Handles PB_9.Click 頁面 = "2" : PA2 = 群組碼(9) : 主頁_p.SendToBack() : 次頁_p.SendToBack() : Set_品名清單() : Chart1.Visible = True : Set_清單() : NA1 = 0 : 載入時繪圖() End Sub Private Sub PB_10_Click(sender As Object, e As EventArgs) Handles PB_10.Click 頁面 = "2" : PA2 = 群組碼(10) : 主頁_p.SendToBack() : 次頁_p.SendToBack() : Set_品名清單() : Chart1.Visible = True : Set_清單() : NA1 = 0 : 載入時繪圖() End Sub Private Sub PB_11_Click(sender As Object, e As EventArgs) Handles PB_11.Click 頁面 = "2" : PA2 = 群組碼(11) : 主頁_p.SendToBack() : 次頁_p.SendToBack() : Set_品名清單() : Chart1.Visible = True : Set_清單() : NA1 = 0 : 載入時繪圖() End Sub Private Sub PB_12_Click(sender As Object, e As EventArgs) Handles PB_12.Click 頁面 = "2" : PA2 = 群組碼(12) : 主頁_p.SendToBack() : 次頁_p.SendToBack() : Set_品名清單() : Chart1.Visible = True : Set_清單() : NA1 = 0 : 載入時繪圖() End Sub Private Sub PB_13_Click(sender As Object, e As EventArgs) Handles PB_13.Click 頁面 = "2" : PA2 = 群組碼(13) : 主頁_p.SendToBack() : 次頁_p.SendToBack() : Set_品名清單() : Chart1.Visible = True : Set_清單() : NA1 = 0 : 載入時繪圖() End Sub Private Sub PB_14_Click(sender As Object, e As EventArgs) Handles PB_14.Click 頁面 = "2" : PA2 = 群組碼(14) : 主頁_p.SendToBack() : 次頁_p.SendToBack() : Set_品名清單() : Chart1.Visible = True : Set_清單() : NA1 = 0 : 載入時繪圖() End Sub Private Sub PB_15_Click(sender As Object, e As EventArgs) Handles PB_15.Click 頁面 = "2" : PA2 = 群組碼(15) : 主頁_p.SendToBack() : 次頁_p.SendToBack() : Set_品名清單() : Chart1.Visible = True : Set_清單() : NA1 = 0 : 載入時繪圖() End Sub Private Sub PB_16_Click(sender As Object, e As EventArgs) Handles PB_16.Click 頁面 = "2" : PA2 = 群組碼(16) : 主頁_p.SendToBack() : 次頁_p.SendToBack() : Set_品名清單() : Chart1.Visible = True : Set_清單() : NA1 = 0 : 載入時繪圖() End Sub Private Sub PB_17_Click(sender As Object, e As EventArgs) Handles PB_17.Click 頁面 = "2" : PA2 = 群組碼(17) : 主頁_p.SendToBack() : 次頁_p.SendToBack() : Set_品名清單() : Chart1.Visible = True : Set_清單() : NA1 = 0 : 載入時繪圖() End Sub Private Sub PB_18_Click(sender As Object, e As EventArgs) Handles PB_18.Click 頁面 = "2" : PA2 = 群組碼(18) : 主頁_p.SendToBack() : 次頁_p.SendToBack() : Set_品名清單() : Chart1.Visible = True : Set_清單() : NA1 = 0 : 載入時繪圖() End Sub Private Sub PB_19_Click(sender As Object, e As EventArgs) Handles PB_19.Click 頁面 = "2" : PA2 = 群組碼(19) : 主頁_p.SendToBack() : 次頁_p.SendToBack() : Set_品名清單() : Chart1.Visible = True : Set_清單() : NA1 = 0 : 載入時繪圖() End Sub Private Sub PB_20_Click(sender As Object, e As EventArgs) Handles PB_20.Click 頁面 = "2" : PA2 = 群組碼(20) : 主頁_p.SendToBack() : 次頁_p.SendToBack() : Set_品名清單() : Chart1.Visible = True : Set_清單() : NA1 = 0 : 載入時繪圖() End Sub Private Sub PB_21_Click(sender As Object, e As EventArgs) Handles PB_21.Click 頁面 = "2" : PA2 = 群組碼(21) : 主頁_p.SendToBack() : 次頁_p.SendToBack() : Set_品名清單() : Chart1.Visible = True : Set_清單() : NA1 = 0 : 載入時繪圖() End Sub Private Sub TB_1_TextChanged(sender As Object, e As EventArgs) Handles TB_1.Click 頁面 = "2" : PA2 = 群組碼(1) : 主頁_p.SendToBack() : 次頁_p.SendToBack() : Set_品名清單() : Chart1.Visible = True : Set_清單() : NA1 = 0 : 載入時繪圖() End Sub Private Sub TB_2_TextChanged(sender As Object, e As EventArgs) Handles TB_2.Click 頁面 = "2" : PA2 = 群組碼(2) : 主頁_p.SendToBack() : 次頁_p.SendToBack() : Set_品名清單() : Chart1.Visible = True : Set_清單() : NA1 = 0 : 載入時繪圖() End Sub Private Sub TB_3_TextChanged(sender As Object, e As EventArgs) Handles TB_3.Click 頁面 = "2" : PA2 = 群組碼(3) : 主頁_p.SendToBack() : 次頁_p.SendToBack() : Set_品名清單() : Chart1.Visible = True : Set_清單() : NA1 = 0 : 載入時繪圖() End Sub Private Sub TB_4_TextChanged(sender As Object, e As EventArgs) Handles TB_4.Click 頁面 = "2" : PA2 = 群組碼(4) : 主頁_p.SendToBack() : 次頁_p.SendToBack() : Set_品名清單() : Chart1.Visible = True : Set_清單() : NA1 = 0 : 載入時繪圖() End Sub Private Sub TB_5_TextChanged(sender As Object, e As EventArgs) Handles TB_5.Click 頁面 = "2" : PA2 = 群組碼(5) : 主頁_p.SendToBack() : 次頁_p.SendToBack() : Set_品名清單() : Chart1.Visible = True : Set_清單() : NA1 = 0 : 載入時繪圖() End Sub Private Sub TB_6_TextChanged(sender As Object, e As EventArgs) Handles TB_6.Click 頁面 = "2" : PA2 = 群組碼(6) : 主頁_p.SendToBack() : 次頁_p.SendToBack() : Set_品名清單() : Chart1.Visible = True : Set_清單() : NA1 = 0 : 載入時繪圖() End Sub Private Sub TB_7_TextChanged(sender As Object, e As EventArgs) Handles TB_7.Click 頁面 = "2" : PA2 = 群組碼(7) : 主頁_p.SendToBack() : 次頁_p.SendToBack() : Set_品名清單() : Chart1.Visible = True : Set_清單() : NA1 = 0 : 載入時繪圖() End Sub Private Sub TB_8_TextChanged(sender As Object, e As EventArgs) Handles TB_8.Click 頁面 = "2" : PA2 = 群組碼(8) : 主頁_p.SendToBack() : 次頁_p.SendToBack() : Set_品名清單() : Chart1.Visible = True : Set_清單() : NA1 = 0 : 載入時繪圖() End Sub Private Sub TB_9_TextChanged(sender As Object, e As EventArgs) Handles TB_9.Click 頁面 = "2" : PA2 = 群組碼(9) : 主頁_p.SendToBack() : 次頁_p.SendToBack() : Set_品名清單() : Chart1.Visible = True : Set_清單() : NA1 = 0 : 載入時繪圖() End Sub Private Sub TB_10_TextChanged(sender As Object, e As EventArgs) Handles TB_10.Click 頁面 = "2" : PA2 = 群組碼(10) : 主頁_p.SendToBack() : 次頁_p.SendToBack() : Set_品名清單() : Chart1.Visible = True : Set_清單() : NA1 = 0 : 載入時繪圖() End Sub Private Sub TB_11_TextChanged(sender As Object, e As EventArgs) Handles TB_11.Click 頁面 = "2" : PA2 = 群組碼(11) : 主頁_p.SendToBack() : 次頁_p.SendToBack() : Set_品名清單() : Chart1.Visible = True : Set_清單() : NA1 = 0 : 載入時繪圖() End Sub Private Sub TB_12_TextChanged(sender As Object, e As EventArgs) Handles TB_12.Click 頁面 = "2" : PA2 = 群組碼(12) : 主頁_p.SendToBack() : 次頁_p.SendToBack() : Set_品名清單() : Chart1.Visible = True : Set_清單() : NA1 = 0 : 載入時繪圖() End Sub Private Sub TB_13_TextChanged(sender As Object, e As EventArgs) Handles TB_13.Click 頁面 = "2" : PA2 = 群組碼(13) : 主頁_p.SendToBack() : 次頁_p.SendToBack() : Set_品名清單() : Chart1.Visible = True : Set_清單() : NA1 = 0 : 載入時繪圖() End Sub Private Sub TB_14_TextChanged(sender As Object, e As EventArgs) Handles TB_14.Click 頁面 = "2" : PA2 = 群組碼(14) : 主頁_p.SendToBack() : 次頁_p.SendToBack() : Set_品名清單() : Chart1.Visible = True : Set_清單() : NA1 = 0 : 載入時繪圖() End Sub Private Sub TB_15_TextChanged(sender As Object, e As EventArgs) Handles TB_15.Click 頁面 = "2" : PA2 = 群組碼(15) : 主頁_p.SendToBack() : 次頁_p.SendToBack() : Set_品名清單() : Chart1.Visible = True : Set_清單() : NA1 = 0 : 載入時繪圖() End Sub Private Sub TB_16_TextChanged(sender As Object, e As EventArgs) Handles TB_16.Click 頁面 = "2" : PA2 = 群組碼(16) : 主頁_p.SendToBack() : 次頁_p.SendToBack() : Set_品名清單() : Chart1.Visible = True : Set_清單() : NA1 = 0 : 載入時繪圖() End Sub Private Sub TB_17_TextChanged(sender As Object, e As EventArgs) Handles TB_17.Click 頁面 = "2" : PA2 = 群組碼(17) : 主頁_p.SendToBack() : 次頁_p.SendToBack() : Set_品名清單() : Chart1.Visible = True : Set_清單() : NA1 = 0 : 載入時繪圖() End Sub Private Sub TB_18_TextChanged(sender As Object, e As EventArgs) Handles TB_18.Click 頁面 = "2" : PA2 = 群組碼(18) : 主頁_p.SendToBack() : 次頁_p.SendToBack() : Set_品名清單() : Chart1.Visible = True : Set_清單() : NA1 = 0 : 載入時繪圖() End Sub Private Sub TB_19_TextChanged(sender As Object, e As EventArgs) Handles TB_19.Click 頁面 = "2" : PA2 = 群組碼(19) : 主頁_p.SendToBack() : 次頁_p.SendToBack() : Set_品名清單() : Chart1.Visible = True : Set_清單() : NA1 = 0 : 載入時繪圖() End Sub Private Sub TB_20_TextChanged(sender As Object, e As EventArgs) Handles TB_20.Click 頁面 = "2" : PA2 = 群組碼(20) : 主頁_p.SendToBack() : 次頁_p.SendToBack() : Set_品名清單() : Chart1.Visible = True : Set_清單() : NA1 = 0 : 載入時繪圖() End Sub Private Sub TB_21_TextChanged(sender As Object, e As EventArgs) Handles TB_21.Click 頁面 = "2" : PA2 = 群組碼(21) : 主頁_p.SendToBack() : 次頁_p.SendToBack() : Set_品名清單() : Chart1.Visible = True : Set_清單() : NA1 = 0 : 載入時繪圖() End Sub Private Sub 風格() If 深色風格 = False Then Me.BackColor = SystemColors.Control : Panel2.BackColor = SystemColors.Control : 主頁_p.BackColor = SystemColors.Control : 次頁_p.BackColor = SystemColors.Control 關鍵字_lb.ForeColor = Color.Black : 採購平均單價_ch.ForeColor = Color.Black : 採購數量_ch.ForeColor = Color.Black : 詳細資料2_ch.ForeColor = Color.Black 長條圖_ch.ForeColor = Color.Black : 折線圖_ch.ForeColor = Color.Black 語轉扭_bt.BackColor = Color.White : 語轉扭_bt.ForeColor = Color.Black : 回首頁_bt.BackColor = Color.White : 回首頁_bt.ForeColor = Color.Black 回次頁_bt.BackColor = Color.White : 回次頁_bt.ForeColor = Color.Black : 關鍵字查詢_bt.BackColor = Color.White : 關鍵字查詢_bt.ForeColor = Color.Black 上一筆_bt.BackColor = Color.White : 上一筆_bt.ForeColor = Color.Black : 下一筆_bt.BackColor = Color.White : 下一筆_bt.ForeColor = Color.Black 查詢入圖_bt.BackColor = Color.White : 查詢入圖_bt.ForeColor = Color.Black : 清除查詢_bt.BackColor = Color.White : 清除查詢_bt.ForeColor = Color.Black 清除圖表_bt.BackColor = Color.White : 清除圖表_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 工具_bt.BackColor = Color.White : 日用_bt.BackColor = Color.White : 其他_bt.BackColor = Color.White 關鍵字查詢_tb.BackColor = Color.White : 關鍵字查詢_tb.ForeColor = Color.Black TB_1.BackColor = Color.White : TB_1.ForeColor = Color.Black : TB_2.BackColor = Color.White : TB_2.ForeColor = Color.Black TB_3.BackColor = Color.White : TB_3.ForeColor = Color.Black : TB_4.BackColor = Color.White : TB_4.ForeColor = Color.Black TB_5.BackColor = Color.White : TB_5.ForeColor = Color.Black : TB_6.BackColor = Color.White : TB_6.ForeColor = Color.Black TB_7.BackColor = Color.White : TB_7.ForeColor = Color.Black : TB_8.BackColor = Color.White : TB_8.ForeColor = Color.Black TB_9.BackColor = Color.White : TB_9.ForeColor = Color.Black : TB_10.BackColor = Color.White : TB_10.ForeColor = Color.Black TB_11.BackColor = Color.White : TB_11.ForeColor = Color.Black : TB_12.BackColor = Color.White : TB_12.ForeColor = Color.Black TB_13.BackColor = Color.White : TB_13.ForeColor = Color.Black : TB_14.BackColor = Color.White : TB_14.ForeColor = Color.Black TB_15.BackColor = Color.White : TB_15.ForeColor = Color.Black : TB_16.BackColor = Color.White : TB_16.ForeColor = Color.Black TB_17.BackColor = Color.White : TB_17.ForeColor = Color.Black : TB_18.BackColor = Color.White : TB_18.ForeColor = Color.Black TB_19.BackColor = Color.White : TB_19.ForeColor = Color.Black : TB_20.BackColor = Color.White : TB_20.ForeColor = Color.Black TB_21.BackColor = Color.White : TB_21.ForeColor = Color.Black PB_1.BackColor = Color.White : PB_2.BackColor = Color.White : PB_3.BackColor = Color.White : PB_4.BackColor = Color.White : PB_5.BackColor = Color.White PB_6.BackColor = Color.White : PB_7.BackColor = Color.White : PB_8.BackColor = Color.White : PB_9.BackColor = Color.White : PB_10.BackColor = Color.White PB_11.BackColor = Color.White : PB_12.BackColor = Color.White : PB_13.BackColor = Color.White : PB_14.BackColor = Color.White : PB_15.BackColor = Color.White PB_16.BackColor = Color.White : PB_17.BackColor = Color.White : PB_18.BackColor = Color.White : PB_19.BackColor = Color.White : PB_20.BackColor = Color.White PB_21.BackColor = Color.White 物料清單_dgv.EnableHeadersVisualStyles = True : 物料清單_dgv.BackgroundColor = Color.White : 物料清單_dgv.ColumnHeadersDefaultCellStyle.ForeColor = Color.Black 物料清單_dgv.AlternatingRowsDefaultCellStyle.BackColor = Color.LightPink 物料清單_dgv.DefaultCellStyle.BackColor = Color.White : 物料清單_dgv.DefaultCellStyle.ForeColor = Color.Black Else Me.BackColor = Color.Black : Panel2.BackColor = Color.Black : 主頁_p.BackColor = Color.Black : 次頁_p.BackColor = Color.Black 關鍵字_lb.ForeColor = Color.White : 採購平均單價_ch.ForeColor = Color.White : 採購數量_ch.ForeColor = Color.White : 詳細資料2_ch.ForeColor = Color.White 長條圖_ch.ForeColor = Color.White : 折線圖_ch.ForeColor = Color.White 語轉扭_bt.BackColor = Color.DimGray : 語轉扭_bt.ForeColor = Color.White : 回首頁_bt.BackColor = Color.DimGray : 回首頁_bt.ForeColor = Color.White 回次頁_bt.BackColor = Color.DimGray : 回次頁_bt.ForeColor = Color.White : 關鍵字查詢_bt.BackColor = Color.DimGray : 關鍵字查詢_bt.ForeColor = Color.White 上一筆_bt.BackColor = Color.DimGray : 上一筆_bt.ForeColor = Color.White : 下一筆_bt.BackColor = Color.DimGray : 下一筆_bt.ForeColor = Color.White 查詢入圖_bt.BackColor = Color.DimGray : 查詢入圖_bt.ForeColor = Color.White : 清除查詢_bt.BackColor = Color.DimGray : 清除查詢_bt.ForeColor = Color.White 清除圖表_bt.BackColor = Color.DimGray : 清除圖表_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 工具_bt.BackColor = Color.DimGray : 日用_bt.BackColor = Color.DimGray : 其他_bt.BackColor = Color.DimGray 關鍵字查詢_tb.BackColor = Color.DimGray : 關鍵字查詢_tb.ForeColor = Color.White TB_1.BackColor = Color.Black : TB_1.ForeColor = Color.White : TB_2.BackColor = Color.Black : TB_2.ForeColor = Color.White TB_3.BackColor = Color.Black : TB_3.ForeColor = Color.White : TB_4.BackColor = Color.Black : TB_4.ForeColor = Color.White TB_5.BackColor = Color.Black : TB_5.ForeColor = Color.White : TB_6.BackColor = Color.Black : TB_6.ForeColor = Color.White TB_7.BackColor = Color.Black : TB_7.ForeColor = Color.White : TB_8.BackColor = Color.Black : TB_8.ForeColor = Color.White TB_9.BackColor = Color.Black : TB_9.ForeColor = Color.White : TB_10.BackColor = Color.Black : TB_10.ForeColor = Color.White TB_11.BackColor = Color.Black : TB_11.ForeColor = Color.White : TB_12.BackColor = Color.Black : TB_12.ForeColor = Color.White TB_13.BackColor = Color.Black : TB_13.ForeColor = Color.White : TB_14.BackColor = Color.Black : TB_14.ForeColor = Color.White TB_15.BackColor = Color.Black : TB_15.ForeColor = Color.White : TB_16.BackColor = Color.Black : TB_16.ForeColor = Color.White TB_17.BackColor = Color.Black : TB_17.ForeColor = Color.White : TB_18.BackColor = Color.Black : TB_18.ForeColor = Color.White TB_19.BackColor = Color.Black : TB_19.ForeColor = Color.White : TB_20.BackColor = Color.Black : TB_20.ForeColor = Color.White TB_21.BackColor = Color.Black : TB_21.ForeColor = Color.White PB_1.BackColor = Color.DimGray : PB_2.BackColor = Color.DimGray : PB_3.BackColor = Color.DimGray : PB_4.BackColor = Color.DimGray : PB_5.BackColor = Color.DimGray PB_6.BackColor = Color.DimGray : PB_7.BackColor = Color.DimGray : PB_8.BackColor = Color.DimGray : PB_9.BackColor = Color.DimGray : PB_10.BackColor = Color.DimGray PB_11.BackColor = Color.DimGray : PB_12.BackColor = Color.DimGray : PB_13.BackColor = Color.DimGray : PB_14.BackColor = Color.DimGray : PB_15.BackColor = Color.DimGray PB_16.BackColor = Color.DimGray : PB_17.BackColor = Color.DimGray : PB_18.BackColor = Color.DimGray : PB_19.BackColor = Color.DimGray : PB_20.BackColor = Color.DimGray PB_21.BackColor = Color.DimGray 物料清單_dgv.EnableHeadersVisualStyles = False : 物料清單_dgv.BackgroundColor = Color.DimGray : 物料清單_dgv.ColumnHeadersDefaultCellStyle.ForeColor = Color.White 物料清單_dgv.ColumnHeadersDefaultCellStyle.BackColor = Color.Black : 物料清單_dgv.AlternatingRowsDefaultCellStyle.BackColor = Color.DimGray 物料清單_dgv.DefaultCellStyle.BackColor = Color.Black : 物料清單_dgv.DefaultCellStyle.ForeColor = Color.White End If End Sub End Class