﻿Imports System
Imports System.Linq
Imports System.Collections.Generic
Imports System.ComponentModel
Imports System.Data
Imports System.Drawing
Imports System.Text
Imports System.Windows.Forms
Imports System.Runtime.InteropServices
Imports BTClientLib
Imports System.IO
Imports System.Reflection

Public Class frm2020
    Inherits System.Windows.Forms.Form
    'Private dbClient As BtrieveDbClient
    Private tmpStr As List(Of Dictionary(Of String, String))
    Private affected_rows As Integer

#Region " Windows tH[€ fUCiลถฌณ๊ฝR[h "

    Public Sub New()
        MyBase.New()

        ' ฑฬฤัoตอ Windows tH[€ fUCiล•K—vลทB
        InitializeComponent()

        ' InitializeComponent() ฤัoตฬใษ๚ป๐’วมตทB

    End Sub

    ' Form อAR“|[l“g๊——ษใ—๐ภsท้ฝ฿ษ dispose ๐I[o[ChตทB
    'Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
    '    If disposing Then
    '        If Not (components Is Nothing) Then
    '            components.Dispose()
    '        End If
    '    End If
    '    MyBase.Dispose(disposing)
    'End Sub

    ' Windows tH[€ fUCiล•K—vลทB
    'Private components As System.ComponentModel.IContainer

    '  : ศบฬvV[WอAWindows tH[€ fUCiล•K—vลทB
    'Windows tH[€ fUCi๐gมฤ•ฯXตฤญพณขB  
    ' R[h GfB^๐gมฤ•ฯXตศขลญพณขB
    'Friend WithEvents WarpFrame1 As WarpControl.WarpFrame
    'Friend WithEvents WarpField1 As WarpControl.WarpField
    'Friend WithEvents WarpField2 As WarpControl.WarpField
    'Friend WithEvents WarpField5 As WarpControl.WarpField
    'Friend WithEvents WarpField7 As WarpControl.WarpField
    'Friend WithEvents WarpField9 As WarpControl.WarpField
    'Friend WithEvents WarpField10 As WarpControl.WarpField
    'Friend WithEvents WarpField12 As WarpControl.WarpField
    'Friend WithEvents wfName As WarpControl.WarpField
    'Friend WithEvents WarpField14 As WarpControl.WarpField
    'Friend WithEvents WarpField15 As WarpControl.WarpField
    'Friend WithEvents WarpHWBcr1 As WarpControl.WarpHWBcr
    'Friend WithEvents wfCrtnType As WarpControl.WarpField
    'Friend WithEvents wfCrtnTo As WarpControl.WarpField
    'Friend WithEvents wfCrtnFrom As WarpControl.WarpField
    'Friend WithEvents wfKey As WarpControl.WarpField
    'Friend WithEvents wfSeq As WarpControl.WarpField
    'Friend WithEvents wfCaseQty As WarpControl.WarpField
    'Friend WithEvents wfMsc2 As WarpControl.WarpField
    'Friend WithEvents WarpField3 As WarpControl.WarpField
    'Friend WithEvents WarpField6 As WarpControl.WarpField
    'Friend WithEvents wfLine As WarpControl.WarpField
    'Friend WithEvents WarpField8 As WarpControl.WarpField
    'Friend WithEvents WarpField13 As WarpControl.WarpField
    'Friend WithEvents wfCsNo1 As WarpControl.WarpField
    'Friend WithEvents wfTRM As WarpControl.WarpField
    'Friend WithEvents wfPNT As WarpControl.WarpField
    'Friend WithEvents wfMsc1 As WarpControl.WarpField
    'Friend WithEvents WarpField4 As WarpControl.WarpField
    'Friend WithEvents wfCsNo2 As WarpControl.WarpField
    'Friend WithEvents WarpField11 As WarpControl.WarpField
    'Friend WithEvents wfCsNo3 As WarpControl.WarpField
    'Friend WithEvents wfItem As WarpControl.WarpField
    'Friend WithEvents wfPkg As WarpControl.WarpField
    '<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
    '    Me.WarpFrame1 = New WarpControl.WarpFrame()
    '    Me.wfCsNo3 = New WarpControl.WarpField()
    '    Me.WarpField11 = New WarpControl.WarpField()
    '    Me.wfCsNo2 = New WarpControl.WarpField()
    '    Me.WarpField4 = New WarpControl.WarpField()
    '    Me.wfPkg = New WarpControl.WarpField()
    '    Me.WarpField13 = New WarpControl.WarpField()
    '    Me.wfCsNo1 = New WarpControl.WarpField()
    '    Me.WarpField8 = New WarpControl.WarpField()
    '    Me.wfLine = New WarpControl.WarpField()
    '    Me.WarpField6 = New WarpControl.WarpField()
    '    Me.wfTRM = New WarpControl.WarpField()
    '    Me.WarpField3 = New WarpControl.WarpField()
    '    Me.wfMsc2 = New WarpControl.WarpField()
    '    Me.wfKey = New WarpControl.WarpField()
    '    Me.wfCaseQty = New WarpControl.WarpField()
    '    Me.wfCrtnType = New WarpControl.WarpField()
    '    Me.WarpField15 = New WarpControl.WarpField()
    '    Me.WarpField14 = New WarpControl.WarpField()
    '    Me.wfName = New WarpControl.WarpField()
    '    Me.wfCrtnTo = New WarpControl.WarpField()
    '    Me.WarpField12 = New WarpControl.WarpField()
    '    Me.wfCrtnFrom = New WarpControl.WarpField()
    '    Me.WarpField10 = New WarpControl.WarpField()
    '    Me.WarpField9 = New WarpControl.WarpField()
    '    Me.wfPNT = New WarpControl.WarpField()
    '    Me.WarpField7 = New WarpControl.WarpField()
    '    Me.wfMsc1 = New WarpControl.WarpField()
    '    Me.WarpField5 = New WarpControl.WarpField()
    '    Me.wfItem = New WarpControl.WarpField()
    '    Me.wfSeq = New WarpControl.WarpField()
    '    Me.WarpField2 = New WarpControl.WarpField()
    '    Me.WarpField1 = New WarpControl.WarpField()
    '    Me.WarpHWBcr1 = New WarpControl.WarpHWBcr()
    '    Me.WarpFrame1.SuspendLayout()
    '    Me.SuspendLayout()
    '    '
    '    'WarpFrame1
    '    '
    '    Me.WarpFrame1.Controls.Add(Me.wfCsNo3)
    '    Me.WarpFrame1.Controls.Add(Me.WarpField11)
    '    Me.WarpFrame1.Controls.Add(Me.wfCsNo2)
    '    Me.WarpFrame1.Controls.Add(Me.WarpField4)
    '    Me.WarpFrame1.Controls.Add(Me.wfPkg)
    '    Me.WarpFrame1.Controls.Add(Me.WarpField13)
    '    Me.WarpFrame1.Controls.Add(Me.wfCsNo1)
    '    Me.WarpFrame1.Controls.Add(Me.WarpField8)
    '    Me.WarpFrame1.Controls.Add(Me.wfLine)
    '    Me.WarpFrame1.Controls.Add(Me.WarpField6)
    '    Me.WarpFrame1.Controls.Add(Me.wfTRM)
    '    Me.WarpFrame1.Controls.Add(Me.WarpField3)
    '    Me.WarpFrame1.Controls.Add(Me.wfMsc2)
    '    Me.WarpFrame1.Controls.Add(Me.wfKey)
    '    Me.WarpFrame1.Controls.Add(Me.wfCaseQty)
    '    Me.WarpFrame1.Controls.Add(Me.wfCrtnType)
    '    Me.WarpFrame1.Controls.Add(Me.WarpField15)
    '    Me.WarpFrame1.Controls.Add(Me.WarpField14)
    '    Me.WarpFrame1.Controls.Add(Me.wfName)
    '    Me.WarpFrame1.Controls.Add(Me.wfCrtnTo)
    '    Me.WarpFrame1.Controls.Add(Me.WarpField12)
    '    Me.WarpFrame1.Controls.Add(Me.wfCrtnFrom)
    '    Me.WarpFrame1.Controls.Add(Me.WarpField10)
    '    Me.WarpFrame1.Controls.Add(Me.WarpField9)
    '    Me.WarpFrame1.Controls.Add(Me.wfPNT)
    '    Me.WarpFrame1.Controls.Add(Me.WarpField7)
    '    Me.WarpFrame1.Controls.Add(Me.wfMsc1)
    '    Me.WarpFrame1.Controls.Add(Me.WarpField5)
    '    Me.WarpFrame1.Controls.Add(Me.wfItem)
    '    Me.WarpFrame1.Controls.Add(Me.wfSeq)
    '    Me.WarpFrame1.Controls.Add(Me.WarpField2)
    '    Me.WarpFrame1.Controls.Add(Me.WarpField1)
    '    Me.WarpFrame1.Font = New System.Drawing.Font("MS UI Gothic", 9.0!)
    '    Me.WarpFrame1.Location = New System.Drawing.Point(0, 0)
    '    Me.WarpFrame1.Name = "WarpFrame1"
    '    Me.WarpFrame1.Size = New System.Drawing.Size(240, 296)
    '    Me.WarpFrame1.TabIndex = 1
    '    Me.WarpFrame1.Text = "WarpFrame1"
    '    Me.WarpFrame1.UseMacro = False
    '    Me.WarpFrame1.UseMacroFileName = ""
    '    '
    '    'wfCsNo3
    '    '
    '    Me.wfCsNo3.DecimalPointPosition = CType(0, Short)
    '    Me.wfCsNo3.Font = New System.Drawing.Font("lr SVbN", 22.5!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel)
    '    Me.wfCsNo3.FontSize = WarpControl.FontSizes.Small2
    '    Me.wfCsNo3.Format = ""
    '    Me.wfCsNo3.Length = CType(2, Short)
    '    Me.wfCsNo3.Location = New System.Drawing.Point(99, 97)
    '    Me.wfCsNo3.MacroBcr = ""
    '    Me.wfCsNo3.MacroIn = ""
    '    Me.wfCsNo3.MacroKey = ""
    '    Me.wfCsNo3.MacroOut = ""
    '    Me.wfCsNo3.Name = "wfCsNo3"
    '    Me.wfCsNo3.Size = New System.Drawing.Size(24, 24)
    '    Me.wfCsNo3.TabIndex = CType(32, Short)
    '    Me.wfCsNo3.Text = "99"
    '    '
    '    'WarpField11
    '    '
    '    Me.WarpField11.DecimalPointPosition = CType(0, Short)
    '    Me.WarpField11.Font = New System.Drawing.Font("lr SVbN", 22.5!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel)
    '    Me.WarpField11.FontSize = WarpControl.FontSizes.Small2
    '    Me.WarpField11.Format = ""
    '    Me.WarpField11.Length = CType(1, Short)
    '    Me.WarpField11.Location = New System.Drawing.Point(85, 97)
    '    Me.WarpField11.MacroBcr = ""
    '    Me.WarpField11.MacroIn = ""
    '    Me.WarpField11.MacroKey = ""
    '    Me.WarpField11.MacroOut = ""
    '    Me.WarpField11.Name = "WarpField11"
    '    Me.WarpField11.Size = New System.Drawing.Size(12, 24)
    '    Me.WarpField11.TabIndex = CType(31, Short)
    '    Me.WarpField11.Text = "-"
    '    '
    '    'wfCsNo2
    '    '
    '    Me.wfCsNo2.DecimalPointPosition = CType(0, Short)
    '    Me.wfCsNo2.Font = New System.Drawing.Font("lr SVbN", 22.5!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel)
    '    Me.wfCsNo2.FontSize = WarpControl.FontSizes.Small2
    '    Me.wfCsNo2.Format = ""
    '    Me.wfCsNo2.Length = CType(2, Short)
    '    Me.wfCsNo2.Location = New System.Drawing.Point(60, 97)
    '    Me.wfCsNo2.MacroBcr = ""
    '    Me.wfCsNo2.MacroIn = ""
    '    Me.wfCsNo2.MacroKey = ""
    '    Me.wfCsNo2.MacroOut = ""
    '    Me.wfCsNo2.Name = "wfCsNo2"
    '    Me.wfCsNo2.Size = New System.Drawing.Size(24, 24)
    '    Me.wfCsNo2.TabIndex = CType(30, Short)
    '    Me.wfCsNo2.Text = "XX"
    '    '
    '    'WarpField4
    '    '
    '    Me.WarpField4.DecimalPointPosition = CType(0, Short)
    '    Me.WarpField4.Font = New System.Drawing.Font("lr SVbN", 22.5!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel)
    '    Me.WarpField4.FontSize = WarpControl.FontSizes.Small2
    '    Me.WarpField4.Format = ""
    '    Me.WarpField4.Length = CType(1, Short)
    '    Me.WarpField4.Location = New System.Drawing.Point(48, 97)
    '    Me.WarpField4.MacroBcr = ""
    '    Me.WarpField4.MacroIn = ""
    '    Me.WarpField4.MacroKey = ""
    '    Me.WarpField4.MacroOut = ""
    '    Me.WarpField4.Name = "WarpField4"
    '    Me.WarpField4.Size = New System.Drawing.Size(12, 24)
    '    Me.WarpField4.TabIndex = CType(29, Short)
    '    Me.WarpField4.Text = "-"
    '    '
    '    'wfPkg
    '    '
    '    Me.wfPkg.DecimalPointPosition = CType(0, Short)
    '    Me.wfPkg.Font = New System.Drawing.Font("lr SVbN", 22.5!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel)
    '    Me.wfPkg.FontSize = WarpControl.FontSizes.Small2
    '    Me.wfPkg.Format = ""
    '    Me.wfPkg.InputMode.NumericOnly = True
    '    Me.wfPkg.InputMode.Right = True
    '    Me.wfPkg.Length = CType(3, Short)
    '    Me.wfPkg.Location = New System.Drawing.Point(202, 97)
    '    Me.wfPkg.MacroBcr = ""
    '    Me.wfPkg.MacroIn = ""
    '    Me.wfPkg.MacroKey = ""
    '    Me.wfPkg.MacroOut = ""
    '    Me.wfPkg.Name = "wfPkg"
    '    Me.wfPkg.Size = New System.Drawing.Size(36, 24)
    '    Me.wfPkg.TabIndex = CType(28, Short)
    '    Me.wfPkg.Text = "9"
    '    '
    '    'WarpField13
    '    '
    '    Me.WarpField13.DecimalPointPosition = CType(0, Short)
    '    Me.WarpField13.Font = New System.Drawing.Font("lr SVbN", 16.5!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel)
    '    Me.WarpField13.FontSize = WarpControl.FontSizes.Small4
    '    Me.WarpField13.Format = ""
    '    Me.WarpField13.Length = CType(6, Short)
    '    Me.WarpField13.Location = New System.Drawing.Point(138, 78)
    '    Me.WarpField13.MacroBcr = ""
    '    Me.WarpField13.MacroIn = ""
    '    Me.WarpField13.MacroKey = ""
    '    Me.WarpField13.MacroOut = ""
    '    Me.WarpField13.Name = "WarpField13"
    '    Me.WarpField13.Size = New System.Drawing.Size(54, 18)
    '    Me.WarpField13.TabIndex = CType(27, Short)
    '    Me.WarpField13.Text = "#ofPkg"
    '    '
    '    'wfCsNo1
    '    '
    '    Me.wfCsNo1.DecimalPointPosition = CType(0, Short)
    '    Me.wfCsNo1.Font = New System.Drawing.Font("lr SVbN", 22.5!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel)
    '    Me.wfCsNo1.FontSize = WarpControl.FontSizes.Small2
    '    Me.wfCsNo1.Format = ""
    '    Me.wfCsNo1.Length = CType(3, Short)
    '    Me.wfCsNo1.Location = New System.Drawing.Point(12, 97)
    '    Me.wfCsNo1.MacroBcr = ""
    '    Me.wfCsNo1.MacroIn = ""
    '    Me.wfCsNo1.MacroKey = ""
    '    Me.wfCsNo1.MacroOut = ""
    '    Me.wfCsNo1.Name = "wfCsNo1"
    '    Me.wfCsNo1.Size = New System.Drawing.Size(36, 24)
    '    Me.wfCsNo1.TabIndex = CType(26, Short)
    '    Me.wfCsNo1.Text = "999"
    '    '
    '    'WarpField8
    '    '
    '    Me.WarpField8.DecimalPointPosition = CType(0, Short)
    '    Me.WarpField8.Font = New System.Drawing.Font("lr SVbN", 16.5!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel)
    '    Me.WarpField8.FontSize = WarpControl.FontSizes.Small4
    '    Me.WarpField8.Format = ""
    '    Me.WarpField8.Length = CType(7, Short)
    '    Me.WarpField8.Location = New System.Drawing.Point(12, 78)
    '    Me.WarpField8.MacroBcr = ""
    '    Me.WarpField8.MacroIn = ""
    '    Me.WarpField8.MacroKey = ""
    '    Me.WarpField8.MacroOut = ""
    '    Me.WarpField8.Name = "WarpField8"
    '    Me.WarpField8.Size = New System.Drawing.Size(63, 18)
    '    Me.WarpField8.TabIndex = CType(25, Short)
    '    Me.WarpField8.Text = "Case-No"
    '    '
    '    'wfLine
    '    '
    '    Me.wfLine.DecimalPointPosition = CType(0, Short)
    '    Me.wfLine.Font = New System.Drawing.Font("lr SVbN", 28.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel)
    '    Me.wfLine.FontSize = WarpControl.FontSizes.Small
    '    Me.wfLine.Format = ""
    '    Me.wfLine.Length = CType(2, Short)
    '    Me.wfLine.Location = New System.Drawing.Point(115, 201)
    '    Me.wfLine.MacroBcr = ""
    '    Me.wfLine.MacroIn = ""
    '    Me.wfLine.MacroKey = ""
    '    Me.wfLine.MacroOut = ""
    '    Me.wfLine.Name = "wfLine"
    '    Me.wfLine.Size = New System.Drawing.Size(30, 30)
    '    Me.wfLine.TabIndex = CType(24, Short)
    '    Me.wfLine.Text = "XX"
    '    '
    '    'WarpField6
    '    '
    '    Me.WarpField6.DecimalPointPosition = CType(0, Short)
    '    Me.WarpField6.Font = New System.Drawing.Font("lr SVbN", 16.5!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel)
    '    Me.WarpField6.FontSize = WarpControl.FontSizes.Small4
    '    Me.WarpField6.Format = ""
    '    Me.WarpField6.Length = CType(4, Short)
    '    Me.WarpField6.Location = New System.Drawing.Point(112, 181)
    '    Me.WarpField6.MacroBcr = ""
    '    Me.WarpField6.MacroIn = ""
    '    Me.WarpField6.MacroKey = ""
    '    Me.WarpField6.MacroOut = ""
    '    Me.WarpField6.Name = "WarpField6"
    '    Me.WarpField6.Size = New System.Drawing.Size(36, 18)
    '    Me.WarpField6.TabIndex = CType(23, Short)
    '    Me.WarpField6.Text = "Line"
    '    '
    '    'wfTRM
    '    '
    '    Me.wfTRM.DecimalPointPosition = CType(0, Short)
    '    Me.wfTRM.Font = New System.Drawing.Font("lr SVbN", 22.5!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel)
    '    Me.wfTRM.FontSize = WarpControl.FontSizes.Small2
    '    Me.wfTRM.Format = ""
    '    Me.wfTRM.Length = CType(3, Short)
    '    Me.wfTRM.Location = New System.Drawing.Point(196, 52)
    '    Me.wfTRM.MacroBcr = ""
    '    Me.wfTRM.MacroIn = ""
    '    Me.wfTRM.MacroKey = ""
    '    Me.wfTRM.MacroOut = ""
    '    Me.wfTRM.Name = "wfTRM"
    '    Me.wfTRM.Size = New System.Drawing.Size(36, 24)
    '    Me.wfTRM.TabIndex = CType(22, Short)
    '    Me.wfTRM.Text = "XXX"
    '    '
    '    'WarpField3
    '    '
    '    Me.WarpField3.DecimalPointPosition = CType(0, Short)
    '    Me.WarpField3.Font = New System.Drawing.Font("lr SVbN", 16.5!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel)
    '    Me.WarpField3.FontSize = WarpControl.FontSizes.Small4
    '    Me.WarpField3.Format = ""
    '    Me.WarpField3.Length = CType(3, Short)
    '    Me.WarpField3.Location = New System.Drawing.Point(193, 33)
    '    Me.WarpField3.MacroBcr = ""
    '    Me.WarpField3.MacroIn = ""
    '    Me.WarpField3.MacroKey = ""
    '    Me.WarpField3.MacroOut = ""
    '    Me.WarpField3.Name = "WarpField3"
    '    Me.WarpField3.Size = New System.Drawing.Size(27, 18)
    '    Me.WarpField3.TabIndex = CType(21, Short)
    '    Me.WarpField3.Text = "TRM"
    '    '
    '    'wfMsc2
    '    '
    '    Me.wfMsc2.DecimalPointPosition = CType(0, Short)
    '    Me.wfMsc2.Font = New System.Drawing.Font("lr SVbN", 22.5!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel)
    '    Me.wfMsc2.FontSize = WarpControl.FontSizes.Small2
    '    Me.wfMsc2.Format = ""
    '    Me.wfMsc2.Length = CType(3, Short)
    '    Me.wfMsc2.Location = New System.Drawing.Point(96, 52)
    '    Me.wfMsc2.MacroBcr = ""
    '    Me.wfMsc2.MacroIn = ""
    '    Me.wfMsc2.MacroKey = ""
    '    Me.wfMsc2.MacroOut = ""
    '    Me.wfMsc2.Name = "wfMsc2"
    '    Me.wfMsc2.Size = New System.Drawing.Size(36, 24)
    '    Me.wfMsc2.TabIndex = CType(20, Short)
    '    Me.wfMsc2.Text = "XXX"
    '    '
    '    'wfKey
    '    '
    '    Me.wfKey.DecimalPointPosition = CType(0, Short)
    '    Me.wfKey.Font = New System.Drawing.Font("lr SVbN", 33.5!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel)
    '    Me.wfKey.Format = ""
    '    Me.wfKey.InputMode.Secret = True
    '    Me.wfKey.Length = CType(1, Short)
    '    Me.wfKey.Location = New System.Drawing.Point(156, 195)
    '    Me.wfKey.MacroBcr = ""
    '    Me.wfKey.MacroIn = ""
    '    Me.wfKey.MacroKey = ""
    '    Me.wfKey.MacroOut = ""
    '    Me.wfKey.Name = "wfKey"
    '    Me.wfKey.Size = New System.Drawing.Size(18, 36)
    '    Me.wfKey.TabIndex = CType(18, Short)
    '    '
    '    'wfCaseQty
    '    '
    '    Me.wfCaseQty.DecimalPointPosition = CType(0, Short)
    '    Me.wfCaseQty.Font = New System.Drawing.Font("lr SVbN", 28.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel)
    '    Me.wfCaseQty.FontSize = WarpControl.FontSizes.Small
    '    Me.wfCaseQty.Format = ""
    '    Me.wfCaseQty.InputMode.Right = True
    '    Me.wfCaseQty.Length = CType(3, Short)
    '    Me.wfCaseQty.Location = New System.Drawing.Point(193, 201)
    '    Me.wfCaseQty.MacroBcr = ""
    '    Me.wfCaseQty.MacroIn = ""
    '    Me.wfCaseQty.MacroKey = ""
    '    Me.wfCaseQty.MacroOut = ""
    '    Me.wfCaseQty.Name = "wfCaseQty"
    '    Me.wfCaseQty.Size = New System.Drawing.Size(45, 30)
    '    Me.wfCaseQty.TabIndex = CType(17, Short)
    '    Me.wfCaseQty.Text = "ZZ9"
    '    '
    '    'wfCrtnType
    '    '
    '    Me.wfCrtnType.DecimalPointPosition = CType(0, Short)
    '    Me.wfCrtnType.DisplayAttribute.Bold = True
    '    Me.wfCrtnType.Font = New System.Drawing.Font("lr SVbN", 33.5!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Pixel)
    '    Me.wfCrtnType.Format = ""
    '    Me.wfCrtnType.InputAttribute.Bold = True
    '    Me.wfCrtnType.Length = CType(3, Short)
    '    Me.wfCrtnType.Location = New System.Drawing.Point(30, 201)
    '    Me.wfCrtnType.MacroBcr = ""
    '    Me.wfCrtnType.MacroIn = ""
    '    Me.wfCrtnType.MacroKey = ""
    '    Me.wfCrtnType.MacroOut = ""
    '    Me.wfCrtnType.Name = "wfCrtnType"
    '    Me.wfCrtnType.Size = New System.Drawing.Size(54, 36)
    '    Me.wfCrtnType.TabIndex = CType(16, Short)
    '    Me.wfCrtnType.Text = "XXX"
    '    '
    '    'WarpField15
    '    '
    '    Me.WarpField15.DecimalPointPosition = CType(0, Short)
    '    Me.WarpField15.Font = New System.Drawing.Font("lr SVbN", 16.5!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel)
    '    Me.WarpField15.FontSize = WarpControl.FontSizes.Small4
    '    Me.WarpField15.Format = ""
    '    Me.WarpField15.Length = CType(7, Short)
    '    Me.WarpField15.Location = New System.Drawing.Point(174, 181)
    '    Me.WarpField15.MacroBcr = ""
    '    Me.WarpField15.MacroIn = ""
    '    Me.WarpField15.MacroKey = ""
    '    Me.WarpField15.MacroOut = ""
    '    Me.WarpField15.Name = "WarpField15"
    '    Me.WarpField15.Size = New System.Drawing.Size(63, 18)
    '    Me.WarpField15.TabIndex = CType(15, Short)
    '    Me.WarpField15.Text = "#ofCase"
    '    '
    '    'WarpField14
    '    '
    '    Me.WarpField14.DecimalPointPosition = CType(0, Short)
    '    Me.WarpField14.Font = New System.Drawing.Font("lr SVbN", 16.5!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel)
    '    Me.WarpField14.FontSize = WarpControl.FontSizes.Small4
    '    Me.WarpField14.Format = ""
    '    Me.WarpField14.Length = CType(10, Short)
    '    Me.WarpField14.Location = New System.Drawing.Point(12, 181)
    '    Me.WarpField14.MacroBcr = ""
    '    Me.WarpField14.MacroIn = ""
    '    Me.WarpField14.MacroKey = ""
    '    Me.WarpField14.MacroOut = ""
    '    Me.WarpField14.Name = "WarpField14"
    '    Me.WarpField14.Size = New System.Drawing.Size(90, 18)
    '    Me.WarpField14.TabIndex = CType(14, Short)
    '    Me.WarpField14.Text = "CartonType"
    '    '
    '    'wfName
    '    '
    '    Me.wfName.DecimalPointPosition = CType(0, Short)
    '    Me.wfName.Font = New System.Drawing.Font("lr SVbN", 22.5!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel)
    '    Me.wfName.FontSize = WarpControl.FontSizes.Small2
    '    Me.wfName.Format = ""
    '    Me.wfName.Length = CType(20, Short)
    '    Me.wfName.Location = New System.Drawing.Point(0, 234)
    '    Me.wfName.MacroBcr = ""
    '    Me.wfName.MacroIn = ""
    '    Me.wfName.MacroKey = ""
    '    Me.wfName.MacroOut = ""
    '    Me.wfName.Name = "wfName"
    '    Me.wfName.Size = New System.Drawing.Size(240, 24)
    '    Me.wfName.TabIndex = CType(13, Short)
    '    '
    '    'wfCrtnTo
    '    '
    '    Me.wfCrtnTo.DecimalPointPosition = CType(0, Short)
    '    Me.wfCrtnTo.DisplayAttribute.Bold = True
    '    Me.wfCrtnTo.Font = New System.Drawing.Font("lr SVbN", 33.5!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Pixel)
    '    Me.wfCrtnTo.Format = ""
    '    Me.wfCrtnTo.InputAttribute.Bold = True
    '    Me.wfCrtnTo.Length = CType(5, Short)
    '    Me.wfCrtnTo.Location = New System.Drawing.Point(145, 142)
    '    Me.wfCrtnTo.MacroBcr = ""
    '    Me.wfCrtnTo.MacroIn = ""
    '    Me.wfCrtnTo.MacroKey = ""
    '    Me.wfCrtnTo.MacroOut = ""
    '    Me.wfCrtnTo.Name = "wfCrtnTo"
    '    Me.wfCrtnTo.Size = New System.Drawing.Size(90, 36)
    '    Me.wfCrtnTo.TabIndex = CType(12, Short)
    '    Me.wfCrtnTo.Text = "XXXXX"
    '    '
    '    'WarpField12
    '    '
    '    Me.WarpField12.DecimalPointPosition = CType(0, Short)
    '    Me.WarpField12.Font = New System.Drawing.Font("lr SVbN", 33.5!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel)
    '    Me.WarpField12.Format = ""
    '    Me.WarpField12.Length = CType(1, Short)
    '    Me.WarpField12.Location = New System.Drawing.Point(108, 142)
    '    Me.WarpField12.MacroBcr = ""
    '    Me.WarpField12.MacroIn = ""
    '    Me.WarpField12.MacroKey = ""
    '    Me.WarpField12.MacroOut = ""
    '    Me.WarpField12.Name = "WarpField12"
    '    Me.WarpField12.Size = New System.Drawing.Size(18, 36)
    '    Me.WarpField12.TabIndex = CType(11, Short)
    '    Me.WarpField12.Text = "-"
    '    '
    '    'wfCrtnFrom
    '    '
    '    Me.wfCrtnFrom.DecimalPointPosition = CType(0, Short)
    '    Me.wfCrtnFrom.DisplayAttribute.Bold = True
    '    Me.wfCrtnFrom.Font = New System.Drawing.Font("lr SVbN", 33.5!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Pixel)
    '    Me.wfCrtnFrom.Format = ""
    '    Me.wfCrtnFrom.InputAttribute.Bold = True
    '    Me.wfCrtnFrom.Length = CType(5, Short)
    '    Me.wfCrtnFrom.Location = New System.Drawing.Point(6, 142)
    '    Me.wfCrtnFrom.MacroBcr = ""
    '    Me.wfCrtnFrom.MacroIn = ""
    '    Me.wfCrtnFrom.MacroKey = ""
    '    Me.wfCrtnFrom.MacroOut = ""
    '    Me.wfCrtnFrom.Name = "wfCrtnFrom"
    '    Me.wfCrtnFrom.Size = New System.Drawing.Size(90, 36)
    '    Me.wfCrtnFrom.TabIndex = CType(10, Short)
    '    Me.wfCrtnFrom.Text = "XXXXX"
    '    '
    '    'WarpField10
    '    '
    '    Me.WarpField10.DecimalPointPosition = CType(0, Short)
    '    Me.WarpField10.Font = New System.Drawing.Font("lr SVbN", 16.5!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel)
    '    Me.WarpField10.FontSize = WarpControl.FontSizes.Small4
    '    Me.WarpField10.Format = ""
    '    Me.WarpField10.Length = CType(20, Short)
    '    Me.WarpField10.Location = New System.Drawing.Point(7, 123)
    '    Me.WarpField10.MacroBcr = ""
    '    Me.WarpField10.MacroIn = ""
    '    Me.WarpField10.MacroKey = ""
    '    Me.WarpField10.MacroOut = ""
    '    Me.WarpField10.Name = "WarpField10"
    '    Me.WarpField10.Size = New System.Drawing.Size(180, 18)
    '    Me.WarpField10.TabIndex = CType(9, Short)
    '    Me.WarpField10.Text = "CartonNo   from   To"
    '    '
    '    'WarpField9
    '    '
    '    Me.WarpField9.DecimalPointPosition = CType(0, Short)
    '    Me.WarpField9.Font = New System.Drawing.Font("lr SVbN", 16.5!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel)
    '    Me.WarpField9.FontSize = WarpControl.FontSizes.Small4
    '    Me.WarpField9.Format = ""
    '    Me.WarpField9.Length = CType(3, Short)
    '    Me.WarpField9.Location = New System.Drawing.Point(132, 33)
    '    Me.WarpField9.MacroBcr = ""
    '    Me.WarpField9.MacroIn = ""
    '    Me.WarpField9.MacroKey = ""
    '    Me.WarpField9.MacroOut = ""
    '    Me.WarpField9.Name = "WarpField9"
    '    Me.WarpField9.Size = New System.Drawing.Size(27, 18)
    '    Me.WarpField9.TabIndex = CType(8, Short)
    '    Me.WarpField9.Text = "PNT"
    '    '
    '    'wfPNT
    '    '
    '    Me.wfPNT.DecimalPointPosition = CType(0, Short)
    '    Me.wfPNT.Font = New System.Drawing.Font("lr SVbN", 22.5!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel)
    '    Me.wfPNT.FontSize = WarpControl.FontSizes.Small2
    '    Me.wfPNT.Format = ""
    '    Me.wfPNT.Length = CType(3, Short)
    '    Me.wfPNT.Location = New System.Drawing.Point(144, 52)
    '    Me.wfPNT.MacroBcr = ""
    '    Me.wfPNT.MacroIn = ""
    '    Me.wfPNT.MacroKey = ""
    '    Me.wfPNT.MacroOut = ""
    '    Me.wfPNT.Name = "wfPNT"
    '    Me.wfPNT.Size = New System.Drawing.Size(36, 24)
    '    Me.wfPNT.TabIndex = CType(7, Short)
    '    Me.wfPNT.Text = "XXX"
    '    '
    '    'WarpField7
    '    '
    '    Me.WarpField7.DecimalPointPosition = CType(0, Short)
    '    Me.WarpField7.Font = New System.Drawing.Font("lr SVbN", 22.5!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel)
    '    Me.WarpField7.FontSize = WarpControl.FontSizes.Small2
    '    Me.WarpField7.Format = ""
    '    Me.WarpField7.Length = CType(1, Short)
    '    Me.WarpField7.Location = New System.Drawing.Point(72, 52)
    '    Me.WarpField7.MacroBcr = ""
    '    Me.WarpField7.MacroIn = ""
    '    Me.WarpField7.MacroKey = ""
    '    Me.WarpField7.MacroOut = ""
    '    Me.WarpField7.Name = "WarpField7"
    '    Me.WarpField7.Size = New System.Drawing.Size(12, 24)
    '    Me.WarpField7.TabIndex = CType(6, Short)
    '    Me.WarpField7.Text = "-"
    '    '
    '    'wfMsc1
    '    '
    '    Me.wfMsc1.DecimalPointPosition = CType(0, Short)
    '    Me.wfMsc1.Font = New System.Drawing.Font("lr SVbN", 22.5!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel)
    '    Me.wfMsc1.FontSize = WarpControl.FontSizes.Small2
    '    Me.wfMsc1.Format = ""
    '    Me.wfMsc1.Length = CType(4, Short)
    '    Me.wfMsc1.Location = New System.Drawing.Point(24, 52)
    '    Me.wfMsc1.MacroBcr = ""
    '    Me.wfMsc1.MacroIn = ""
    '    Me.wfMsc1.MacroKey = ""
    '    Me.wfMsc1.MacroOut = ""
    '    Me.wfMsc1.Name = "wfMsc1"
    '    Me.wfMsc1.Size = New System.Drawing.Size(48, 24)
    '    Me.wfMsc1.TabIndex = CType(5, Short)
    '    Me.wfMsc1.Text = "XXXX"
    '    '
    '    'WarpField5
    '    '
    '    Me.WarpField5.DecimalPointPosition = CType(0, Short)
    '    Me.WarpField5.Font = New System.Drawing.Font("lr SVbN", 16.5!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel)
    '    Me.WarpField5.FontSize = WarpControl.FontSizes.Small4
    '    Me.WarpField5.Format = ""
    '    Me.WarpField5.Length = CType(3, Short)
    '    Me.WarpField5.Location = New System.Drawing.Point(12, 33)
    '    Me.WarpField5.MacroBcr = ""
    '    Me.WarpField5.MacroIn = ""
    '    Me.WarpField5.MacroKey = ""
    '    Me.WarpField5.MacroOut = ""
    '    Me.WarpField5.Name = "WarpField5"
    '    Me.WarpField5.Size = New System.Drawing.Size(27, 18)
    '    Me.WarpField5.TabIndex = CType(4, Short)
    '    Me.WarpField5.Text = "MSC"
    '    '
    '    'wfItem
    '    '
    '    Me.wfItem.DecimalPointPosition = CType(0, Short)
    '    Me.wfItem.DisplayAttribute.Bold = True
    '    Me.wfItem.Font = New System.Drawing.Font("lr SVbN", 28.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Pixel)
    '    Me.wfItem.FontSize = WarpControl.FontSizes.Small
    '    Me.wfItem.Format = ""
    '    Me.wfItem.InputAttribute.Bold = True
    '    Me.wfItem.InputMode.NumericOnly = True
    '    Me.wfItem.InputMode.Right = True
    '    Me.wfItem.Length = CType(5, Short)
    '    Me.wfItem.Location = New System.Drawing.Point(162, 0)
    '    Me.wfItem.MacroBcr = ""
    '    Me.wfItem.MacroIn = ""
    '    Me.wfItem.MacroKey = ""
    '    Me.wfItem.MacroOut = ""
    '    Me.wfItem.Name = "wfItem"
    '    Me.wfItem.Size = New System.Drawing.Size(75, 30)
    '    Me.wfItem.TabIndex = CType(3, Short)
    '    Me.wfItem.Text = "99999"
    '    '
    '    'wfSeq
    '    '
    '    Me.wfSeq.DecimalPointPosition = CType(0, Short)
    '    Me.wfSeq.DisplayAttribute.Bold = True
    '    Me.wfSeq.Font = New System.Drawing.Font("lr SVbN", 33.5!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Pixel)
    '    Me.wfSeq.Format = ""
    '    Me.wfSeq.InputAttribute.Bold = True
    '    Me.wfSeq.InputMode.Right = True
    '    Me.wfSeq.Length = CType(3, Short)
    '    Me.wfSeq.Location = New System.Drawing.Point(42, 0)
    '    Me.wfSeq.MacroBcr = ""
    '    Me.wfSeq.MacroIn = ""
    '    Me.wfSeq.MacroKey = ""
    '    Me.wfSeq.MacroOut = ""
    '    Me.wfSeq.Name = "wfSeq"
    '    Me.wfSeq.Size = New System.Drawing.Size(54, 36)
    '    Me.wfSeq.TabIndex = CType(2, Short)
    '    Me.wfSeq.Text = "999"
    '    '
    '    'WarpField2
    '    '
    '    Me.WarpField2.DecimalPointPosition = CType(0, Short)
    '    Me.WarpField2.Font = New System.Drawing.Font("lr SVbN", 16.5!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel)
    '    Me.WarpField2.FontSize = WarpControl.FontSizes.Small4
    '    Me.WarpField2.Format = ""
    '    Me.WarpField2.Length = CType(5, Short)
    '    Me.WarpField2.Location = New System.Drawing.Point(114, 0)
    '    Me.WarpField2.MacroBcr = ""
    '    Me.WarpField2.MacroIn = ""
    '    Me.WarpField2.MacroKey = ""
    '    Me.WarpField2.MacroOut = ""
    '    Me.WarpField2.Name = "WarpField2"
    '    Me.WarpField2.Size = New System.Drawing.Size(45, 18)
    '    Me.WarpField2.TabIndex = CType(1, Short)
    '    Me.WarpField2.Text = "Item"
    '    '
    '    'WarpField1
    '    '
    '    Me.WarpField1.DecimalPointPosition = CType(0, Short)
    '    Me.WarpField1.Font = New System.Drawing.Font("lr SVbN", 16.5!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel)
    '    Me.WarpField1.FontSize = WarpControl.FontSizes.Small4
    '    Me.WarpField1.Format = ""
    '    Me.WarpField1.Length = CType(3, Short)
    '    Me.WarpField1.Location = New System.Drawing.Point(0, 0)
    '    Me.WarpField1.MacroBcr = ""
    '    Me.WarpField1.MacroIn = ""
    '    Me.WarpField1.MacroKey = ""
    '    Me.WarpField1.MacroOut = ""
    '    Me.WarpField1.Name = "WarpField1"
    '    Me.WarpField1.Size = New System.Drawing.Size(27, 18)
    '    Me.WarpField1.TabIndex = CType(0, Short)
    '    Me.WarpField1.Text = "Seq"
    '    '
    '    'WarpHWBcr1
    '    '
    '    Me.WarpHWBcr1.DiscreteFirstLen = CType(0, Short)
    '    Me.WarpHWBcr1.DiscreteSecondLen = CType(0, Short)
    '    Me.WarpHWBcr1.InterleavedFirstLen = CType(0, Short)
    '    Me.WarpHWBcr1.InterleavedSecondLen = CType(0, Short)
    '    '
    '    'frm2020
    '    '
    '    Me.AutoScaleBaseSize = New System.Drawing.Size(5, 12)
    '    Me.ClientSize = New System.Drawing.Size(240, 296)
    '    Me.Controls.Add(Me.WarpFrame1)
    '    Me.Font = New System.Drawing.Font("MS UI Gothic", 9.0!)
    '    Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None
    '    Me.Name = "frm2020"
    '    Me.Text = "Form1"
    '    Me.WarpFrame1.ResumeLayout(False)
    '    Me.ResumeLayout(False)

    'End Sub

#End Region

    Public Enum M2020_STATUS As Integer
        INIT = 0
        MENUBACK = 1
        DONE = 2
    End Enum

    Public mint2020status As Integer

    Private Sub fm2020_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load

        '// Case QVGA -> resolution to 1/2
        If System.Windows.Forms.Screen.PrimaryScreen.Bounds.Width = 240 Then
            Call resolution.VGAtoQVGA(Me)
        End If

        Dim wstrImage As String
        Dim rtn As Integer

        Try
            mint2020status = M2020_STATUS.INIT

            't[€ฬI[v“
            'rtn = WarpFrame1.Open
            'If (rtn <> 0) Then
            '    Err.Raise(vbObjectError + 1, gAppName, "WarpError")
            'End If

            sDisp2020()
            ' tH[€EC“ ภs
            sMain()

            ' t[€ฬN[Y
            'rtn = WarpFrame1.Close()
            'If (rtn <> 0) Then
            '    Err.Raise(vbObjectError + 1, gAppName, "WarpError")
            'End If

            ' tH[€EN[Y
            'Me.Close()

            Exit Sub


        Catch ex As Exception
            sErrLog(gAppName, "fm2020_Load", ex.ToString)
        End Try
    End Sub

    '/*
    '|| ึ”–ผFsDisp2020
    '|| T—v  F2020ๆ–ส•\ฆ
    '*/
    Private Sub sDisp2020()
        With gstrctPPDisp
            'wfSeq.Puts(.strSeq)
            'wfItem.Puts(.intNumOfItem)
            'wfPkg.Puts(.intNumOfPkg)
            'wfMsc1.Puts(Mid(.strMsc, 1, 4))
            'wfMsc2.Puts(Mid(.strMsc, 5))
            'wfLine.Puts(.strLine)
            'wfPNT.Puts(.strPNT)
            'wfTRM.Puts(.strTRM)
            'wfCsNo1.Puts(Mid(.strCaseNo, 1, 3))
            'wfCsNo2.Puts(Mid(.strCaseNo, 4, 2))
            'wfCsNo3.Puts(Mid(.strCaseNo, 6))
            'wfCrtnFrom.Puts(.strCrtnFrom)
            'wfCrtnTo.Puts(.strCrtnTo)
            'wfCrtnType.Puts(.strCrtnType)
            'wfCaseQty.Puts(.intNumOfCase)

            wfSeq.Text = .strSeq
            wfItem.Text = .intNumOfItem
            wfPkg.Text = .intNumOfPkg
            wfMsc1.Text = Mid(.strMsc, 1, 4)
            wfMsc2.Text = Mid(.strMsc, 5)
            wfLine.Text = .strLine
            wfPNT.Text = .strPNT
            wfTRM.Text = .strTRM
            wfCsNo1.Text = Mid(.strCaseNo, 1, 3)
            wfCsNo2.Text = Mid(.strCaseNo, 4, 2)
            wfCsNo3.Text = Mid(.strCaseNo, 6)
            wfCrtnFrom.Text = .strCrtnFrom
            wfCrtnTo.Text = .strCrtnTo
            wfCrtnType.Text = .strCrtnType
            wfCaseQty.Text = .intNumOfCase

        End With
        'wfName.Puts(gstrctKDHT.strUserName)

        wfName.Text = gstrctKDHT.strUserName
    End Sub
    ' t[€EC“
    Public Sub sMain()

        'Dim WKey As Short
        'Dim buf As String
        'Dim rtn As Integer


        'Try

        '    ' t[€ฬ—๐ฑฑษLqตทB
        '    Do While (True)

        '        ' R[h“—อ
        '        WKey = WarpFrame1.Input(wfKey)

        '        If WKey = WKY_BCR Then

        '        ElseIf WKey = WKY_PGUP Then

        '        ElseIf WKey = WKY_ENT OrElse WKey = WKY_PGDOWN Then
        '            gstrctKDPP.intIndex = 0
        '            rtn = fSearchPackCP()
        '            Select Case rtn
        '                Case -1
        '                    f0.WarpCtrl1.MessageBox(G_CONST_EMT_DB, fEditErrorInfo(gclsDB.BtriveStatus, gclsDB.ErrFile), MWA_DB_WARNING, MWA_DB_OK)
        '                    gstrctKDPP.intIndex -= 1
        '                    Exit Do
        '                Case 0
        '                    Select Case fCheckDelivery(1)
        '                        Case 0 'fo[–ณต
        '                            gintStatus = PP_STATUS.PART
        '                            Exit Do
        '                        Case 1 'fo[ ่
        '                            rtn = fSearchPackCP4Delv()
        '                            Select Case rtn
        '                                Case 0
        '                                    gintStatus = PP_STATUS.PART2
        '                                    Exit Do
        '                                Case -2
        '                                    gintStatus = PP_STATUS.PRINT4
        '                                    rtn = fClearSKey()
        '                                    If rtn <> 0 Then
        '                                        f0.WarpCtrl1.MessageBox(G_CONST_EMT_DB, G_CONST_EM_DB, MWA_DB_WARNING, MWA_DB_OK)
        '                                    End If
        '                                    Exit Do
        '                            End Select
        '                        Case Else
        '                            f0.WarpCtrl1.MessageBox(G_CONST_EMT_DB, fEditErrorInfo(gclsDB.BtriveStatus, gclsDB.ErrFile), MWA_DB_WARNING, MWA_DB_OK)
        '                            gstrctKDPP.intIndex -= 1
        '                            Exit Do
        '                    End Select
        '            End Select
        '        ElseIf WKey = WKY_ERROR Then

        '            f0.WarpCtrl1.MessageBox(G_CONST_EMT_WARP, G_CONST_EM_WARP, MWA_DB_WARNING, MWA_DB_OK)

        '        End If

        '    Loop

        '    Exit Sub

        'Catch ex As Exception
        '    sErrLog(gAppName, "sMain", ex.ToString)
        'End Try
    End Sub


    Private Sub frm2020_KeyDown(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles MyBase.KeyDown
        Dim rtn As Integer
        Select Case e.KeyCode.ToString()
            Case "Return"
                gstrctKDPP.intIndex = 0
                rtn = fSearchPackCP()
                Select Case rtn
                    Case -1
                        'f0.WarpCtrl1.MessageBox(G_CONST_EMT_DB, fEditErrorInfo(gclsDB.BtriveStatus, gclsDB.ErrFile), MWA_DB_WARNING, MWA_DB_OK)
                        MessageBox.Show(G_CONST_EM_DB, G_CONST_EMT_DB, MessageBoxButtons.OK, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1)

                        gstrctKDPP.intIndex -= 1
                    Case 0
                        Select Case fCheckDelivery(1)
                            Case 0 'fo[–ณต
                                gintStatus = PP_STATUS.PART
                                Me.Close()
                                Exit Sub

                            Case 1 'fo[ ่
                                rtn = fSearchPackCP4Delv()
                                Select Case rtn
                                    Case 0
                                        gintStatus = PP_STATUS.PART2
                                        Me.Close()
                                        Exit Sub
                                    Case -2
                                        gintStatus = PP_STATUS.PRINT4
                                        rtn = fClearSKey()
                                        If rtn <> 0 Then
                                            'f0.WarpCtrl1.MessageBox(G_CONST_EMT_DB, G_CONST_EM_DB, MWA_DB_WARNING, MWA_DB_OK)
                                            MessageBox.Show(G_CONST_EM_DB, G_CONST_EMT_DB, MessageBoxButtons.OK, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1)

                                        End If
                                        Me.Close()
                                        Exit Sub
                                End Select
                            Case Else
                                'f0.WarpCtrl1.MessageBox(G_CONST_EMT_DB, fEditErrorInfo(gclsDB.BtriveStatus, gclsDB.ErrFile), MWA_DB_WARNING, MWA_DB_OK)
                                MessageBox.Show(G_CONST_EM_DB, G_CONST_EMT_DB, MessageBoxButtons.OK, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1)

                                gstrctKDPP.intIndex -= 1
                        End Select
                End Select
                Exit Sub
            Case "F1"
            Case "F2"
                Exit Sub
        End Select
    End Sub

    Private Sub frm2020_Activated(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Activated
        
    End Sub
End Class
