123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486 |
- Option Explicit On
- Imports System.IO
- Imports Microsoft.Office.Interop.Excel.XlUnderlineStyle
- Imports Microsoft.Office.Interop.Excel.Constants
- Imports Microsoft.Office.Interop.Excel.XlBordersIndex
- Imports Microsoft.Office.Interop.Excel.XlLineStyle
- Imports Microsoft.Office.Interop.Excel.XlBorderWeight
- Imports Microsoft.Office.Interop.Excel.XlThemeFont
- Imports Microsoft.Office.Interop.Excel.XlThemeColor
- Imports Microsoft.Office.Interop.Excel.XlWindowState
- Imports Microsoft.Office.Interop.Excel
- Public Class 臨時工卡片管理
- Dim 可激活 As Boolean
- Dim 行數, 資料數, 換行, X軸, 剩下, 頁數, 開始, 結尾, II2, II3 As Integer
- Dim RI As Integer = -1
- Dim SK As String = "要查找的 KEY"
- Dim Str As String = System.Windows.Forms.Application.StartupPath
- DIM 對話框(36) As String
- ReadOnly QRCODE As DotNetBarcode = New DotNetBarcode
- Dim xlApp As Application : Dim xlBook As Workbook : Dim xlSheet As Worksheet
- Private Sub Set_使用者清單()
- Dim ds1, ds2 As New DataSet
- 清單1_dgv.DataSource = Nothing : ds1.Clear()
- 清單1_dgv.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
- 清單1_dgv.ColumnHeadersHeight = 25 : 清單1_dgv.AllowUserToAddRows = False : 清單1_dgv.RowTemplate.Height = 25
- If 空白臨時卡_ch.Checked = True Then : SQL5 = " AND (使用者權限管理表.姓名 LIKE '未啟用/Not Enabled') "
- Else : SQL5 = " AND (使用者權限管理表.姓名 NOT LIKE '未啟用/Not Enabled') " : End If
- SQL_臨時工卡片管理清單()
- da.Fill(ds1) : 清單1_dgv.DataSource = ds1.Tables(0) : conn.Close()
- 清單1_dgv.Columns(1).FillWeight = 40 : 清單1_dgv.Columns(1).ReadOnly = True : 清單1_dgv.Columns(2).ReadOnly = True : 清單1_dgv.Columns(3).Visible = False
- If 空白臨時卡_ch.Checked = True Then
- 清單1_dgv.Columns(0).ReadOnly = False
- 清單1_dgv.EditMode = DataGridViewEditMode.EditOnEnter
- For i As Integer = 0 To 清單1_dgv.Rows.Count - 1 : 清單1_dgv.Rows(i).Cells(表頭(0)).Value = "" : Next
- Else : 清單1_dgv.Columns(0).ReadOnly = True : End If : 筆數_tb.Text = 清單1_dgv.Rows.Count
- For I As Integer = 0 To 清單1_dgv.Rows.Count - 1
- If 清單1_dgv.Rows(I).Cells(0).Value.ToString <> "" Then
- 清單1_dgv.Rows(I).Cells(0).Value = 清單1_dgv.Rows(I).Cells(0).Value.ToString.ToUpper
- End If
- Next
- 清單_dgv.DataSource = Nothing : ds2.Clear()
- 清單_dgv.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
- 清單_dgv.ColumnHeadersHeight = 25 : 清單_dgv.AllowUserToAddRows = False : 清單_dgv.RowTemplate.Height = 25
- SQL_臨時工卡片管理清單1()
- da.Fill(ds2) : 清單_dgv.DataSource = ds2.Tables(0) : conn.Close()
- 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-271" Or Strings.Left(line, 8) = "H602-102" Or Strings.Left(line, 8) = "H204-134" Or
- Strings.Left(line, 8) = "H601-104" 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-271" : Set_語言查詢() : Me.Text = 語言_dgv(1, RI).Value.ToString : SK = "G000-108" : Set_語言查詢() : ToolTip1.ToolTipTitle = 語言_dgv(1, RI).Value.ToString
- SK = "H610-100" : Set_語言查詢() : 臨時卡激活_tp.Text = 語言_dgv(1, RI).Value.ToString : SK = "H610-101" : Set_語言查詢() : 臨時卡列印_tp.Text = 語言_dgv(1, RI).Value.ToString
- SK = "H610-102" : Set_語言查詢() : Label7.Text = 語言_dgv(1, RI).Value.ToString : SK = "H610-103" : Set_語言查詢() : Label2.Text = 語言_dgv(1, RI).Value.ToString
- SK = "G000-114" : Set_語言查詢() : 對話框(0) = 語言_dgv(1, RI).Value.ToString : SK = "H610-104" : Set_語言查詢() : Label1.Text = 語言_dgv(1, RI).Value.ToString
- SK = "H610-105" : Set_語言查詢() : Label3.Text = 語言_dgv(1, RI).Value.ToString : SK = "H610-106" : Set_語言查詢() : Label4.Text = 語言_dgv(1, RI).Value.ToString
- SK = "H610-107" : Set_語言查詢() : Label5.Text = 語言_dgv(1, RI).Value.ToString : SK = "H601-104" : Set_語言查詢() : 表頭(1) = 語言_dgv(1, RI).Value.ToString
- SK = "G000-113" : Set_語言查詢() : 對話框(1) = 語言_dgv(1, RI).Value.ToString : SK = "H610-108" : Set_語言查詢() : 對話框(2) = 語言_dgv(1, RI).Value.ToString
- SK = "G000-127" : Set_語言查詢() : 對話框(3) = 語言_dgv(1, RI).Value.ToString : SK = "H610-109" : Set_語言查詢() : Label11.Text = 語言_dgv(1, RI).Value.ToString
- SK = "G000-162" : Set_語言查詢() : 對話框(4) = 語言_dgv(1, RI).Value.ToString : SK = "G000-163" : Set_語言查詢() : 對話框(5) = 語言_dgv(1, RI).Value.ToString
- SK = "H610-110" : Set_語言查詢() : 空白臨時卡_ch.Text = 語言_dgv(1, RI).Value.ToString : SK = "H610-111" : Set_語言查詢() : 已使用的臨時卡_ch.Text = 語言_dgv(1, RI).Value.ToString
- SK = "H610-112" : Set_語言查詢() : 對話框(6) = 語言_dgv(1, RI).Value.ToString : SK = "G000-119" : Set_語言查詢() : 對話框(7) = 語言_dgv(1, RI).Value.ToString
- SK = "H610-113" : Set_語言查詢() : 對話框(8) = 語言_dgv(1, RI).Value.ToString : SK = "H204-134" : Set_語言查詢() : 對話框(9) = 語言_dgv(1, RI).Value.ToString
- SK = "H610-114" : Set_語言查詢() : 對話框(10) = 語言_dgv(1, RI).Value.ToString : 表頭(2) = 系統語言字典("H611-105-" & 語言)
- SK = "H602-102" : Set_語言查詢() : 姓名_lb.Text = 語言_dgv(1, RI).Value.ToString : 表頭(0) = 語言_dgv(1, RI).Value.ToString
- End Sub
- Private Sub 列印成EXCEL_bt_MouseEnter(sender As Object, e As EventArgs) Handles 列印成EXCEL_bt.MouseEnter
- ToolTip1.SetToolTip(Me.列印成EXCEL_bt, 對話框(0))
- End Sub
- Private Sub 列印成EXCEL1_bt_MouseEnter(sender As Object, e As EventArgs) Handles 列印成EXCEL1_bt.MouseEnter
- ToolTip1.SetToolTip(Me.列印成EXCEL1_bt, 對話框(0))
- End Sub
- Private Sub 查詢_bt_MouseEnter(sender As Object, e As EventArgs) Handles 查詢_bt.MouseEnter
- ToolTip1.SetToolTip(Me.查詢_bt, 對話框(1))
- End Sub
- Private Sub 確認新增_bt_MouseEnter(sender As Object, e As EventArgs) Handles 確認新增_bt.MouseEnter
- ToolTip1.SetToolTip(Me.確認新增_bt, 對話框(2))
- End Sub
- Private Sub 確認新增1_bt_MouseEnter(sender As Object, e As EventArgs) Handles 確認新增1_bt.MouseEnter
- ToolTip1.SetToolTip(Me.確認新增1_bt, 對話框(2))
- End Sub
- Private Sub 群組清單()
- SQL_人員薪資表_群組() : 群組_cb.Items.Clear() : 群組_cb.Items.Add("")
- 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
- 群組_cb.SendToBack()
- 清單1_dgv.RowsDefaultCellStyle.Font = New System.Drawing.Font("微軟正黑體", HX_PGS_ERP_SYS.字體_NUD.Value)
- 查詢_dgv.RowsDefaultCellStyle.Font = New System.Drawing.Font("微軟正黑體", HX_PGS_ERP_SYS.字體_NUD.Value)
- End Sub
- Private Sub 臨時工卡片管理_Shown(sender As Object, e As EventArgs) Handles MyBase.Shown
- 風格() : H(610) = True : 介面 = "H610" : 語言轉換讀取() : 顯示說明(999, False)
- 視窗3_pl.Visible = False : 視窗3_pl.BringToFront() : 空白臨時卡_ch.Checked = True : Panel1.SendToBack()
- If Strings.Left(登入人部門, 1) = "3" Then : Panel2.Enabled = False : End If
- 群組清單() : Set_使用者清單()
- 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 清單1_dgv_CellContentClick(sender As Object, e As DataGridViewCellEventArgs) Handles 清單1_dgv.CellClick
- If e.RowIndex = -1 Then : Else
- QRCode1_pb.Image = Nothing : QRCode1_pb.Image = New Bitmap(QRCode1_pb.Width, QRCode1_pb.Height)
- Dim GP As Graphics = Graphics.FromImage(QRCode1_pb.Image) : QRCODE.Type = DotNetBarcode.Types.QRCode : QRCODE.QRQuitZone = 0
- QRCODE.QRWriteBar(清單1_dgv.Rows(e.RowIndex).Cells(表頭(1)).Value.ToString, 12, 12, 3.3, GP)
- QRCode1_pb.SizeMode = 4
- End If
- End Sub
- Private Sub 查詢_dgv_CellContentClick(sender As Object, e As DataGridViewCellEventArgs) Handles 查詢_dgv.CellClick
- 姓名_tb.Text = 查詢_dgv.Rows(e.RowIndex).Cells(表頭(0)).Value.ToString : ID卡號_tb.Text = 查詢_dgv.Rows(e.RowIndex).Cells(表頭(1)).Value.ToString
- QRCode_pb.Image = Nothing : QRCode2_pb.Image = Nothing
- QRCode_pb.Image = New Bitmap(QRCode_pb.Width, QRCode_pb.Height) : QRCode2_pb.Image = New Bitmap(QRCode2_pb.Width, QRCode2_pb.Height)
- Dim GP As Graphics = Graphics.FromImage(QRCode_pb.Image) : QRCODE.Type = DotNetBarcode.Types.QRCode : QRCODE.QRQuitZone = 0
- Dim GP1 As Graphics = Graphics.FromImage(QRCode2_pb.Image) : QRCODE.Type = DotNetBarcode.Types.QRCode : QRCODE.QRQuitZone = 0
- QRCODE.QRWriteBar(查詢_dgv.Rows(e.RowIndex).Cells(表頭(1)).Value.ToString, 16, 16, 7.2, GP)
- QRCODE.QRWriteBar(查詢_dgv.Rows(e.RowIndex).Cells(表頭(1)).Value.ToString, 12, 12, 3.3, GP1)
- QRCode_pb.SizeMode = 4 : QRCode2_pb.SizeMode = 4
- 視窗3_pl.Visible = False : Label6.Text = 對話框(5)
- If 姓名_tb.Text = "未啟用/Not Enabled" Then : 可激活 = True : Else : 可激活 = False : End If
- End Sub
- Private Sub 清單1_dgv_MouseUp(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles 清單1_dgv.MouseUp
- 'If 清單1_dgv.SelectedCells.Count = 1 Then : MsgBox(清單1_dgv.SelectedCells(0).ColumnIndex & " " & 清單1_dgv.SelectedCells(0).RowIndex) : End If
- If 清單1_dgv.SelectedCells.Count > 0 Then
- If 清單1_dgv.SelectedCells(0).ColumnIndex = 2 Then
- 群組_cb.Text = 清單1_dgv.Rows(清單1_dgv.SelectedCells(0).RowIndex).Cells(2).Value.ToString
- CB選擇清單(群組_cb, 群組_cb.Text)
- 清單1_dgv.Rows(清單1_dgv.SelectedCells(0).RowIndex).Cells(2).Value = 群組_cb.Text
- End If
- End If
- End Sub
- Private Sub 查詢_bt_Click(sender As Object, e As EventArgs) Handles 查詢_bt.Click
- Dim 運算 As Boolean
- If 姓名_tb.Text = "" And ID卡號_tb.Text = "" Then : MGB(對話框(3), 1) : 運算 = False
- ElseIf 姓名_tb.Text <> "" And ID卡號_tb.Text = "" Then : PA5 = 姓名_tb.Text : SQL2 = "姓名 LIKE N'%" & PA5 & "%'" : 運算 = True
- ElseIf 姓名_tb.Text = "" And ID卡號_tb.Text <> "" Then : PA6 = ID卡號_tb.Text : SQL2 = "ID卡號 LIKE N'" & PA6 & "'" : 運算 = True
- ElseIf 姓名_tb.Text <> "" And ID卡號_tb.Text <> "" Then : PA5 = 姓名_tb.Text : PA6 = ID卡號_tb.Text : SQL2 = "姓名 LIKE N'%" & PA5 & "%' AND ID卡號 LIKE N'" & PA6 & "'" : 運算 = True
- End If
- If 運算 = True Then
- Dim ds1 As New DataSet
- 查詢_dgv.DataSource = Nothing : ds1.Clear()
- 查詢_dgv.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
- 查詢_dgv.ColumnHeadersHeight = 25 : 查詢_dgv.AllowUserToAddRows = False : 查詢_dgv.RowTemplate.Height = 25
- SQL_臨時工卡片查詢()
- da.Fill(ds1) : 查詢_dgv.DataSource = ds1.Tables(0) : conn.Close()
- Else : 查詢_dgv.DataSource = Nothing
- End If
- If 查詢_dgv.Rows.Count = 0 Then : 可激活 = False
- Label6.Text = 對話框(4) : QRCode_pb.Image = Nothing : QRCode2_pb.Image = Nothing
- ElseIf 查詢_dgv.Rows.Count = 1 Then
- Label6.Text = 對話框(5) : 姓名_tb.Text = 查詢_dgv.Rows(0).Cells(表頭(0)).Value.ToString : ID卡號_tb.Text = 查詢_dgv.Rows(0).Cells(表頭(1)).Value.ToString
- QRCode_pb.Image = Nothing : QRCode2_pb.Image = Nothing
- QRCode_pb.Image = New Bitmap(QRCode_pb.Width, QRCode_pb.Height) : QRCode2_pb.Image = New Bitmap(QRCode2_pb.Width, QRCode2_pb.Height)
- Dim GP As Graphics = Graphics.FromImage(QRCode_pb.Image) : QRCODE.Type = DotNetBarcode.Types.QRCode : QRCODE.QRQuitZone = 0
- Dim GP1 As Graphics = Graphics.FromImage(QRCode2_pb.Image) : QRCODE.Type = DotNetBarcode.Types.QRCode : QRCODE.QRQuitZone = 0
- QRCODE.QRWriteBar(查詢_dgv.Rows(0).Cells(表頭(1)).Value.ToString, 100, 20, 9, GP)
- QRCODE.QRWriteBar(查詢_dgv.Rows(0).Cells(表頭(1)).Value.ToString, 12, 12, 3.3, GP1)
- QRCode_pb.SizeMode = 4 : QRCode2_pb.SizeMode = 4
- If 姓名_tb.Text = "未啟用/Not Enabled" Then : 可激活 = True : Else : 可激活 = False : End If
- ElseIf 查詢_dgv.Rows.Count > 0 Then
- 視窗3_pl.Visible = True
- End If
- End Sub
- Private Sub 空白臨時卡_ch_CheckedChanged(sender As Object, e As EventArgs) Handles 空白臨時卡_ch.Click
- 空白臨時卡_ch.Checked = True : 已使用的臨時卡_ch.Checked = False : Set_使用者清單()
- End Sub
- Private Sub 已使用的臨時卡_ch_CheckedChanged(sender As Object, e As EventArgs) Handles 已使用的臨時卡_ch.Click
- 空白臨時卡_ch.Checked = False : 已使用的臨時卡_ch.Checked = True : Set_使用者清單()
- End Sub
- Private Sub 確認新增1_bt_Click(sender As Object, e As EventArgs) Handles 確認新增1_bt.Click
- If 空白臨時卡_ch.Checked = True Then
- Dim 重複姓名 As String = "" : Dim 有資料 As Boolean
- For i As Integer = 0 To 清單1_dgv.Rows.Count - 1
- If 清單1_dgv.Rows(i).Cells(表頭(0)).Value.ToString <> "" Then : SK = 清單1_dgv.Rows(i).Cells(表頭(0)).Value.ToString
- RI = -1
- For Each row As DataGridViewRow In 清單1_dgv.Rows : If row.Cells(0).Value.ToString().ToUpper = SK.ToUpper Then : RI = row.Index : Exit For : End If : Next
- If 重複姓名 = "" Then : If RI <> i Then : 重複姓名 = 清單1_dgv(0, RI).Value.ToString() : End If
- Else : If RI <> i Then : 重複姓名 = 重複姓名 & "、" & 清單1_dgv(0, RI).Value.ToString() : End If : End If
- RI = -1
- For Each row As DataGridViewRow In 清單_dgv.Rows : If row.Cells(0).Value.ToString().ToUpper = SK.ToUpper Then : RI = row.Index : Exit For : End If : Next
- If 重複姓名 = "" Then : If RI > -1 Then : 重複姓名 = 清單_dgv(0, RI).Value.ToString() : End If
- Else : If RI > -1 Then : 重複姓名 = 重複姓名 & "、" & 清單_dgv(0, RI).Value.ToString() : End If : End If
- 有資料 = True
- End If
- Next
- If 有資料 = False Then : MGB(對話框(8), 1) : Else
- If 重複姓名 <> "" Then : MGB(對話框(6) & 重複姓名, 1) : Else
- For i As Integer = 0 To 清單1_dgv.Rows.Count - 1
- If 清單1_dgv.Rows(i).Cells(表頭(0)).Value.ToString <> "" Then
- PA32 = 清單1_dgv.Rows(i).Cells(表頭(0)).Value.ToString : PA33 = 清單1_dgv.Rows(i).Cells(表頭(1)).Value.ToString
- PA30 = 清單1_dgv.Rows(i).Cells(2).Value.ToString : PA31 = 清單1_dgv.Rows(i).Cells(2).Value.ToString
- SQL_臨時工人開卡()
- End If
- Next : MGB(對話框(7), 1) : Set_使用者清單()
- End If
- End If
- End If
- End Sub
- Private Sub 確認新增_bt_Click(sender As Object, e As EventArgs) Handles 確認新增_bt.Click
- If 可激活 = False Then : MGB(對話框(10), 1) : Else
- If 姓名_tb.Text = "" Or 姓名_tb.Text = "未啟用/Not Enabled" Then : MGB(對話框(10), 1) : Else
- If ID卡號_tb.Text <> "" Then : PA32 = 姓名_tb.Text : PA33 = ID卡號_tb.Text : SQL_臨時工人開卡() : MGB(對話框(7), 1) : Set_使用者清單() : End If
- End If
- End If
- End Sub
- Private Sub 列印成EXCEL1_bt_Click(sender As Object, e As EventArgs) Handles 列印成EXCEL1_bt.Click
- xlApp = CType(CreateObject("Excel.Application"), Application)
- xlApp.Visible = True
- xlApp.DisplayAlerts = True
- xlApp.Application.WindowState = xlMaximized
- xlBook = xlApp.Workbooks.Add
- '----------------------------------------------------------------------------------------------------------------------
- xlSheet = NewMethod(xlBook) : xlApp.Sheets(1).Select
- xlBook.Activate() : xlSheet.Activate()
-
- xlSheet.Cells(4, 2) = ID卡號_tb.Text : xlSheet.Cells(5, 2) = 姓名_tb.Text
- AA1(xlApp, xlSheet) : BB1(xlApp, xlSheet)
-
- xlSheet.PageSetup.PrintArea = ""
- xlApp.Cells.Select()
- xlApp.Application.WindowState = xlMinimized
- MGB(對話框(9), 1)
- End Sub
- Private Sub 列印成EXCEL_bt_Click(sender As Object, e As EventArgs) Handles 列印成EXCEL_bt.Click
- xlApp = CType(CreateObject("Excel.Application"), Application)
- xlApp.Visible = True
- xlApp.DisplayAlerts = True
- xlApp.Application.WindowState = xlMaximized
- xlBook = xlApp.Workbooks.Add
-
- 剩下 = 清單1_dgv.Rows.Count
- If 剩下 < 46 Then : 頁數 = 1 : ElseIf 剩下 < 91 Then : 頁數 = 2 : ElseIf 剩下 < 136 Then : 頁數 = 3 : ElseIf 剩下 < 181 Then : 頁數 = 4 : ElseIf 剩下 < 226 Then : 頁數 = 5
- ElseIf 剩下 < 271 Then : 頁數 = 6 : ElseIf 剩下 < 316 Then : 頁數 = 7 : ElseIf 剩下 < 361 Then : 頁數 = 8 : ElseIf 剩下 < 406 Then : 頁數 = 9 : ElseIf 剩下 < 451 Then : 頁數 = 10
- ElseIf 剩下 < 496 Then : 頁數 = 11 : ElseIf 剩下 < 541 Then : 頁數 = 12 : ElseIf 剩下 < 586 Then : 頁數 = 13 : ElseIf 剩下 < 631 Then : 頁數 = 14 : ElseIf 剩下 < 676 Then : 頁數 = 15
- ElseIf 剩下 < 721 Then : 頁數 = 16 : ElseIf 剩下 < 766 Then : 頁數 = 17 : ElseIf 剩下 < 811 Then : 頁數 = 18 : End If
- 開始 = 1 : II2 = 0 : II3 = 0
- For AZ As Integer = 1 To 頁數
- X軸 = 0 : 換行 = 0
- If AZ = 頁數 Then : 結尾 = 剩下 : Else : 結尾 = AZ * 45 : End If
- '----------------------------------------------------------------------------------------------------------------------
- xlSheet = NewMethod(xlBook) : xlApp.Sheets(1).Select
- xlBook.Activate() : xlSheet.Activate()
- For BZ As Integer = 開始 To 結尾
- X軸 += 1 : If X軸 = 4 Then : X軸 = 1 : End If
- If X軸 = 1 Then : xlSheet.Cells(4 + 換行, 2) = 清單1_dgv.Rows(II2).Cells(表頭(1)).Value.ToString : xlSheet.Cells(5 + 換行, 2) = 清單1_dgv.Rows(II2).Cells(表頭(0)).Value.ToString
- ElseIf X軸 = 2 Then : xlSheet.Cells(4 + 換行, 4) = 清單1_dgv.Rows(II2).Cells(表頭(1)).Value.ToString : xlSheet.Cells(5 + 換行, 4) = 清單1_dgv.Rows(II2).Cells(表頭(0)).Value.ToString
- ElseIf X軸 = 3 Then : xlSheet.Cells(4 + 換行, 6) = 清單1_dgv.Rows(II2).Cells(表頭(1)).Value.ToString : xlSheet.Cells(5 + 換行, 6) = 清單1_dgv.Rows(II2).Cells(表頭(0)).Value.ToString
- End If : If X軸 = 3 Then : 換行 += 5 : End If : II2 += 1
- Next
- 資料數 = 結尾 - 開始 : 行數 = 0 : For i As Integer = 0 To 9999 : If 資料數 <= 3 Then : 行數 += 1 : Exit For : Else : 資料數 -= 3 : 行數 += 1 : End If : Next
- AA(xlApp, xlSheet) : BB(xlApp, xlSheet) : 開始 += 45
- Next
-
- xlSheet.PageSetup.PrintArea = ""
- xlApp.Cells.Select()
- xlApp.Application.WindowState = xlMinimized
- MGB(對話框(9), 1)
- End Sub
- Private Shared Function NewMethod(xlBook As Workbook) As Worksheet
- Return CType(xlBook.Worksheets.Add, Worksheet)
- End Function
- Private Sub BB1(ByVal myExcel As Application, ByVal xlSheet As Worksheet)
- xlSheet.Rows(1 & ":" & 1).Select : myExcel.Selection.RowHeight = 20 : xlSheet.Rows(2 & ":" & 2).Select : myExcel.Selection.RowHeight = 50
- xlSheet.Rows(3 & ":" & 3).Select : myExcel.Selection.RowHeight = 130 : xlSheet.Rows(4 & ":" & 4).Select : myExcel.Selection.RowHeight = 20
- xlSheet.Rows(5 & ":" & 5).Select : myExcel.Selection.RowHeight = 35
- xlSheet.Range("B4:B5").Select()
- With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
- .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With
-
- xlSheet.Range("B2:B5").Select()
- myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
- With myExcel.Selection.Borders(xlEdgeLeft) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
- With myExcel.Selection.Borders(xlEdgeTop) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
- With myExcel.Selection.Borders(xlEdgeBottom) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
- With myExcel.Selection.Borders(xlEdgeRight) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
- myExcel.Selection.Borders(xlInsideVertical).LineStyle = xlNone : myExcel.Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
-
- Clipboard.SetDataObject(LOGO_pb.Image) : xlSheet.Range("B2").Select() : myExcel.ActiveSheet.Pictures.Paste.Select
- myExcel.Selection.ShapeRange.Height = 45 : myExcel.Selection.ShapeRange.IncrementLeft(17) : myExcel.Selection.ShapeRange.IncrementTop(2)
-
- Clipboard.SetDataObject(QRCode2_pb.Image) : xlSheet.Range("B3").Select() : myExcel.ActiveSheet.Pictures.Paste.Select
- myExcel.Selection.ShapeRange.Height = 120 : myExcel.Selection.ShapeRange.IncrementLeft(17) : myExcel.Selection.ShapeRange.IncrementTop(2)
-
- myExcel.Application.PrintCommunication = False
- With myExcel.ActiveSheet.PageSetup : .PrintTitleRows = "" : .PrintTitleColumns = "" : End With
- myExcel.Application.PrintCommunication = True : myExcel.ActiveSheet.PageSetup.PrintArea = "" : myExcel.Application.PrintCommunication = False
- With myExcel.ActiveSheet.PageSetup : .LeftHeader = "" : .CenterHeader = "" : .RightHeader = "" : .LeftFooter = "" : .CenterFooter = "" : .RightFooter = ""
- .LeftMargin = myExcel.Application.InchesToPoints(0.25) : .RightMargin = myExcel.Application.InchesToPoints(0.25) : .TopMargin = myExcel.Application.InchesToPoints(0.75)
- .BottomMargin = myExcel.Application.InchesToPoints(0.75) : .HeaderMargin = myExcel.Application.InchesToPoints(0.3) : .FooterMargin = myExcel.Application.InchesToPoints(0.3)
- .PrintHeadings = False : .PrintGridlines = False : .CenterHorizontally = False : .CenterVertically = False : .Draft = False
- .FirstPageNumber = xlAutomatic : .BlackAndWhite = False : .Zoom = 100 : .OddAndEvenPagesHeaderFooter = False : .DifferentFirstPageHeaderFooter = False
- .ScaleWithDocHeaderFooter = True : .AlignMarginsHeaderFooter = True : .EvenPage.LeftHeader.Text = "" : .EvenPage.CenterHeader.Text = "" : .EvenPage.RightHeader.Text = ""
- .EvenPage.LeftFooter.Text = "" : .EvenPage.CenterFooter.Text = "" : .EvenPage.RightFooter.Text = "" : .FirstPage.LeftHeader.Text = "" : .FirstPage.CenterHeader.Text = ""
- .FirstPage.RightHeader.Text = "" : .FirstPage.LeftFooter.Text = "" : .FirstPage.CenterFooter.Text = "" : .FirstPage.RightFooter.Text = ""
- End With : myExcel.Application.PrintCommunication = True
- End Sub
- Private Sub BB(ByVal myExcel As Application, ByVal xlSheet As Worksheet)
- 換行 = 0
- For i As Integer = 1 To 行數
- xlSheet.Rows(1 + 換行 & ":" & 1 + 換行).Select : myExcel.Selection.RowHeight = 20 : xlSheet.Rows(2 + 換行 & ":" & 2 + 換行).Select : myExcel.Selection.RowHeight = 50
- xlSheet.Rows(3 + 換行 & ":" & 3 + 換行).Select : myExcel.Selection.RowHeight = 130 : xlSheet.Rows(4 + 換行 & ":" & 4 + 換行).Select : myExcel.Selection.RowHeight = 20
- xlSheet.Rows(5 + 換行 & ":" & 5 + 換行).Select : myExcel.Selection.RowHeight = 35
-
- xlSheet.Range("B" & 4 + 換行 & ":B" & 5 + 換行).Select()
- With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
- .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With
- xlSheet.Range("D" & 4 + 換行 & ":D" & 5 + 換行).Select()
- With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
- .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With
- xlSheet.Range("F" & 4 + 換行 & ":F" & 5 + 換行).Select()
- With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
- .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With
-
- xlSheet.Range("B" & 2 + 換行 & ":B" & 5 + 換行).Select()
- myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
- With myExcel.Selection.Borders(xlEdgeLeft) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
- With myExcel.Selection.Borders(xlEdgeTop) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
- With myExcel.Selection.Borders(xlEdgeBottom) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
- With myExcel.Selection.Borders(xlEdgeRight) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
- myExcel.Selection.Borders(xlInsideVertical).LineStyle = xlNone : myExcel.Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
- xlSheet.Range("D" & 2 + 換行 & ":D" & 5 + 換行).Select()
- myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
- With myExcel.Selection.Borders(xlEdgeLeft) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
- With myExcel.Selection.Borders(xlEdgeTop) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
- With myExcel.Selection.Borders(xlEdgeBottom) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
- With myExcel.Selection.Borders(xlEdgeRight) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
- myExcel.Selection.Borders(xlInsideVertical).LineStyle = xlNone : myExcel.Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
- xlSheet.Range("F" & 2 + 換行 & ":F" & 5 + 換行).Select()
- myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
- With myExcel.Selection.Borders(xlEdgeLeft) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
- With myExcel.Selection.Borders(xlEdgeTop) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
- With myExcel.Selection.Borders(xlEdgeBottom) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
- With myExcel.Selection.Borders(xlEdgeRight) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
- myExcel.Selection.Borders(xlInsideVertical).LineStyle = xlNone : myExcel.Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
-
- Clipboard.SetDataObject(LOGO_pb.Image) : xlSheet.Range("B" & 2 + 換行).Select() : myExcel.ActiveSheet.Pictures.Paste.Select
- myExcel.Selection.ShapeRange.Height = 45 : myExcel.Selection.ShapeRange.IncrementLeft(17) : myExcel.Selection.ShapeRange.IncrementTop(2)
-
- Clipboard.SetDataObject(LOGO_pb.Image) : xlSheet.Range("D" & 2 + 換行).Select() : myExcel.ActiveSheet.Pictures.Paste.Select
- myExcel.Selection.ShapeRange.Height = 45 : myExcel.Selection.ShapeRange.IncrementLeft(17) : myExcel.Selection.ShapeRange.IncrementTop(2)
-
- Clipboard.SetDataObject(LOGO_pb.Image) : xlSheet.Range("F" & 2 + 換行).Select() : myExcel.ActiveSheet.Pictures.Paste.Select
- myExcel.Selection.ShapeRange.Height = 45 : myExcel.Selection.ShapeRange.IncrementLeft(17) : myExcel.Selection.ShapeRange.IncrementTop(2)
- 換行 += 5
- Next
- X軸 = 0 : 換行 = 0
- For BZ As Integer = 開始 To 結尾
- X軸 += 1 : If X軸 = 4 Then : X軸 = 1 : End If
- QRCode1_pb.Image = Nothing : QRCode1_pb.Image = New Bitmap(QRCode1_pb.Width, QRCode1_pb.Height)
- Dim GP As Graphics = Graphics.FromImage(QRCode1_pb.Image) : QRCODE.Type = DotNetBarcode.Types.QRCode : QRCODE.QRQuitZone = 0
- QRCODE.QRWriteBar(清單1_dgv.Rows(II3).Cells(表頭(1)).Value.ToString, 12, 12, 3.3, GP)
- QRCode1_pb.SizeMode = 4
- If X軸 = 1 Then
- Clipboard.SetDataObject(QRCode1_pb.Image) : xlSheet.Range("B" & 3 + 換行).Select() : myExcel.ActiveSheet.Pictures.Paste.Select
- myExcel.Selection.ShapeRange.Height = 120 : myExcel.Selection.ShapeRange.IncrementLeft(17) : myExcel.Selection.ShapeRange.IncrementTop(2)
- ElseIf X軸 = 2 Then
- Clipboard.SetDataObject(QRCode1_pb.Image) : xlSheet.Range("D" & 3 + 換行).Select() : myExcel.ActiveSheet.Pictures.Paste.Select
- myExcel.Selection.ShapeRange.Height = 120 : myExcel.Selection.ShapeRange.IncrementLeft(17) : myExcel.Selection.ShapeRange.IncrementTop(2)
- ElseIf X軸 = 3 Then
- Clipboard.SetDataObject(QRCode1_pb.Image) : xlSheet.Range("F" & 3 + 換行).Select() : myExcel.ActiveSheet.Pictures.Paste.Select
- myExcel.Selection.ShapeRange.Height = 120 : myExcel.Selection.ShapeRange.IncrementLeft(17) : myExcel.Selection.ShapeRange.IncrementTop(2)
- End If
- If X軸 = 3 Then : 換行 += 5 : End If : II3 += 1
- Next
-
- myExcel.Application.PrintCommunication = False
- With myExcel.ActiveSheet.PageSetup : .PrintTitleRows = "" : .PrintTitleColumns = "" : End With
- myExcel.Application.PrintCommunication = True : myExcel.ActiveSheet.PageSetup.PrintArea = "" : myExcel.Application.PrintCommunication = False
- With myExcel.ActiveSheet.PageSetup : .LeftHeader = "" : .CenterHeader = "" : .RightHeader = "" : .LeftFooter = "" : .CenterFooter = "" : .RightFooter = ""
- .LeftMargin = myExcel.Application.InchesToPoints(0.25) : .RightMargin = myExcel.Application.InchesToPoints(0.25) : .TopMargin = myExcel.Application.InchesToPoints(0.75)
- .BottomMargin = myExcel.Application.InchesToPoints(0.75) : .HeaderMargin = myExcel.Application.InchesToPoints(0.3) : .FooterMargin = myExcel.Application.InchesToPoints(0.3)
- .PrintHeadings = False : .PrintGridlines = False : .CenterHorizontally = False : .CenterVertically = False : .Draft = False
- .FirstPageNumber = xlAutomatic : .BlackAndWhite = False : .Zoom = 100 : .OddAndEvenPagesHeaderFooter = False : .DifferentFirstPageHeaderFooter = False
- .ScaleWithDocHeaderFooter = True : .AlignMarginsHeaderFooter = True : .EvenPage.LeftHeader.Text = "" : .EvenPage.CenterHeader.Text = "" : .EvenPage.RightHeader.Text = ""
- .EvenPage.LeftFooter.Text = "" : .EvenPage.CenterFooter.Text = "" : .EvenPage.RightFooter.Text = "" : .FirstPage.LeftHeader.Text = "" : .FirstPage.CenterHeader.Text = ""
- .FirstPage.RightHeader.Text = "" : .FirstPage.LeftFooter.Text = "" : .FirstPage.CenterFooter.Text = "" : .FirstPage.RightFooter.Text = ""
- End With : myExcel.Application.PrintCommunication = True
- End Sub
- Private Sub AA(ByVal myExcel As Application, ByVal xlSheet As Worksheet)
- xlSheet.Cells.Select()
- With myExcel.Selection.Font : .Name = "微軟正黑體" : .Size = 10 : .Strikethrough = False : .Superscript = False : .Subscript = False : .OutlineFont = False : .Shadow = False
- .Underline = xlUnderlineStyleNone : .ThemeColor = xlThemeColorLight1 : .TintAndShade = 0 : .ThemeFont = xlThemeFontNone : End With
- xlSheet.Columns("A:A").Select : myExcel.Selection.ColumnWidth = 5 : xlSheet.Columns("B:B").Select : myExcel.Selection.ColumnWidth = 25
- xlSheet.Columns("C:C").Select : myExcel.Selection.ColumnWidth = 5 : xlSheet.Columns("D:D").Select : myExcel.Selection.ColumnWidth = 25
- xlSheet.Columns("E:E").Select : myExcel.Selection.ColumnWidth = 5 : xlSheet.Columns("F:F").Select : myExcel.Selection.ColumnWidth = 25
- xlSheet.Columns("G:G").Select : myExcel.Selection.ColumnWidth = 5 : myExcel.ActiveWindow.DisplayGridlines = False
- End Sub
- Private Sub AA1(ByVal myExcel As Application, ByVal xlSheet As Worksheet)
- xlSheet.Cells.Select()
- With myExcel.Selection.Font : .Name = "微軟正黑體" : .Size = 10 : .Strikethrough = False : .Superscript = False : .Subscript = False : .OutlineFont = False : .Shadow = False
- .Underline = xlUnderlineStyleNone : .ThemeColor = xlThemeColorLight1 : .TintAndShade = 0 : .ThemeFont = xlThemeFontNone : End With
- xlSheet.Columns("A:A").Select : myExcel.Selection.ColumnWidth = 5 : xlSheet.Columns("B:B").Select : myExcel.Selection.ColumnWidth = 25
- xlSheet.Columns("C:C").Select : myExcel.Selection.ColumnWidth = 5 : myExcel.ActiveWindow.DisplayGridlines = False
- End Sub
-
- Private Sub 風格()
- If 深色風格 = False Then
- 臨時卡列印_tp.BackColor = SystemColors.Control : 臨時卡激活_tp.BackgroundImage = My.Resources._62951168976601486
- 視窗3_pl.BackColor = SystemColors.Control : Panel4.BackColor = Color.White
-
- 姓名_lb.ForeColor = Color.Black : Label6.ForeColor = Color.Black : Label1.ForeColor = Color.Black : 空白臨時卡_ch.ForeColor = Color.Black
- Label3.ForeColor = Color.Black : Label4.ForeColor = Color.Black : Label5.ForeColor = Color.Black : Label7.ForeColor = Color.Black
- Label2.ForeColor = Color.Black : 已使用的臨時卡_ch.ForeColor = Color.Black
-
- 筆數_tb.BackColor = Color.White : 筆數_tb.ForeColor = Color.Black
- 姓名_tb.BackColor = Color.White : 姓名_tb.ForeColor = Color.Black : ID卡號_tb.BackColor = Color.White : ID卡號_tb.ForeColor = Color.Black
-
- 查詢_bt.BackColor = Color.White : 列印成EXCEL_bt.BackColor = Color.White : 列印成EXCEL1_bt.BackColor = Color.White : 確認新增_bt.BackColor = Color.White
- 確認新增1_bt.BackColor = Color.White
-
- 清單1_dgv.EnableHeadersVisualStyles = True : 清單1_dgv.BackgroundColor = Color.White : 清單1_dgv.ColumnHeadersDefaultCellStyle.ForeColor = Color.Black
- 清單1_dgv.AlternatingRowsDefaultCellStyle.BackColor = Color.LightPink
- 清單1_dgv.DefaultCellStyle.BackColor = Color.White : 清單1_dgv.DefaultCellStyle.ForeColor = Color.Black
- 查詢_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
- 臨時卡列印_tp.BackColor = Color.Black : 臨時卡激活_tp.BackgroundImage = My.Resources._20157059_MotionElements_diagonal_lines
- 視窗3_pl.BackColor = Color.DimGray : Panel4.BackColor = Color.Black
-
- 姓名_lb.ForeColor = Color.White : Label6.ForeColor = Color.White : Label1.ForeColor = Color.White : 空白臨時卡_ch.ForeColor = Color.White
- Label3.ForeColor = Color.White : Label4.ForeColor = Color.White : Label5.ForeColor = Color.White : Label7.ForeColor = Color.White
- Label2.ForeColor = Color.White : 已使用的臨時卡_ch.ForeColor = Color.White
-
- 筆數_tb.BackColor = Color.DimGray : 筆數_tb.ForeColor = Color.White
- 姓名_tb.BackColor = Color.DimGray : 姓名_tb.ForeColor = Color.White : ID卡號_tb.BackColor = Color.DimGray : ID卡號_tb.ForeColor = Color.White
-
- 查詢_bt.BackColor = Color.DimGray : 列印成EXCEL_bt.BackColor = Color.DimGray : 列印成EXCEL1_bt.BackColor = Color.DimGray : 確認新增_bt.BackColor = Color.DimGray
- 確認新增1_bt.BackColor = Color.DimGray
-
- 清單1_dgv.EnableHeadersVisualStyles = False : 清單1_dgv.BackgroundColor = Color.DimGray : 清單1_dgv.ColumnHeadersDefaultCellStyle.ForeColor = Color.White
- 清單1_dgv.ColumnHeadersDefaultCellStyle.BackColor = Color.Black : 清單1_dgv.AlternatingRowsDefaultCellStyle.BackColor = Color.DimGray
- 清單1_dgv.DefaultCellStyle.BackColor = Color.Black : 清單1_dgv.DefaultCellStyle.ForeColor = Color.White
- 查詢_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
|