﻿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 frm5E50
    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 WarpCtrl1 As WarpControl.WarpCtrl
    'Friend WithEvents WarpFrame1 As WarpControl.WarpFrame
    'Friend WithEvents WarpHWBcr1 As WarpControl.WarpHWBcr
    'Friend WithEvents WarpBox1 As WarpControl.WarpBox
    'Friend WithEvents wfName As WarpControl.WarpField
    'Friend WithEvents wfInput As WarpControl.WarpField
    'Friend WithEvents WarpField1 As WarpControl.WarpField
    'Friend WithEvents WarpField2 As WarpControl.WarpField
    'Friend WithEvents WarpField3 As WarpControl.WarpField
    'Friend WithEvents WarpField4 As WarpControl.WarpField
    'Friend WithEvents WarpField5 As WarpControl.WarpField
    'Friend WithEvents wfMsc1 As WarpControl.WarpField
    'Friend WithEvents WarpField6 As WarpControl.WarpField
    'Friend WithEvents wfMsc2 As WarpControl.WarpField
    'Friend WithEvents wfLot As WarpControl.WarpField
    'Friend WithEvents wfGr As WarpControl.WarpField
    'Friend WithEvents wfSeq As WarpControl.WarpField
    'Friend WithEvents WarpField10 As WarpControl.WarpField
    'Friend WithEvents WarpField11 As WarpControl.WarpField
    'Friend WithEvents WarpField14 As WarpControl.WarpField
    'Friend WithEvents wfPNT As WarpControl.WarpField
    'Friend WithEvents wfTRM As WarpControl.WarpField
    'Friend WithEvents wfCrtnFrom As WarpControl.WarpField
    'Friend WithEvents wfCrtnTo As WarpControl.WarpField

    '<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
    '    Me.WarpFrame1 = New WarpControl.WarpFrame()
    '    Me.WarpField14 = New WarpControl.WarpField()
    '    Me.wfCrtnTo = New WarpControl.WarpField()
    '    Me.wfCrtnFrom = New WarpControl.WarpField()
    '    Me.WarpField11 = New WarpControl.WarpField()
    '    Me.WarpField10 = New WarpControl.WarpField()
    '    Me.wfSeq = New WarpControl.WarpField()
    '    Me.wfGr = New WarpControl.WarpField()
    '    Me.wfLot = New WarpControl.WarpField()
    '    Me.wfTRM = New WarpControl.WarpField()
    '    Me.wfPNT = New WarpControl.WarpField()
    '    Me.wfMsc2 = New WarpControl.WarpField()
    '    Me.WarpField6 = New WarpControl.WarpField()
    '    Me.wfMsc1 = New WarpControl.WarpField()
    '    Me.WarpField5 = New WarpControl.WarpField()
    '    Me.WarpField4 = New WarpControl.WarpField()
    '    Me.WarpField3 = New WarpControl.WarpField()
    '    Me.WarpField2 = New WarpControl.WarpField()
    '    Me.WarpField1 = New WarpControl.WarpField()
    '    Me.wfInput = 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.WarpField14)
    '    Me.WarpFrame1.Controls.Add(Me.wfCrtnTo)
    '    Me.WarpFrame1.Controls.Add(Me.wfCrtnFrom)
    '    Me.WarpFrame1.Controls.Add(Me.WarpField11)
    '    Me.WarpFrame1.Controls.Add(Me.WarpField10)
    '    Me.WarpFrame1.Controls.Add(Me.wfSeq)
    '    Me.WarpFrame1.Controls.Add(Me.wfGr)
    '    Me.WarpFrame1.Controls.Add(Me.wfLot)
    '    Me.WarpFrame1.Controls.Add(Me.wfTRM)
    '    Me.WarpFrame1.Controls.Add(Me.wfPNT)
    '    Me.WarpFrame1.Controls.Add(Me.wfMsc2)
    '    Me.WarpFrame1.Controls.Add(Me.WarpField6)
    '    Me.WarpFrame1.Controls.Add(Me.wfMsc1)
    '    Me.WarpFrame1.Controls.Add(Me.WarpField5)
    '    Me.WarpFrame1.Controls.Add(Me.WarpField4)
    '    Me.WarpFrame1.Controls.Add(Me.WarpField3)
    '    Me.WarpFrame1.Controls.Add(Me.WarpField2)
    '    Me.WarpFrame1.Controls.Add(Me.WarpField1)
    '    Me.WarpFrame1.Controls.Add(Me.wfInput)
    '    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 = ""
    '    '
    '    'WarpField14
    '    '
    '    Me.WarpField14.BcrFlag = True
    '    Me.WarpField14.DecimalPointPosition = CType(0, Short)
    '    Me.WarpField14.Font = New System.Drawing.Font("lr SVbN", 22.5!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel)
    '    Me.WarpField14.FontSize = WarpControl.FontSizes.Small2
    '    Me.WarpField14.Format = ""
    '    Me.WarpField14.InputAttribute.Reverse = True
    '    Me.WarpField14.InputMode.Clear = True
    '    Me.WarpField14.Length = CType(1, Short)
    '    Me.WarpField14.Location = New System.Drawing.Point(156, 78)
    '    Me.WarpField14.MacroBcr = ""
    '    Me.WarpField14.MacroIn = ""
    '    Me.WarpField14.MacroKey = ""
    '    Me.WarpField14.MacroOut = ""
    '    Me.WarpField14.Name = "WarpField14"
    '    Me.WarpField14.Size = New System.Drawing.Size(12, 24)
    '    Me.WarpField14.TabIndex = CType(22, Short)
    '    Me.WarpField14.Text = "-"
    '    '
    '    'wfCrtnTo
    '    '
    '    Me.wfCrtnTo.BcrFlag = True
    '    Me.wfCrtnTo.DecimalPointPosition = CType(0, Short)
    '    Me.wfCrtnTo.Font = New System.Drawing.Font("lr SVbN", 22.5!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel)
    '    Me.wfCrtnTo.FontSize = WarpControl.FontSizes.Small2
    '    Me.wfCrtnTo.Format = ""
    '    Me.wfCrtnTo.InputAttribute.Reverse = True
    '    Me.wfCrtnTo.InputMode.Clear = True
    '    Me.wfCrtnTo.Length = CType(5, Short)
    '    Me.wfCrtnTo.Location = New System.Drawing.Point(168, 78)
    '    Me.wfCrtnTo.MacroBcr = ""
    '    Me.wfCrtnTo.MacroIn = ""
    '    Me.wfCrtnTo.MacroKey = ""
    '    Me.wfCrtnTo.MacroOut = ""
    '    Me.wfCrtnTo.Name = "wfCrtnTo"
    '    Me.wfCrtnTo.Size = New System.Drawing.Size(60, 24)
    '    Me.wfCrtnTo.TabIndex = CType(21, Short)
    '    Me.wfCrtnTo.Text = "XXXXX"
    '    '
    '    'wfCrtnFrom
    '    '
    '    Me.wfCrtnFrom.BcrFlag = True
    '    Me.wfCrtnFrom.DecimalPointPosition = CType(0, Short)
    '    Me.wfCrtnFrom.Font = New System.Drawing.Font("lr SVbN", 22.5!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel)
    '    Me.wfCrtnFrom.FontSize = WarpControl.FontSizes.Small2
    '    Me.wfCrtnFrom.Format = ""
    '    Me.wfCrtnFrom.InputAttribute.Reverse = True
    '    Me.wfCrtnFrom.InputMode.Clear = True
    '    Me.wfCrtnFrom.Length = CType(5, Short)
    '    Me.wfCrtnFrom.Location = New System.Drawing.Point(96, 78)
    '    Me.wfCrtnFrom.MacroBcr = ""
    '    Me.wfCrtnFrom.MacroIn = ""
    '    Me.wfCrtnFrom.MacroKey = ""
    '    Me.wfCrtnFrom.MacroOut = ""
    '    Me.wfCrtnFrom.Name = "wfCrtnFrom"
    '    Me.wfCrtnFrom.Size = New System.Drawing.Size(60, 24)
    '    Me.wfCrtnFrom.TabIndex = CType(20, Short)
    '    Me.wfCrtnFrom.Text = "XXXXX"
    '    '
    '    'WarpField11
    '    '
    '    Me.WarpField11.BcrFlag = True
    '    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.InputAttribute.Reverse = True
    '    Me.WarpField11.InputMode.Clear = True
    '    Me.WarpField11.Length = CType(1, Short)
    '    Me.WarpField11.Location = New System.Drawing.Point(156, 51)
    '    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(19, Short)
    '    Me.WarpField11.Text = "-"
    '    '
    '    'WarpField10
    '    '
    '    Me.WarpField10.BcrFlag = True
    '    Me.WarpField10.DecimalPointPosition = CType(0, Short)
    '    Me.WarpField10.Font = New System.Drawing.Font("lr SVbN", 22.5!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel)
    '    Me.WarpField10.FontSize = WarpControl.FontSizes.Small2
    '    Me.WarpField10.Format = ""
    '    Me.WarpField10.InputAttribute.Reverse = True
    '    Me.WarpField10.InputMode.Clear = True
    '    Me.WarpField10.Length = CType(1, Short)
    '    Me.WarpField10.Location = New System.Drawing.Point(192, 51)
    '    Me.WarpField10.MacroBcr = ""
    '    Me.WarpField10.MacroIn = ""
    '    Me.WarpField10.MacroKey = ""
    '    Me.WarpField10.MacroOut = ""
    '    Me.WarpField10.Name = "WarpField10"
    '    Me.WarpField10.Size = New System.Drawing.Size(12, 24)
    '    Me.WarpField10.TabIndex = CType(18, Short)
    '    Me.WarpField10.Text = "-"
    '    '
    '    'wfSeq
    '    '
    '    Me.wfSeq.BcrFlag = True
    '    Me.wfSeq.DecimalPointPosition = CType(0, Short)
    '    Me.wfSeq.Font = New System.Drawing.Font("lr SVbN", 22.5!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel)
    '    Me.wfSeq.FontSize = WarpControl.FontSizes.Small2
    '    Me.wfSeq.Format = ""
    '    Me.wfSeq.InputAttribute.Reverse = True
    '    Me.wfSeq.InputMode.Clear = True
    '    Me.wfSeq.Length = CType(2, Short)
    '    Me.wfSeq.Location = New System.Drawing.Point(204, 51)
    '    Me.wfSeq.MacroBcr = ""
    '    Me.wfSeq.MacroIn = ""
    '    Me.wfSeq.MacroKey = ""
    '    Me.wfSeq.MacroOut = ""
    '    Me.wfSeq.Name = "wfSeq"
    '    Me.wfSeq.Size = New System.Drawing.Size(24, 24)
    '    Me.wfSeq.TabIndex = CType(17, Short)
    '    Me.wfSeq.Text = "XX"
    '    '
    '    'wfGr
    '    '
    '    Me.wfGr.BcrFlag = True
    '    Me.wfGr.DecimalPointPosition = CType(0, Short)
    '    Me.wfGr.Font = New System.Drawing.Font("lr SVbN", 22.5!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel)
    '    Me.wfGr.FontSize = WarpControl.FontSizes.Small2
    '    Me.wfGr.Format = ""
    '    Me.wfGr.InputAttribute.Reverse = True
    '    Me.wfGr.InputMode.Clear = True
    '    Me.wfGr.Length = CType(2, Short)
    '    Me.wfGr.Location = New System.Drawing.Point(168, 51)
    '    Me.wfGr.MacroBcr = ""
    '    Me.wfGr.MacroIn = ""
    '    Me.wfGr.MacroKey = ""
    '    Me.wfGr.MacroOut = ""
    '    Me.wfGr.Name = "wfGr"
    '    Me.wfGr.Size = New System.Drawing.Size(24, 24)
    '    Me.wfGr.TabIndex = CType(16, Short)
    '    Me.wfGr.Text = "XX"
    '    '
    '    'wfLot
    '    '
    '    Me.wfLot.BcrFlag = True
    '    Me.wfLot.DecimalPointPosition = CType(0, Short)
    '    Me.wfLot.Font = New System.Drawing.Font("lr SVbN", 22.5!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel)
    '    Me.wfLot.FontSize = WarpControl.FontSizes.Small2
    '    Me.wfLot.Format = ""
    '    Me.wfLot.InputAttribute.Reverse = True
    '    Me.wfLot.InputMode.Clear = True
    '    Me.wfLot.Length = CType(3, Short)
    '    Me.wfLot.Location = New System.Drawing.Point(120, 51)
    '    Me.wfLot.MacroBcr = ""
    '    Me.wfLot.MacroIn = ""
    '    Me.wfLot.MacroKey = ""
    '    Me.wfLot.MacroOut = ""
    '    Me.wfLot.Name = "wfLot"
    '    Me.wfLot.Size = New System.Drawing.Size(36, 24)
    '    Me.wfLot.TabIndex = CType(15, Short)
    '    Me.wfLot.Text = "XXX"
    '    '
    '    'wfTRM
    '    '
    '    Me.wfTRM.BcrFlag = True
    '    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.InputAttribute.Reverse = True
    '    Me.wfTRM.InputMode.Clear = True
    '    Me.wfTRM.Length = CType(3, Short)
    '    Me.wfTRM.Location = New System.Drawing.Point(192, 21)
    '    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(14, Short)
    '    Me.wfTRM.Text = "XXX"
    '    '
    '    'wfPNT
    '    '
    '    Me.wfPNT.BcrFlag = True
    '    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.InputAttribute.Reverse = True
    '    Me.wfPNT.InputMode.Clear = True
    '    Me.wfPNT.Length = CType(3, Short)
    '    Me.wfPNT.Location = New System.Drawing.Point(132, 21)
    '    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(13, Short)
    '    Me.wfPNT.Text = "XXX"
    '    '
    '    'wfMsc2
    '    '
    '    Me.wfMsc2.BcrFlag = True
    '    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.InputAttribute.Reverse = True
    '    Me.wfMsc2.InputMode.Clear = True
    '    Me.wfMsc2.Length = CType(4, Short)
    '    Me.wfMsc2.Location = New System.Drawing.Point(60, 21)
    '    Me.wfMsc2.MacroBcr = ""
    '    Me.wfMsc2.MacroIn = ""
    '    Me.wfMsc2.MacroKey = ""
    '    Me.wfMsc2.MacroOut = ""
    '    Me.wfMsc2.Name = "wfMsc2"
    '    Me.wfMsc2.Size = New System.Drawing.Size(48, 24)
    '    Me.wfMsc2.TabIndex = CType(12, Short)
    '    Me.wfMsc2.Text = "XXXX"
    '    '
    '    'WarpField6
    '    '
    '    Me.WarpField6.BcrFlag = True
    '    Me.WarpField6.DecimalPointPosition = CType(0, Short)
    '    Me.WarpField6.Font = New System.Drawing.Font("lr SVbN", 22.5!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel)
    '    Me.WarpField6.FontSize = WarpControl.FontSizes.Small2
    '    Me.WarpField6.Format = ""
    '    Me.WarpField6.InputAttribute.Reverse = True
    '    Me.WarpField6.InputMode.Clear = True
    '    Me.WarpField6.Length = CType(1, Short)
    '    Me.WarpField6.Location = New System.Drawing.Point(48, 21)
    '    Me.WarpField6.MacroBcr = ""
    '    Me.WarpField6.MacroIn = ""
    '    Me.WarpField6.MacroKey = ""
    '    Me.WarpField6.MacroOut = ""
    '    Me.WarpField6.Name = "WarpField6"
    '    Me.WarpField6.Size = New System.Drawing.Size(12, 24)
    '    Me.WarpField6.TabIndex = CType(11, Short)
    '    Me.WarpField6.Text = "-"
    '    '
    '    'wfMsc1
    '    '
    '    Me.wfMsc1.BcrFlag = True
    '    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.InputAttribute.Reverse = True
    '    Me.wfMsc1.InputMode.Clear = True
    '    Me.wfMsc1.Length = CType(4, Short)
    '    Me.wfMsc1.Location = New System.Drawing.Point(0, 21)
    '    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(10, Short)
    '    Me.wfMsc1.Text = "XXXX"
    '    '
    '    'WarpField5
    '    '
    '    Me.WarpField5.BcrFlag = True
    '    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.InputAttribute.Reverse = True
    '    Me.WarpField5.InputMode.Clear = True
    '    Me.WarpField5.Length = CType(8, Short)
    '    Me.WarpField5.Location = New System.Drawing.Point(0, 84)
    '    Me.WarpField5.MacroBcr = ""
    '    Me.WarpField5.MacroIn = ""
    '    Me.WarpField5.MacroKey = ""
    '    Me.WarpField5.MacroOut = ""
    '    Me.WarpField5.Name = "WarpField5"
    '    Me.WarpField5.Size = New System.Drawing.Size(72, 18)
    '    Me.WarpField5.TabIndex = CType(9, Short)
    '    Me.WarpField5.Text = "CartonNo"
    '    '
    '    'WarpField4
    '    '
    '    Me.WarpField4.BcrFlag = True
    '    Me.WarpField4.DecimalPointPosition = CType(0, Short)
    '    Me.WarpField4.Font = New System.Drawing.Font("lr SVbN", 16.5!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel)
    '    Me.WarpField4.FontSize = WarpControl.FontSizes.Small4
    '    Me.WarpField4.Format = ""
    '    Me.WarpField4.InputAttribute.Reverse = True
    '    Me.WarpField4.InputMode.Clear = True
    '    Me.WarpField4.Length = CType(7, Short)
    '    Me.WarpField4.Location = New System.Drawing.Point(0, 54)
    '    Me.WarpField4.MacroBcr = ""
    '    Me.WarpField4.MacroIn = ""
    '    Me.WarpField4.MacroKey = ""
    '    Me.WarpField4.MacroOut = ""
    '    Me.WarpField4.Name = "WarpField4"
    '    Me.WarpField4.Size = New System.Drawing.Size(63, 18)
    '    Me.WarpField4.TabIndex = CType(8, Short)
    '    Me.WarpField4.Text = "Case-No"
    '    '
    '    'WarpField3
    '    '
    '    Me.WarpField3.BcrFlag = True
    '    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.InputAttribute.Reverse = True
    '    Me.WarpField3.InputMode.Clear = True
    '    Me.WarpField3.Length = CType(3, Short)
    '    Me.WarpField3.Location = New System.Drawing.Point(192, 0)
    '    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(7, Short)
    '    Me.WarpField3.Text = "TRM"
    '    '
    '    'WarpField2
    '    '
    '    Me.WarpField2.BcrFlag = True
    '    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.InputAttribute.Reverse = True
    '    Me.WarpField2.InputMode.Clear = True
    '    Me.WarpField2.Length = CType(3, Short)
    '    Me.WarpField2.Location = New System.Drawing.Point(132, 0)
    '    Me.WarpField2.MacroBcr = ""
    '    Me.WarpField2.MacroIn = ""
    '    Me.WarpField2.MacroKey = ""
    '    Me.WarpField2.MacroOut = ""
    '    Me.WarpField2.Name = "WarpField2"
    '    Me.WarpField2.Size = New System.Drawing.Size(27, 18)
    '    Me.WarpField2.TabIndex = CType(6, Short)
    '    Me.WarpField2.Text = "PNT"
    '    '
    '    'WarpField1
    '    '
    '    Me.WarpField1.BcrFlag = True
    '    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.InputAttribute.Reverse = True
    '    Me.WarpField1.InputMode.Clear = True
    '    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(5, Short)
    '    Me.WarpField1.Text = "MSC"
    '    '
    '    '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(72, 51)
    '    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(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 = ""
    '    Me.WarpBox1.Location = New System.Drawing.Point(0, 108)
    '    Me.WarpBox1.Name = "WarpBox1"
    '    Me.WarpBox1.Size = New System.Drawing.Size(240, 96)
    '    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.UPC_EAN_JAN = 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)
    '    '
    '    'frm5E50
    '    '
    '    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 = "frm5E50"
    '    Me.Text = "Form1"
    '    Me.WarpFrame1.ResumeLayout(False)
    '    Me.ResumeLayout(False)

    'End Sub

#End Region


    Private Sub frm5E50_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

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

            ' 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, "frm5E50_Load", ex.ToString)
            Me.Close()
            Exit Sub
        End Try

    End Sub

    ' t[€EC“
    Public Sub sMain()

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

        'Try

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

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

        '        If WKey = WKY_ENT Then

        '            rtn = fNotPack()
        '            If rtn = -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)
        '                'ElseIf rtn = -2 Then

        '            Else
        '                gintStatus = TR_STATUS.PRINT2
        '                Exit Do
        '            End If

        '        ElseIf WKey = WKY_BCR Then

        '        ElseIf WKey = WKY_F1 Then

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

    End Sub

    '/*
    '|| ึ”–ผFsDisp5E50
    '|| T—v  F5E50ๆ–ส•\ฆ
    '*/
    Private Sub sDisp5E50()

        With gstrctPPDisp
            wfMsc1.Text = Mid(.strMsc, 1, 4)
            wfMsc2.Text = Mid(.strMsc, 5)
            wfPNT.Text = .strPNT
            wfTRM.Text = .strTRM
            wfLot.Text = Mid(.strCaseNo, 1, 3)
            wfGr.Text = Mid(.strCaseNo, 4, 2)
            wfSeq.Text = Mid(.strCaseNo, 6, 2)
            wfCrtnFrom.Text = .strCrtnFrom
            wfCrtnTo.Text = .strCrtnTo
        End With
        wfName.Text = gstrctKDHT.strUserName

    End Sub

    Private Sub frm5E50_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"
                rtn = fNotPack()
                If rtn = -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)
                    'ElseIf rtn = -2 Then
                    MessageBox.Show(G_CONST_EM_DB, G_CONST_EMT_DB, MessageBoxButtons.OK, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1)

                Else
                    gintStatus = TR_STATUS.PRINT2
                    Me.Close()
                End If
                Exit Sub
            Case "F1"
                gintStatus = TR_STATUS.PART
                Me.Close()
                Exit Sub
            Case "F2"
        End Select
    End Sub
End Class
