﻿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 frm5015
    Inherits System.Windows.Forms.Form

    'Private dbClient As BtrieveDbClient
    Private tmpStr As List(Of Dictionary(Of String, String))
    Private affected_rows As Integer
    Public tmpStr_PKCP1 As List(Of Dictionary(Of String, String))

#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 WarpCtrl1 As WarpControl.WarpCtrl
    'Friend WithEvents WarpHWBcr1 As WarpControl.WarpHWBcr
    'Friend WithEvents WarpBox1 As WarpControl.WarpBox
    'Friend WithEvents WarpField1 As WarpControl.WarpField
    'Friend WithEvents WarpFrame1 As WarpControl.WarpFrame
    'Friend WithEvents WarpField5 As WarpControl.WarpField
    'Friend WithEvents WarpField7 As WarpControl.WarpField
    'Friend WithEvents WarpField8 As WarpControl.WarpField
    'Friend WithEvents wfName As WarpControl.WarpField
    'Friend WithEvents WarpField6 As WarpControl.WarpField
    'Friend WithEvents wfPart2 As WarpControl.WarpField
    'Friend WithEvents wfPart3 As WarpControl.WarpField
    'Friend WithEvents wfCL2 As WarpControl.WarpField
    'Friend WithEvents wfCL3 As WarpControl.WarpField
    'Friend WithEvents wfZnc2 As WarpControl.WarpField
    'Friend WithEvents wfZnc3 As WarpControl.WarpField
    'Friend WithEvents wfZnc1 As WarpControl.WarpField
    'Friend WithEvents wfCL1 As WarpControl.WarpField
    'Friend WithEvents wfPart1 As WarpControl.WarpField
    'Friend WithEvents wfInput As WarpControl.WarpField
    'Friend WithEvents wfQty3 As WarpControl.WarpField
    'Friend WithEvents wfQty2 As WarpControl.WarpField
    'Friend WithEvents wfQty1 As WarpControl.WarpField

    '<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
    '    Me.WarpFrame1 = New WarpControl.WarpFrame()
    '    Me.wfInput = New WarpControl.WarpField()
    '    Me.wfQty3 = New WarpControl.WarpField()
    '    Me.wfQty2 = New WarpControl.WarpField()
    '    Me.wfZnc3 = New WarpControl.WarpField()
    '    Me.wfZnc2 = New WarpControl.WarpField()
    '    Me.wfCL3 = New WarpControl.WarpField()
    '    Me.wfCL2 = New WarpControl.WarpField()
    '    Me.wfPart3 = New WarpControl.WarpField()
    '    Me.wfPart2 = New WarpControl.WarpField()
    '    Me.WarpField6 = New WarpControl.WarpField()
    '    Me.wfQty1 = New WarpControl.WarpField()
    '    Me.wfZnc1 = New WarpControl.WarpField()
    '    Me.wfCL1 = New WarpControl.WarpField()
    '    Me.WarpField8 = New WarpControl.WarpField()
    '    Me.WarpField7 = New WarpControl.WarpField()
    '    Me.wfPart1 = New WarpControl.WarpField()
    '    Me.WarpField5 = New WarpControl.WarpField()
    '    Me.WarpField1 = New WarpControl.WarpField()
    '    Me.WarpBox1 = New WarpControl.WarpBox()
    '    Me.wfName = New WarpControl.WarpField()
    '    Me.WarpHWBcr1 = New WarpControl.WarpHWBcr()
    '    Me.WarpFrame1.SuspendLayout()
    '    Me.SuspendLayout()
    '    '
    '    'WarpFrame1
    '    '
    '    Me.WarpFrame1.Controls.Add(Me.wfInput)
    '    Me.WarpFrame1.Controls.Add(Me.wfQty3)
    '    Me.WarpFrame1.Controls.Add(Me.wfQty2)
    '    Me.WarpFrame1.Controls.Add(Me.wfZnc3)
    '    Me.WarpFrame1.Controls.Add(Me.wfZnc2)
    '    Me.WarpFrame1.Controls.Add(Me.wfCL3)
    '    Me.WarpFrame1.Controls.Add(Me.wfCL2)
    '    Me.WarpFrame1.Controls.Add(Me.wfPart3)
    '    Me.WarpFrame1.Controls.Add(Me.wfPart2)
    '    Me.WarpFrame1.Controls.Add(Me.WarpField6)
    '    Me.WarpFrame1.Controls.Add(Me.wfQty1)
    '    Me.WarpFrame1.Controls.Add(Me.wfZnc1)
    '    Me.WarpFrame1.Controls.Add(Me.wfCL1)
    '    Me.WarpFrame1.Controls.Add(Me.WarpField8)
    '    Me.WarpFrame1.Controls.Add(Me.WarpField7)
    '    Me.WarpFrame1.Controls.Add(Me.wfPart1)
    '    Me.WarpFrame1.Controls.Add(Me.WarpField5)
    '    Me.WarpFrame1.Controls.Add(Me.WarpField1)
    '    Me.WarpFrame1.Controls.Add(Me.WarpBox1)
    '    Me.WarpFrame1.Controls.Add(Me.wfName)
    '    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 = ""
    '    '
    '    'wfInput
    '    '
    '    Me.wfInput.BcrFlag = True
    '    Me.wfInput.DecimalPointPosition = CType(0, Short)
    '    Me.wfInput.Font = New System.Drawing.Font("lr SVbN", 16.5!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel)
    '    Me.wfInput.FontSize = WarpControl.FontSizes.Small4
    '    Me.wfInput.Format = ""
    '    Me.wfInput.InputMode.Secret = True
    '    Me.wfInput.Length = CType(1, Short)
    '    Me.wfInput.Location = New System.Drawing.Point(228, 81)
    '    Me.wfInput.MacroBcr = ""
    '    Me.wfInput.MacroIn = ""
    '    Me.wfInput.MacroKey = ""
    '    Me.wfInput.MacroOut = ""
    '    Me.wfInput.Name = "wfInput"
    '    Me.wfInput.Size = New System.Drawing.Size(9, 18)
    '    Me.wfInput.TabIndex = CType(41, Short)
    '    '
    '    'wfQty3
    '    '
    '    Me.wfQty3.BcrFlag = True
    '    Me.wfQty3.DecimalPointPosition = CType(0, Short)
    '    Me.wfQty3.Font = New System.Drawing.Font("lr SVbN", 16.5!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel)
    '    Me.wfQty3.FontSize = WarpControl.FontSizes.Small4
    '    Me.wfQty3.Format = ""
    '    Me.wfQty3.InputMode.Right = True
    '    Me.wfQty3.Length = CType(5, Short)
    '    Me.wfQty3.Location = New System.Drawing.Point(180, 72)
    '    Me.wfQty3.MacroBcr = ""
    '    Me.wfQty3.MacroIn = ""
    '    Me.wfQty3.MacroKey = ""
    '    Me.wfQty3.MacroOut = ""
    '    Me.wfQty3.Name = "wfQty3"
    '    Me.wfQty3.Size = New System.Drawing.Size(45, 18)
    '    Me.wfQty3.TabIndex = CType(38, Short)
    '    Me.wfQty3.Text = "XXXXX"
    '    '
    '    'wfQty2
    '    '
    '    Me.wfQty2.BcrFlag = True
    '    Me.wfQty2.DecimalPointPosition = CType(0, Short)
    '    Me.wfQty2.Font = New System.Drawing.Font("lr SVbN", 16.5!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel)
    '    Me.wfQty2.FontSize = WarpControl.FontSizes.Small4
    '    Me.wfQty2.Format = ""
    '    Me.wfQty2.InputMode.Right = True
    '    Me.wfQty2.Length = CType(5, Short)
    '    Me.wfQty2.Location = New System.Drawing.Point(180, 48)
    '    Me.wfQty2.MacroBcr = ""
    '    Me.wfQty2.MacroIn = ""
    '    Me.wfQty2.MacroKey = ""
    '    Me.wfQty2.MacroOut = ""
    '    Me.wfQty2.Name = "wfQty2"
    '    Me.wfQty2.Size = New System.Drawing.Size(45, 18)
    '    Me.wfQty2.TabIndex = CType(37, Short)
    '    Me.wfQty2.Text = "XXXXX"
    '    '
    '    'wfZnc3
    '    '
    '    Me.wfZnc3.DecimalPointPosition = CType(0, Short)
    '    Me.wfZnc3.Font = New System.Drawing.Font("lr SVbN", 16.5!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel)
    '    Me.wfZnc3.FontSize = WarpControl.FontSizes.Small4
    '    Me.wfZnc3.Format = ""
    '    Me.wfZnc3.Length = CType(1, Short)
    '    Me.wfZnc3.Location = New System.Drawing.Point(157, 72)
    '    Me.wfZnc3.MacroBcr = ""
    '    Me.wfZnc3.MacroIn = ""
    '    Me.wfZnc3.MacroKey = ""
    '    Me.wfZnc3.MacroOut = ""
    '    Me.wfZnc3.Name = "wfZnc3"
    '    Me.wfZnc3.Size = New System.Drawing.Size(9, 18)
    '    Me.wfZnc3.TabIndex = CType(34, Short)
    '    Me.wfZnc3.Text = "X"
    '    '
    '    'wfZnc2
    '    '
    '    Me.wfZnc2.DecimalPointPosition = CType(0, Short)
    '    Me.wfZnc2.Font = New System.Drawing.Font("lr SVbN", 16.5!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel)
    '    Me.wfZnc2.FontSize = WarpControl.FontSizes.Small4
    '    Me.wfZnc2.Format = ""
    '    Me.wfZnc2.Length = CType(1, Short)
    '    Me.wfZnc2.Location = New System.Drawing.Point(157, 48)
    '    Me.wfZnc2.MacroBcr = ""
    '    Me.wfZnc2.MacroIn = ""
    '    Me.wfZnc2.MacroKey = ""
    '    Me.wfZnc2.MacroOut = ""
    '    Me.wfZnc2.Name = "wfZnc2"
    '    Me.wfZnc2.Size = New System.Drawing.Size(9, 18)
    '    Me.wfZnc2.TabIndex = CType(33, Short)
    '    Me.wfZnc2.Text = "X"
    '    '
    '    'wfCL3
    '    '
    '    Me.wfCL3.DecimalPointPosition = CType(0, Short)
    '    Me.wfCL3.Font = New System.Drawing.Font("lr SVbN", 16.5!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel)
    '    Me.wfCL3.FontSize = WarpControl.FontSizes.Small4
    '    Me.wfCL3.Format = ""
    '    Me.wfCL3.Length = CType(2, Short)
    '    Me.wfCL3.Location = New System.Drawing.Point(132, 72)
    '    Me.wfCL3.MacroBcr = ""
    '    Me.wfCL3.MacroIn = ""
    '    Me.wfCL3.MacroKey = ""
    '    Me.wfCL3.MacroOut = ""
    '    Me.wfCL3.Name = "wfCL3"
    '    Me.wfCL3.Size = New System.Drawing.Size(18, 18)
    '    Me.wfCL3.TabIndex = CType(30, Short)
    '    Me.wfCL3.Text = "XX"
    '    '
    '    'wfCL2
    '    '
    '    Me.wfCL2.DecimalPointPosition = CType(0, Short)
    '    Me.wfCL2.Font = New System.Drawing.Font("lr SVbN", 16.5!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel)
    '    Me.wfCL2.FontSize = WarpControl.FontSizes.Small4
    '    Me.wfCL2.Format = ""
    '    Me.wfCL2.Length = CType(2, Short)
    '    Me.wfCL2.Location = New System.Drawing.Point(132, 48)
    '    Me.wfCL2.MacroBcr = ""
    '    Me.wfCL2.MacroIn = ""
    '    Me.wfCL2.MacroKey = ""
    '    Me.wfCL2.MacroOut = ""
    '    Me.wfCL2.Name = "wfCL2"
    '    Me.wfCL2.Size = New System.Drawing.Size(18, 18)
    '    Me.wfCL2.TabIndex = CType(29, Short)
    '    Me.wfCL2.Text = "XX"
    '    '
    '    'wfPart3
    '    '
    '    Me.wfPart3.BcrFlag = True
    '    Me.wfPart3.DecimalPointPosition = CType(0, Short)
    '    Me.wfPart3.Font = New System.Drawing.Font("lr SVbN", 16.5!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel)
    '    Me.wfPart3.FontSize = WarpControl.FontSizes.Small4
    '    Me.wfPart3.Format = ""
    '    Me.wfPart3.Length = CType(12, Short)
    '    Me.wfPart3.Location = New System.Drawing.Point(12, 72)
    '    Me.wfPart3.MacroBcr = ""
    '    Me.wfPart3.MacroIn = ""
    '    Me.wfPart3.MacroKey = ""
    '    Me.wfPart3.MacroOut = ""
    '    Me.wfPart3.Name = "wfPart3"
    '    Me.wfPart3.Size = New System.Drawing.Size(108, 18)
    '    Me.wfPart3.TabIndex = CType(26, Short)
    '    Me.wfPart3.Text = "XXXX-XX-XXXX"
    '    '
    '    'wfPart2
    '    '
    '    Me.wfPart2.BcrFlag = True
    '    Me.wfPart2.DecimalPointPosition = CType(0, Short)
    '    Me.wfPart2.Font = New System.Drawing.Font("lr SVbN", 16.5!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel)
    '    Me.wfPart2.FontSize = WarpControl.FontSizes.Small4
    '    Me.wfPart2.Format = ""
    '    Me.wfPart2.Length = CType(12, Short)
    '    Me.wfPart2.Location = New System.Drawing.Point(12, 48)
    '    Me.wfPart2.MacroBcr = ""
    '    Me.wfPart2.MacroIn = ""
    '    Me.wfPart2.MacroKey = ""
    '    Me.wfPart2.MacroOut = ""
    '    Me.wfPart2.Name = "wfPart2"
    '    Me.wfPart2.Size = New System.Drawing.Size(108, 18)
    '    Me.wfPart2.TabIndex = CType(25, Short)
    '    Me.wfPart2.Text = "XXXX-XX-XXXX"
    '    '
    '    'WarpField6
    '    '
    '    Me.WarpField6.DecimalPointPosition = CType(0, Short)
    '    Me.WarpField6.DisplayAttribute.Bold = True
    '    Me.WarpField6.Font = New System.Drawing.Font("lr SVbN", 16.5!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Pixel)
    '    Me.WarpField6.FontSize = WarpControl.FontSizes.Small4
    '    Me.WarpField6.Format = ""
    '    Me.WarpField6.Length = CType(6, Short)
    '    Me.WarpField6.Location = New System.Drawing.Point(180, 0)
    '    Me.WarpField6.MacroBcr = ""
    '    Me.WarpField6.MacroIn = ""
    '    Me.WarpField6.MacroKey = ""
    '    Me.WarpField6.MacroOut = ""
    '    Me.WarpField6.Name = "WarpField6"
    '    Me.WarpField6.Size = New System.Drawing.Size(54, 18)
    '    Me.WarpField6.TabIndex = CType(17, Short)
    '    Me.WarpField6.Text = "Qty"
    '    '
    '    'wfQty1
    '    '
    '    Me.wfQty1.BcrFlag = True
    '    Me.wfQty1.DecimalPointPosition = CType(0, Short)
    '    Me.wfQty1.Font = New System.Drawing.Font("lr SVbN", 16.5!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel)
    '    Me.wfQty1.FontSize = WarpControl.FontSizes.Small4
    '    Me.wfQty1.Format = ""
    '    Me.wfQty1.InputMode.Right = True
    '    Me.wfQty1.Length = CType(5, Short)
    '    Me.wfQty1.Location = New System.Drawing.Point(180, 24)
    '    Me.wfQty1.MacroBcr = ""
    '    Me.wfQty1.MacroIn = ""
    '    Me.wfQty1.MacroKey = ""
    '    Me.wfQty1.MacroOut = ""
    '    Me.wfQty1.Name = "wfQty1"
    '    Me.wfQty1.Size = New System.Drawing.Size(45, 18)
    '    Me.wfQty1.TabIndex = CType(15, Short)
    '    Me.wfQty1.Text = "XXXXX"
    '    '
    '    'wfZnc1
    '    '
    '    Me.wfZnc1.DecimalPointPosition = CType(0, Short)
    '    Me.wfZnc1.Font = New System.Drawing.Font("lr SVbN", 16.5!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel)
    '    Me.wfZnc1.FontSize = WarpControl.FontSizes.Small4
    '    Me.wfZnc1.Format = ""
    '    Me.wfZnc1.Length = CType(1, Short)
    '    Me.wfZnc1.Location = New System.Drawing.Point(157, 24)
    '    Me.wfZnc1.MacroBcr = ""
    '    Me.wfZnc1.MacroIn = ""
    '    Me.wfZnc1.MacroKey = ""
    '    Me.wfZnc1.MacroOut = ""
    '    Me.wfZnc1.Name = "wfZnc1"
    '    Me.wfZnc1.Size = New System.Drawing.Size(9, 18)
    '    Me.wfZnc1.TabIndex = CType(12, Short)
    '    Me.wfZnc1.Text = "X"
    '    '
    '    'wfCL1
    '    '
    '    Me.wfCL1.DecimalPointPosition = CType(0, Short)
    '    Me.wfCL1.Font = New System.Drawing.Font("lr SVbN", 16.5!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel)
    '    Me.wfCL1.FontSize = WarpControl.FontSizes.Small4
    '    Me.wfCL1.Format = ""
    '    Me.wfCL1.Length = CType(2, Short)
    '    Me.wfCL1.Location = New System.Drawing.Point(132, 24)
    '    Me.wfCL1.MacroBcr = ""
    '    Me.wfCL1.MacroIn = ""
    '    Me.wfCL1.MacroKey = ""
    '    Me.wfCL1.MacroOut = ""
    '    Me.wfCL1.Name = "wfCL1"
    '    Me.wfCL1.Size = New System.Drawing.Size(18, 18)
    '    Me.wfCL1.TabIndex = CType(11, Short)
    '    Me.wfCL1.Text = "XX"
    '    '
    '    'WarpField8
    '    '
    '    Me.WarpField8.DecimalPointPosition = CType(0, Short)
    '    Me.WarpField8.DisplayAttribute.Bold = True
    '    Me.WarpField8.Font = New System.Drawing.Font("lr SVbN", 16.5!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Pixel)
    '    Me.WarpField8.FontSize = WarpControl.FontSizes.Small4
    '    Me.WarpField8.Format = ""
    '    Me.WarpField8.Length = CType(3, Short)
    '    Me.WarpField8.Location = New System.Drawing.Point(148, 0)
    '    Me.WarpField8.MacroBcr = ""
    '    Me.WarpField8.MacroIn = ""
    '    Me.WarpField8.MacroKey = ""
    '    Me.WarpField8.MacroOut = ""
    '    Me.WarpField8.Name = "WarpField8"
    '    Me.WarpField8.Size = New System.Drawing.Size(27, 18)
    '    Me.WarpField8.TabIndex = CType(10, Short)
    '    Me.WarpField8.Text = "Znc"
    '    '
    '    'WarpField7
    '    '
    '    Me.WarpField7.DecimalPointPosition = CType(0, Short)
    '    Me.WarpField7.DisplayAttribute.Bold = True
    '    Me.WarpField7.Font = New System.Drawing.Font("lr SVbN", 16.5!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Pixel)
    '    Me.WarpField7.FontSize = WarpControl.FontSizes.Small4
    '    Me.WarpField7.Format = ""
    '    Me.WarpField7.Length = CType(2, Short)
    '    Me.WarpField7.Location = New System.Drawing.Point(126, 0)
    '    Me.WarpField7.MacroBcr = ""
    '    Me.WarpField7.MacroIn = ""
    '    Me.WarpField7.MacroKey = ""
    '    Me.WarpField7.MacroOut = ""
    '    Me.WarpField7.Name = "WarpField7"
    '    Me.WarpField7.Size = New System.Drawing.Size(18, 18)
    '    Me.WarpField7.TabIndex = CType(9, Short)
    '    Me.WarpField7.Text = "CL"
    '    '
    '    'wfPart1
    '    '
    '    Me.wfPart1.BcrFlag = True
    '    Me.wfPart1.DecimalPointPosition = CType(0, Short)
    '    Me.wfPart1.Font = New System.Drawing.Font("lr SVbN", 16.5!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel)
    '    Me.wfPart1.FontSize = WarpControl.FontSizes.Small4
    '    Me.wfPart1.Format = ""
    '    Me.wfPart1.Length = CType(12, Short)
    '    Me.wfPart1.Location = New System.Drawing.Point(12, 24)
    '    Me.wfPart1.MacroBcr = ""
    '    Me.wfPart1.MacroIn = ""
    '    Me.wfPart1.MacroKey = ""
    '    Me.wfPart1.MacroOut = ""
    '    Me.wfPart1.Name = "wfPart1"
    '    Me.wfPart1.Size = New System.Drawing.Size(108, 18)
    '    Me.wfPart1.TabIndex = CType(8, Short)
    '    Me.wfPart1.Text = "XXXX-XX-XXXX"
    '    '
    '    'WarpField5
    '    '
    '    Me.WarpField5.DecimalPointPosition = CType(0, Short)
    '    Me.WarpField5.DisplayAttribute.Bold = True
    '    Me.WarpField5.Font = New System.Drawing.Font("lr SVbN", 16.5!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Pixel)
    '    Me.WarpField5.FontSize = WarpControl.FontSizes.Small4
    '    Me.WarpField5.Format = ""
    '    Me.WarpField5.Length = CType(7, Short)
    '    Me.WarpField5.Location = New System.Drawing.Point(27, 0)
    '    Me.WarpField5.MacroBcr = ""
    '    Me.WarpField5.MacroIn = ""
    '    Me.WarpField5.MacroKey = ""
    '    Me.WarpField5.MacroOut = ""
    '    Me.WarpField5.Name = "WarpField5"
    '    Me.WarpField5.Size = New System.Drawing.Size(63, 18)
    '    Me.WarpField5.TabIndex = CType(7, Short)
    '    Me.WarpField5.Text = "Part-No"
    '    '
    '    'WarpField1
    '    '
    '    Me.WarpField1.DecimalPointPosition = CType(0, Short)
    '    Me.WarpField1.Font = New System.Drawing.Font("lr SVbN", 22.5!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel)
    '    Me.WarpField1.FontSize = WarpControl.FontSizes.Small2
    '    Me.WarpField1.Format = ""
    '    Me.WarpField1.InputMode.Secret = True
    '    Me.WarpField1.Length = CType(1, Short)
    '    Me.WarpField1.Location = New System.Drawing.Point(228, 0)
    '    Me.WarpField1.MacroBcr = ""
    '    Me.WarpField1.MacroIn = ""
    '    Me.WarpField1.MacroKey = ""
    '    Me.WarpField1.MacroOut = ""
    '    Me.WarpField1.Name = "WarpField1"
    '    Me.WarpField1.Size = New System.Drawing.Size(12, 24)
    '    Me.WarpField1.TabIndex = CType(4, Short)
    '    '
    '    'WarpBox1
    '    '
    '    Me.WarpBox1.BoxType = WarpControl.BoxTypes.Box
    '    Me.WarpBox1.DrawMode = WarpControl.DrawModes.Paint
    '    Me.WarpBox1.Font = New System.Drawing.Font("lr SVbN", 33.5!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel)
    '    Me.WarpBox1.ForeColor = CType(15, Short)
    '    Me.WarpBox1.Image = "C:\H081-0015.jpg"
    '    Me.WarpBox1.Location = New System.Drawing.Point(0, 120)
    '    Me.WarpBox1.Name = "WarpBox1"
    '    Me.WarpBox1.Size = New System.Drawing.Size(240, 90)
    '    Me.WarpBox1.TabIndex = 3
    '    '
    '    'wfName
    '    '
    '    Me.wfName.BcrFlag = True
    '    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, 216)
    '    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(2, Short)
    '    '
    '    'WarpHWBcr1
    '    '
    '    Me.WarpHWBcr1.Decode.Code39 = True
    '    Me.WarpHWBcr1.DiscreteFirstLen = CType(0, Short)
    '    Me.WarpHWBcr1.DiscreteSecondLen = CType(0, Short)
    '    Me.WarpHWBcr1.InterleavedFirstLen = CType(0, Short)
    '    Me.WarpHWBcr1.InterleavedSecondLen = CType(0, Short)
    '    '
    '    'frm5015
    '    '
    '    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 = "frm5015"
    '    Me.Text = "Form1"
    '    Me.WarpFrame1.ResumeLayout(False)
    '    Me.ResumeLayout(False)

    'End Sub

#End Region

    Public Enum M5015_STATUS As Integer
        INIT = 0
        MENUBACK = 1
        NOTCD = 2
        DONE = 3
    End Enum

    Public mint5015status As Integer

    Private Sub frm5015_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
            mint5015status = M5015_STATUS.INIT

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

            sDisp5015()

#If Not Debug Then
            'sSetImgFName(G_CONST_MID_H5015, WarpBox1)
#Else
            'WarpBox1.Text = "€”๕ชลซฝ็ENTL["
#End If
            ' 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
            gintStatus = TR_STATUS.QUIT
            sErrLog(gAppName, "frm5015_Load", ex.ToString)
            Me.Close()
        End Try
    End Sub
    '/*
    '|| ึ”–ผFsDisp5015
    '|| T—v  F5015ๆ–ส•\ฆ
    '*/
    Private Sub sDisp5015()

        sClrAll()

        If gstrctPPDisp.intNumOfPkg - gstrctPPDisp.intNumOfScanned > 0 Then
            With gastrctPPDispPart(0)
                wfPart1.Text = .strPartNoDisp
                wfCL1.Text = .strCL
                wfZnc1.Text = .strZ
                wfQty1.Text = CStr(CInt(.strPackQty))
            End With
        End If
        If gstrctPPDisp.intNumOfPkg - gstrctPPDisp.intNumOfScanned > 1 Then
            With gastrctPPDispPart(1)
                wfPart2.Text = .strPartNoDisp
                wfCL2.Text = .strCL
                wfZnc2.Text = .strZ
                wfQty2.Text = CStr(CInt(.strPackQty))
            End With
        End If
        If gstrctPPDisp.intNumOfPkg - gstrctPPDisp.intNumOfScanned > 2 Then
            With gastrctPPDispPart(2)
                wfPart3.Text = .strPartNoDisp
                wfCL3.Text = .strCL
                wfZnc3.Text = .strZ
                wfQty3.Text = CStr(CInt(.strPackQty))
            End With
        End If

        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(wfInput)

        '        If WKey = WKY_ENT Then

        '            gstrctKDPP.intIndex = 0
        '            If fSearchPackCP(2) = -1 Then
        '                'f0.WarpCtrl1.MessageBox(G_CONST_EMT_DB, G_CONST_EM_DB, MWA_DB_WARNING, MWA_DB_OK)
        '                f0.WarpCtrl1.MessageBox(G_CONST_EMT_DB, fEditErrorInfo(gclsDB.BtriveStatus, gclsDB.ErrFile), MWA_DB_WARNING, MWA_DB_OK)
        '                Exit Do
        '            End If
        '            Select Case fCheckDelivery(1)
        '                Case 0 'fo[–ณต
        '                    gintStatus = TR_STATUS.PART
        '                    Exit Do
        '                Case 1 'fo[ ่
        '                    rtn = fSearchPackCP4Delv()
        '                    Select Case rtn
        '                        Case 0
        '                            gintStatus = TR_STATUS.PART2
        '                            Exit Do
        '                        Case -2
        '                            gintStatus = TR_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
        '            'gintStatus = TR_STATUS.PART
        '            'Exit Do

        '        ElseIf WKey = WKY_BCR Then


        '        ElseIf WKey = WKY_F1 And Not gstrctKDPP.bRetry Then
        '            gintStatus = TR_STATUS.CLABEL
        '            Exit Do

        '        ElseIf WKey = WKY_F2 Then


        '        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
        '    'gintStatus = TR_STATUS.QUIT
        '    sErrLog(gAppName, "sMain", ex.ToString)
        'End Try

    End Sub
    '/*
    '|| ึ”–ผFfProcInput
    '|| T—v  F“—อ—
    '*/
    Private Function fProcInput(ByVal pstrInput As String) As Integer

        fProcInput = -1

        Try

            If pstrInput = "OCMENUBACK" Then             'OCMENUBACKศ็ฮ

                mint5015status = M5015_STATUS.MENUBACK
                fProcInput = 0
                Exit Function

            Else

                mint5015status = M5015_STATUS.NOTCD
                fProcInput = 0
                Exit Function

            End If

            fProcInput = 0

            Exit Function

        Catch ex As Exception
            sErrLog(gAppName, "fProcInput", ex.ToString)
        End Try
    End Function

    '/*
    '|| ึ”–ผFsClrAll
    '|| T—v  Fๆ–สNA
    '*/
    Private Sub sClrAll()

        wfPart1.Text = " "
        wfCL1.Text = " "
        wfZnc1.Text = " "
        wfQty1.Text = " "
        wfPart2.Text = " "
        wfCL2.Text = " "
        wfZnc2.Text = " "
        wfQty2.Text = " "
        wfPart3.Text = " "
        wfCL3.Text = " "
        wfZnc3.Text = " "
        wfQty3.Text = " "

    End Sub

    Private Sub frm5015_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
                If fSearchPackCP(2) = -1 Then
                    'f0.WarpCtrl1.MessageBox(G_CONST_EMT_DB, G_CONST_EM_DB, MWA_DB_WARNING, MWA_DB_OK)
                    '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)

                End If
                Select Case fCheckDelivery(1)
                    Case 0 'fo[–ณต
                        gintStatus = TR_STATUS.PART
                        Me.Close()
                        Exit Sub
                    Case 1 'fo[ ่
                        rtn = fSearchPackCP4Delv()
                        Select Case rtn
                            Case 0
                                gintStatus = TR_STATUS.PART2
                                Me.Close()
                                Exit Sub
                            Case -2
                                gintStatus = TR_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
                Exit Sub
            Case "F1"
                gintStatus = TR_STATUS.CLABEL
                Me.Close()
                Exit Sub
            Case "F2"

                Exit Sub
        End Select
    End Sub
End Class
