VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.1#0"; "mscomctl.OCX"
Object = "{5E9E78A0-531B-11CF-91F6-C2863C385E30}#1.0#0"; "MSFlxGrd.ocx"
Begin VB.UserControl DPC_Config 
   ClientHeight    =   11085
   ClientLeft      =   0
   ClientTop       =   0
   ClientWidth     =   17985
   ScaleHeight     =   11085
   ScaleWidth      =   17985
   Tag             =   "DPC_Config"
   Begin VB.Frame fra_Step 
      Height          =   1065
      Index           =   0
      Left            =   510
      TabIndex        =   462
      Tag             =   "fra_Panel"
      Top             =   525
      Visible         =   0   'False
      Width           =   2130
      Begin VB.CheckBox chk_ASFlag 
         Caption         =   "#AS Item"
         Height          =   405
         Left            =   9660
         TabIndex        =   669
         Tag             =   "chk_ASFlag"
         Top             =   900
         Width           =   1590
      End
      Begin Project1.A_calocx cal_WishDate 
         Height          =   360
         Left            =   13005
         TabIndex        =   10
         Top             =   180
         Width           =   1845
         _ExtentX        =   3254
         _ExtentY        =   635
      End
      Begin Project1.A_calocx cal_DeliveryDate 
         Height          =   360
         Left            =   13005
         TabIndex        =   12
         Top             =   900
         Width           =   1845
         _ExtentX        =   3254
         _ExtentY        =   635
      End
      Begin VB.Frame fra_Image 
         Height          =   4920
         Left            =   60
         TabIndex        =   561
         Tag             =   "fra_Image"
         Top             =   1245
         Width           =   14970
         Begin VB.TextBox txt_Textbox 
            Height          =   900
            Index           =   41
            Left            =   990
            MaxLength       =   250
            MultiLine       =   -1  'True
            ScrollBars      =   2  'Vertical
            TabIndex        =   668
            Tag             =   "PRD_InternalComment"
            Top             =   2115
            Width           =   3870
         End
         Begin VB.TextBox txt_Textbox 
            Height          =   900
            Index           =   146
            Left            =   975
            MaxLength       =   250
            MultiLine       =   -1  'True
            ScrollBars      =   2  'Vertical
            TabIndex        =   582
            Tag             =   "PRD_OfferComment"
            Top             =   1020
            Width           =   3870
         End
         Begin VB.CommandButton btn_ImageQuit 
            Height          =   612
            Left            =   14400
            Style           =   1  'Graphical
            TabIndex        =   563
            Tag             =   "btn_ImageQuit"
            Top             =   9240
            Width           =   612
         End
         Begin VB.PictureBox pct_Image 
            Appearance      =   0  'Flat
            AutoRedraw      =   -1  'True
            BackColor       =   &H80000005&
            ForeColor       =   &H80000008&
            Height          =   3180
            Left            =   5865
            ScaleHeight     =   3150
            ScaleWidth      =   6780
            TabIndex        =   562
            Top             =   945
            Width           =   6810
         End
         Begin MSComctlLib.TabStrip tbs_Image 
            Height          =   375
            Left            =   75
            TabIndex        =   20
            Tag             =   "tbs_Image"
            Top             =   150
            Width           =   14940
            _ExtentX        =   26353
            _ExtentY        =   661
            _Version        =   393216
            BeginProperty Tabs {1EFB6598-857C-11D1-B16A-00C0F0283628} 
               NumTabs         =   6
               BeginProperty Tab1 {1EFB659A-857C-11D1-B16A-00C0F0283628} 
                  Caption         =   "#Unscaled Visual Sketch"
                  Key             =   "tab_ImageDrawing"
                  Object.Tag             =   "tab_ImageDrawing"
                  ImageVarType    =   2
               EndProperty
               BeginProperty Tab2 {1EFB659A-857C-11D1-B16A-00C0F0283628} 
                  Caption         =   "#Ceilings Layout Sketch"
                  Key             =   "tab_ImageSketch"
                  Object.Tag             =   "tab_ImageSketch"
                  ImageVarType    =   2
               EndProperty
               BeginProperty Tab3 {1EFB659A-857C-11D1-B16A-00C0F0283628} 
                  Caption         =   "#Panel"
                  Key             =   "tab_ImagePanel"
                  Object.Tag             =   "tab_ImagePanel"
                  ImageVarType    =   2
               EndProperty
               BeginProperty Tab4 {1EFB659A-857C-11D1-B16A-00C0F0283628} 
                  Caption         =   "#System"
                  Key             =   "tab_ImageSystem"
                  Object.Tag             =   "tab_ImageSystem"
                  ImageVarType    =   2
               EndProperty
               BeginProperty Tab5 {1EFB659A-857C-11D1-B16A-00C0F0283628} 
                  Caption         =   "#Offer Comment"
                  Key             =   "tab_OfferComment"
                  Object.Tag             =   "tab_OfferComment"
                  ImageVarType    =   2
               EndProperty
               BeginProperty Tab6 {1EFB659A-857C-11D1-B16A-00C0F0283628} 
                  Caption         =   "#Internal comment"
                  Key             =   "tab_InternalComment"
                  Object.Tag             =   "tab_InternalComment"
                  ImageVarType    =   2
               EndProperty
            EndProperty
         End
      End
      Begin VB.Frame fra_PriceMatrix 
         Height          =   630
         Left            =   15495
         TabIndex        =   463
         Tag             =   "fra_PriceMatrix"
         Top             =   540
         Visible         =   0   'False
         Width           =   960
         Begin VB.CommandButton btn_PriceMatrixQuit 
            Height          =   612
            Left            =   2835
            Style           =   1  'Graphical
            TabIndex        =   464
            Tag             =   "btn_PriceMatrixQuit"
            Top             =   2295
            Width           =   612
         End
         Begin MSFlexGridLib.MSFlexGrid grd_PriceMatrix 
            Height          =   2115
            Left            =   60
            TabIndex        =   465
            Top             =   150
            Width           =   3420
            _ExtentX        =   6033
            _ExtentY        =   3731
            _Version        =   393216
            Cols            =   3
            BackColorFixed  =   12632256
            ScrollTrack     =   -1  'True
            AllowUserResizing=   1
            BorderStyle     =   0
            Appearance      =   0
         End
      End
      Begin VB.TextBox txt_Textbox 
         BackColor       =   &H8000000F&
         Height          =   330
         Index           =   24
         Left            =   8775
         Locked          =   -1  'True
         TabIndex        =   21
         TabStop         =   0   'False
         Tag             =   "RPL_PU"
         Top             =   930
         Width           =   780
      End
      Begin VB.TextBox txt_Textbox 
         Alignment       =   1  'Right Justify
         Height          =   330
         Index           =   3
         Left            =   1590
         TabIndex        =   6
         Tag             =   "PanelQtyM2"
         Top             =   540
         Width           =   1170
      End
      Begin VB.Frame fra_Dimension 
         Caption         =   "#Dimension"
         Height          =   2685
         Left            =   75
         TabIndex        =   469
         Tag             =   "fra_PanelDimension"
         Top             =   6135
         Width           =   14955
         Begin VB.TextBox txt_Textbox 
            Alignment       =   1  'Right Justify
            Height          =   330
            Index           =   106
            Left            =   4485
            TabIndex        =   18
            Tag             =   "RPL_BaeType"
            Top             =   1095
            Visible         =   0   'False
            Width           =   780
         End
         Begin VB.TextBox txt_Textbox 
            Alignment       =   1  'Right Justify
            Height          =   330
            Index           =   6
            Left            =   1890
            TabIndex        =   13
            Tag             =   "RPL_ModA"
            Top             =   315
            Width           =   780
         End
         Begin VB.TextBox txt_Textbox 
            Alignment       =   1  'Right Justify
            Height          =   330
            Index           =   7
            Left            =   4500
            TabIndex        =   14
            Tag             =   "RPL_ModB"
            Top             =   315
            Width           =   780
         End
         Begin VB.TextBox txt_Textbox 
            Alignment       =   1  'Right Justify
            Height          =   330
            Index           =   9
            Left            =   1890
            TabIndex        =   15
            Tag             =   "RPL_PanA"
            Top             =   705
            Width           =   780
         End
         Begin VB.TextBox txt_Textbox 
            Alignment       =   1  'Right Justify
            Height          =   330
            Index           =   10
            Left            =   4500
            TabIndex        =   16
            Tag             =   "RPL_PanB"
            Top             =   705
            Width           =   780
         End
         Begin VB.TextBox txt_Textbox 
            Alignment       =   1  'Right Justify
            Height          =   330
            Index           =   23
            Left            =   1890
            TabIndex        =   17
            Tag             =   "PanelPerMod"
            Top             =   1080
            Width           =   780
         End
         Begin VB.Frame fra_Material 
            Height          =   675
            Left            =   75
            TabIndex        =   475
            Tag             =   "fra_PanelMaterial"
            Top             =   1935
            Width           =   9480
            Begin VB.CheckBox chk_StandardMaterial 
               Caption         =   "#Standard"
               Height          =   225
               Left            =   315
               TabIndex        =   26
               Tag             =   "chk_StandardMaterial"
               Top             =   30
               Width           =   2490
            End
            Begin Project1.ArmCombobox cbo_Thickness 
               Height          =   345
               Left            =   6960
               TabIndex        =   28
               Top             =   255
               Width           =   1170
               _ExtentX        =   2064
               _ExtentY        =   609
            End
            Begin Project1.ArmCombobox cbo_Material 
               Height          =   345
               Left            =   1410
               TabIndex        =   27
               Top             =   255
               Width           =   3885
               _ExtentX        =   6853
               _ExtentY        =   609
            End
            Begin VB.Label lbl_Label 
               Caption         =   "#Material"
               BeginProperty Font 
                  Name            =   "Arial"
                  Size            =   8.25
                  Charset         =   238
                  Weight          =   700
                  Underline       =   0   'False
                  Italic          =   0   'False
                  Strikethrough   =   0   'False
               EndProperty
               Height          =   285
               Index           =   69
               Left            =   165
               TabIndex        =   477
               Tag             =   "lbl_Material"
               Top             =   345
               Width           =   1215
            End
            Begin VB.Label lbl_Label 
               Caption         =   "#Thickness [mm]"
               BeginProperty Font 
                  Name            =   "Arial"
                  Size            =   8.25
                  Charset         =   238
                  Weight          =   700
                  Underline       =   0   'False
                  Italic          =   0   'False
                  Strikethrough   =   0   'False
               EndProperty
               Height          =   255
               Index           =   10
               Left            =   5400
               TabIndex        =   476
               Tag             =   "lbl_Thickness"
               Top             =   345
               Width           =   1470
            End
         End
         Begin VB.TextBox txt_Textbox 
            Alignment       =   1  'Right Justify
            Height          =   330
            Index           =   46
            Left            =   5700
            TabIndex        =   471
            Tag             =   "DefaultGap"
            Top             =   510
            Visible         =   0   'False
            Width           =   780
         End
         Begin VB.CheckBox chk_StandardGap 
            Caption         =   "#Standard gap [mm]"
            Height          =   195
            Left            =   5730
            TabIndex        =   470
            Tag             =   "chk_StandardGap"
            Top             =   150
            Width           =   2685
         End
         Begin VB.Frame fra_StandardGap 
            Height          =   1695
            Left            =   5415
            TabIndex        =   472
            Tag             =   "fra_StandardGap"
            Top             =   135
            Width           =   4140
            Begin VB.TextBox txt_Textbox 
               Alignment       =   1  'Right Justify
               Height          =   330
               Index           =   45
               Left            =   285
               TabIndex        =   24
               Tag             =   "RPL_GapE"
               Top             =   795
               Width           =   780
            End
            Begin VB.TextBox txt_Textbox 
               Alignment       =   1  'Right Justify
               Height          =   330
               Index           =   44
               Left            =   3120
               TabIndex        =   25
               Tag             =   "RPL_GapF"
               Top             =   780
               Width           =   780
            End
            Begin VB.TextBox txt_Textbox 
               Alignment       =   1  'Right Justify
               Height          =   330
               Index           =   43
               Left            =   1695
               TabIndex        =   23
               Tag             =   "RPL_GapD"
               Top             =   1290
               Width           =   780
            End
            Begin VB.TextBox txt_Textbox 
               Alignment       =   1  'Right Justify
               Height          =   330
               Index           =   42
               Left            =   1695
               TabIndex        =   22
               Tag             =   "RPL_GapC"
               Top             =   240
               Width           =   780
            End
            Begin VB.Label lbl_Label 
               BackColor       =   &H00FFFFFF&
               Caption         =   "D"
               BeginProperty Font 
                  Name            =   "Arial"
                  Size            =   8.25
                  Charset         =   238
                  Weight          =   700
                  Underline       =   0   'False
                  Italic          =   0   'False
                  Strikethrough   =   0   'False
               EndProperty
               Height          =   255
               Index           =   166
               Left            =   1995
               TabIndex        =   556
               Tag             =   "_lbl_Side"
               Top             =   945
               Width           =   360
            End
            Begin VB.Label lbl_Label 
               BackColor       =   &H00FFFFFF&
               Caption         =   "C"
               BeginProperty Font 
                  Name            =   "Arial"
                  Size            =   8.25
                  Charset         =   238
                  Weight          =   700
                  Underline       =   0   'False
                  Italic          =   0   'False
                  Strikethrough   =   0   'False
               EndProperty
               Height          =   255
               Index           =   165
               Left            =   1995
               TabIndex        =   576
               Tag             =   "_lbl_Side"
               Top             =   645
               Width           =   360
            End
            Begin VB.Label lbl_Label 
               BackColor       =   &H00FFFFFF&
               Caption         =   "E"
               BeginProperty Font 
                  Name            =   "Arial"
                  Size            =   8.25
                  Charset         =   238
                  Weight          =   700
                  Underline       =   0   'False
                  Italic          =   0   'False
                  Strikethrough   =   0   'False
               EndProperty
               Height          =   255
               Index           =   167
               Left            =   1350
               TabIndex        =   474
               Tag             =   "_lbl_Side"
               Top             =   795
               Width           =   360
            End
            Begin VB.Label lbl_Label 
               BackColor       =   &H00FFFFFF&
               Caption         =   "F"
               BeginProperty Font 
                  Name            =   "Arial"
                  Size            =   8.25
                  Charset         =   238
                  Weight          =   700
                  Underline       =   0   'False
                  Italic          =   0   'False
                  Strikethrough   =   0   'False
               EndProperty
               Height          =   255
               Index           =   168
               Left            =   2625
               TabIndex        =   473
               Tag             =   "_lbl_Side"
               Top             =   795
               Width           =   225
            End
            Begin VB.Shape Shape4 
               BackStyle       =   1  'Opaque
               BorderWidth     =   2
               Height          =   630
               Left            =   1275
               Top             =   615
               Width           =   1665
            End
         End
         Begin VB.Frame fra_Price 
            Height          =   2475
            Index           =   0
            Left            =   9630
            TabIndex        =   478
            Tag             =   "fra_PanelPrice"
            Top             =   135
            Width           =   5250
            Begin VB.TextBox txt_Price 
               Alignment       =   1  'Right Justify
               BackColor       =   &H8000000F&
               Height          =   330
               Index           =   13
               Left            =   3645
               Locked          =   -1  'True
               TabIndex        =   34
               TabStop         =   0   'False
               Tag             =   "txt_PanelPricePU_M"
               Top             =   1050
               Width           =   720
            End
            Begin VB.TextBox txt_Price 
               Alignment       =   1  'Right Justify
               BackColor       =   &H8000000F&
               Height          =   330
               Index           =   4
               Left            =   2925
               Locked          =   -1  'True
               TabIndex        =   33
               TabStop         =   0   'False
               Tag             =   "txt_PanelPricePU_A"
               Top             =   1050
               Width           =   720
            End
            Begin VB.TextBox txt_Price 
               Alignment       =   1  'Right Justify
               BackColor       =   &H8000000F&
               Height          =   330
               Index           =   3
               Left            =   2925
               Locked          =   -1  'True
               TabIndex        =   31
               TabStop         =   0   'False
               Tag             =   "txt_PanelPricePCS_A"
               Top             =   720
               Width           =   720
            End
            Begin VB.TextBox txt_Price 
               Alignment       =   1  'Right Justify
               BackColor       =   &H8000000F&
               Height          =   330
               Index           =   2
               Left            =   2925
               Locked          =   -1  'True
               TabIndex        =   29
               TabStop         =   0   'False
               Tag             =   "txt_PanelPriceM2_A"
               Top             =   390
               Width           =   720
            End
            Begin VB.TextBox txt_Price 
               Alignment       =   1  'Right Justify
               BackColor       =   &H8000000F&
               Height          =   330
               Index           =   11
               Left            =   3645
               Locked          =   -1  'True
               TabIndex        =   30
               TabStop         =   0   'False
               Tag             =   "txt_PanelPriceM2_M"
               Top             =   390
               Width           =   720
            End
            Begin VB.TextBox txt_Price 
               Alignment       =   1  'Right Justify
               BackColor       =   &H8000000F&
               Height          =   330
               Index           =   12
               Left            =   3645
               Locked          =   -1  'True
               TabIndex        =   32
               TabStop         =   0   'False
               Tag             =   "txt_PanelPricePCS_M"
               Top             =   720
               Width           =   720
            End
            Begin VB.CommandButton btn_PriceMatrix 
               Caption         =   "..."
               Height          =   360
               Left            =   4875
               TabIndex        =   479
               Tag             =   "btn_PriceMatrix"
               Top             =   330
               Width           =   360
            End
            Begin VB.Frame fra_PanelSetupUNP 
               BorderStyle     =   0  'None
               Height          =   1035
               Left            =   60
               TabIndex        =   624
               Tag             =   "fra_PanelSetupUNP"
               Top             =   1395
               Width           =   5115
               Begin VB.TextBox txt_Price 
                  Alignment       =   1  'Right Justify
                  BackColor       =   &H8000000F&
                  Height          =   330
                  Index           =   57
                  Left            =   2865
                  Locked          =   -1  'True
                  TabIndex        =   633
                  TabStop         =   0   'False
                  Tag             =   "txt_PanelChangeBUNP_A"
                  Top             =   675
                  Visible         =   0   'False
                  Width           =   720
               End
               Begin VB.TextBox txt_Price 
                  Alignment       =   1  'Right Justify
                  BackColor       =   &H8000000F&
                  Height          =   330
                  Index           =   56
                  Left            =   2865
                  Locked          =   -1  'True
                  TabIndex        =   632
                  TabStop         =   0   'False
                  Tag             =   "txt_PanelChangeAUNP_A"
                  Top             =   345
                  Visible         =   0   'False
                  Width           =   720
               End
               Begin VB.TextBox txt_Price 
                  Alignment       =   1  'Right Justify
                  BackColor       =   &H8000000F&
                  Height          =   330
                  Index           =   53
                  Left            =   2865
                  Locked          =   -1  'True
                  TabIndex        =   631
                  TabStop         =   0   'False
                  Tag             =   "txt_PanelSetupChargeUNP_A"
                  Top             =   15
                  Width           =   720
               End
               Begin VB.CheckBox chk_Price 
                  Caption         =   "#Change of width position"
                  Height          =   375
                  Index           =   12
                  Left            =   0
                  TabIndex        =   625
                  Tag             =   "chk_PanelChangeBUNP"
                  Top             =   690
                  Width           =   2925
               End
               Begin VB.CheckBox chk_Price 
                  Caption         =   "#Change of length position"
                  Height          =   375
                  Index           =   13
                  Left            =   0
                  TabIndex        =   626
                  Tag             =   "chk_PanelChangeAUNP"
                  Top             =   375
                  Width           =   2925
               End
               Begin VB.CheckBox chk_Price 
                  Caption         =   "#Setup charge per call"
                  Height          =   375
                  Index           =   14
                  Left            =   0
                  TabIndex        =   627
                  Tag             =   "chk_PanelSetupChargeUNP"
                  Top             =   45
                  Width           =   2925
               End
               Begin VB.TextBox txt_Price 
                  Alignment       =   1  'Right Justify
                  BackColor       =   &H8000000F&
                  Height          =   330
                  Index           =   52
                  Left            =   3585
                  Locked          =   -1  'True
                  TabIndex        =   630
                  TabStop         =   0   'False
                  Tag             =   "txt_PanelSetupChargeUNP_M"
                  Top             =   15
                  Width           =   720
               End
               Begin VB.TextBox txt_Price 
                  Alignment       =   1  'Right Justify
                  BackColor       =   &H8000000F&
                  Height          =   330
                  Index           =   51
                  Left            =   3585
                  Locked          =   -1  'True
                  TabIndex        =   629
                  TabStop         =   0   'False
                  Tag             =   "txt_PanelChangeAUNP_M"
                  Top             =   345
                  Visible         =   0   'False
                  Width           =   720
               End
               Begin VB.TextBox txt_Price 
                  Alignment       =   1  'Right Justify
                  BackColor       =   &H8000000F&
                  Height          =   330
                  Index           =   50
                  Left            =   3585
                  Locked          =   -1  'True
                  TabIndex        =   628
                  TabStop         =   0   'False
                  Tag             =   "txt_PanelChangeBUNP_M"
                  Top             =   675
                  Visible         =   0   'False
                  Width           =   720
               End
               Begin VB.Label lbl_Price 
                  Alignment       =   2  'Center
                  Caption         =   "#Curr"
                  Height          =   240
                  Index           =   29
                  Left            =   4365
                  TabIndex        =   636
                  Tag             =   "_lbl_CURR_PanelSetupChargeUnp"
                  Top             =   45
                  Width           =   435
               End
               Begin VB.Label lbl_Price 
                  Alignment       =   2  'Center
                  Caption         =   "#Curr"
                  Height          =   240
                  Index           =   28
                  Left            =   4365
                  TabIndex        =   635
                  Tag             =   "_lbl_CURR_PanelChangeAUnp"
                  Top             =   390
                  Visible         =   0   'False
                  Width           =   435
               End
               Begin VB.Label lbl_Price 
                  Alignment       =   2  'Center
                  Caption         =   "#Curr"
                  Height          =   240
                  Index           =   27
                  Left            =   4365
                  TabIndex        =   634
                  Tag             =   "_lbl_CURR_PanelChangeBUnp"
                  Top             =   735
                  Visible         =   0   'False
                  Width           =   435
               End
            End
            Begin VB.Frame fra_PanelSetupPRF 
               BorderStyle     =   0  'None
               Height          =   1035
               Left            =   60
               TabIndex        =   611
               Tag             =   "fra_PanelSetupPRF"
               Top             =   1395
               Width           =   5115
               Begin VB.TextBox txt_Price 
                  Alignment       =   1  'Right Justify
                  BackColor       =   &H8000000F&
                  Height          =   330
                  Index           =   7
                  Left            =   2865
                  Locked          =   -1  'True
                  TabIndex        =   612
                  TabStop         =   0   'False
                  Tag             =   "txt_PanelChangeBPRF_A"
                  Top             =   675
                  Visible         =   0   'False
                  Width           =   720
               End
               Begin VB.TextBox txt_Price 
                  Alignment       =   1  'Right Justify
                  BackColor       =   &H8000000F&
                  Height          =   330
                  Index           =   6
                  Left            =   2865
                  Locked          =   -1  'True
                  TabIndex        =   613
                  TabStop         =   0   'False
                  Tag             =   "txt_PanelChangeAPRF_A"
                  Top             =   345
                  Visible         =   0   'False
                  Width           =   720
               End
               Begin VB.TextBox txt_Price 
                  Alignment       =   1  'Right Justify
                  BackColor       =   &H8000000F&
                  Height          =   330
                  Index           =   5
                  Left            =   2865
                  Locked          =   -1  'True
                  TabIndex        =   614
                  TabStop         =   0   'False
                  Tag             =   "txt_PanelSetupChargePRF_A"
                  Top             =   15
                  Width           =   720
               End
               Begin VB.CheckBox chk_Price 
                  Caption         =   "#Change of width position"
                  Height          =   300
                  Index           =   2
                  Left            =   0
                  TabIndex        =   620
                  Tag             =   "chk_PanelChangeBPRF"
                  Top             =   735
                  Width           =   2970
               End
               Begin VB.CheckBox chk_Price 
                  Caption         =   "#Change of length position"
                  Height          =   300
                  Index           =   1
                  Left            =   0
                  TabIndex        =   619
                  Tag             =   "chk_PanelChangeAPRF"
                  Top             =   420
                  Width           =   2970
               End
               Begin VB.CheckBox chk_Price 
                  Caption         =   "#Setup charge per call"
                  Height          =   300
                  Index           =   0
                  Left            =   -15
                  TabIndex        =   618
                  Tag             =   "chk_PanelSetupChargePRF"
                  Top             =   90
                  Width           =   2970
               End
               Begin VB.TextBox txt_Price 
                  Alignment       =   1  'Right Justify
                  BackColor       =   &H8000000F&
                  Height          =   330
                  Index           =   10
                  Left            =   3585
                  Locked          =   -1  'True
                  TabIndex        =   617
                  TabStop         =   0   'False
                  Tag             =   "txt_PanelChangeBPRF_M"
                  Top             =   675
                  Visible         =   0   'False
                  Width           =   720
               End
               Begin VB.TextBox txt_Price 
                  Alignment       =   1  'Right Justify
                  BackColor       =   &H8000000F&
                  Height          =   330
                  Index           =   9
                  Left            =   3585
                  Locked          =   -1  'True
                  TabIndex        =   616
                  TabStop         =   0   'False
                  Tag             =   "txt_PanelChangeAPRF_M"
                  Top             =   345
                  Visible         =   0   'False
                  Width           =   720
               End
               Begin VB.TextBox txt_Price 
                  Alignment       =   1  'Right Justify
                  BackColor       =   &H8000000F&
                  Height          =   330
                  Index           =   8
                  Left            =   3585
                  Locked          =   -1  'True
                  TabIndex        =   615
                  TabStop         =   0   'False
                  Tag             =   "txt_PanelSetupChargePRF_M"
                  Top             =   15
                  Width           =   720
               End
               Begin VB.Label lbl_Price 
                  Alignment       =   2  'Center
                  Caption         =   "#Curr"
                  Height          =   240
                  Index           =   7
                  Left            =   4365
                  TabIndex        =   623
                  Tag             =   "_lbl_CURR_PanelChangeBPrf"
                  Top             =   735
                  Visible         =   0   'False
                  Width           =   435
               End
               Begin VB.Label lbl_Price 
                  Alignment       =   2  'Center
                  Caption         =   "#Curr"
                  Height          =   240
                  Index           =   6
                  Left            =   4365
                  TabIndex        =   622
                  Tag             =   "_lbl_CURR_PanelChangeAPrf"
                  Top             =   390
                  Visible         =   0   'False
                  Width           =   435
               End
               Begin VB.Label lbl_Price 
                  Alignment       =   2  'Center
                  Caption         =   "#Curr"
                  Height          =   240
                  Index           =   5
                  Left            =   4365
                  TabIndex        =   621
                  Tag             =   "_lbl_CURR_PanelSetupChargePrf"
                  Top             =   45
                  Width           =   435
               End
            End
            Begin VB.Label lbl_Label 
               Caption         =   "#Base panel price (pu)"
               Height          =   255
               Index           =   67
               Left            =   75
               TabIndex        =   487
               Tag             =   "lbl_PanelPricePU"
               Top             =   1170
               Width           =   2895
            End
            Begin VB.Label lbl_Label 
               Caption         =   "#Base panel price (pcs)"
               Height          =   255
               Index           =   66
               Left            =   75
               TabIndex        =   486
               Tag             =   "lbl_PanelPricePCS"
               Top             =   825
               Width           =   2895
            End
            Begin VB.Label lbl_Label 
               Caption         =   "#Base panel price (m2)"
               Height          =   255
               Index           =   2
               Left            =   75
               TabIndex        =   485
               Tag             =   "lbl_PanelPriceM2"
               Top             =   465
               Width           =   2895
            End
            Begin VB.Label lbl_Label 
               Caption         =   "#Auto"
               Height          =   255
               Index           =   15
               Left            =   2925
               TabIndex        =   484
               Tag             =   "lbl_PanelPriceAuto"
               Top             =   150
               Width           =   765
            End
            Begin VB.Label lbl_Label 
               Caption         =   "#Manual"
               Height          =   255
               Index           =   64
               Left            =   3645
               TabIndex        =   483
               Tag             =   "lbl_PanelPriceManual"
               Top             =   135
               Width           =   765
            End
            Begin VB.Label lbl_Price 
               Caption         =   "#Curr"
               Height          =   240
               Index           =   2
               Left            =   4425
               TabIndex        =   482
               Tag             =   "_lbl_CURR_PanelPriceM2"
               Top             =   420
               Width           =   435
            End
            Begin VB.Label lbl_Price 
               Caption         =   "#Curr"
               Height          =   240
               Index           =   3
               Left            =   4425
               TabIndex        =   481
               Tag             =   "_lbl_CURR_PanelPricePCS"
               Top             =   750
               Width           =   435
            End
            Begin VB.Label lbl_Price 
               Caption         =   "#Curr"
               Height          =   240
               Index           =   4
               Left            =   4425
               TabIndex        =   480
               Tag             =   "_lbl_CURR_PanelPricePU"
               Top             =   1080
               Width           =   435
            End
         End
         Begin Project1.ArmCombobox cbo_ToolSetup 
            Height          =   345
            Left            =   3780
            TabIndex        =   19
            Top             =   1470
            Visible         =   0   'False
            Width           =   1515
            _ExtentX        =   2672
            _ExtentY        =   609
         End
         Begin VB.Label lbl_Label 
            Caption         =   "#Tool setup"
            Height          =   255
            Index           =   49
            Left            =   2715
            TabIndex        =   692
            Tag             =   "lbl_RPL_ToolSetup"
            Top             =   1530
            Visible         =   0   'False
            Width           =   1185
         End
         Begin VB.Label lbl_Label 
            Caption         =   "#System Type"
            Height          =   255
            Index           =   48
            Left            =   2715
            TabIndex        =   677
            Tag             =   "lbl_RPL_BaeType"
            Top             =   1125
            Visible         =   0   'False
            Width           =   1770
         End
         Begin VB.Label lbl_Label 
            Caption         =   "#Module length [mm]"
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   238
               Weight          =   700
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   255
            Index           =   1
            Left            =   75
            TabIndex        =   492
            Tag             =   "lbl_ModuleA"
            Top             =   345
            Width           =   1860
         End
         Begin VB.Label lbl_Label 
            Caption         =   "#Module width [mm]"
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   238
               Weight          =   700
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   255
            Index           =   0
            Left            =   2700
            TabIndex        =   491
            Tag             =   "lbl_ModuleB"
            Top             =   360
            Width           =   1875
         End
         Begin VB.Label lbl_Label 
            Caption         =   "#Panel length A [mm]"
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   238
               Weight          =   700
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   255
            Index           =   14
            Left            =   75
            TabIndex        =   490
            Tag             =   "lbl_PanelA"
            Top             =   750
            Width           =   1860
         End
         Begin VB.Label lbl_Label 
            Caption         =   "#Panel width B [mm]"
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   238
               Weight          =   700
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   255
            Index           =   16
            Left            =   2685
            TabIndex        =   489
            Tag             =   "lbl_PanelB"
            Top             =   750
            Width           =   1875
         End
         Begin VB.Label lbl_Label 
            Caption         =   "#Panels per module"
            Height          =   255
            Index           =   78
            Left            =   75
            TabIndex        =   488
            Tag             =   "lbl_PanelsPerModule"
            Top             =   1125
            Width           =   1860
         End
      End
      Begin VB.Frame fra_SpecAttrib 
         Caption         =   "#Specific attributes"
         Height          =   1095
         Index           =   0
         Left            =   90
         TabIndex        =   466
         Tag             =   "fra_SpecAttrib1"
         Top             =   8850
         Width           =   14940
         Begin VB.TextBox txt_Textbox 
            BackColor       =   &H8000000F&
            Height          =   330
            Index           =   100
            Left            =   12720
            Locked          =   -1  'True
            TabIndex        =   690
            TabStop         =   0   'False
            Tag             =   "PRD_Id"
            Top             =   195
            Visible         =   0   'False
            Width           =   2085
         End
         Begin VB.TextBox txt_Textbox 
            Alignment       =   1  'Right Justify
            Height          =   330
            Index           =   89
            Left            =   9420
            TabIndex        =   654
            Tag             =   "RPL_SwGap"
            Top             =   615
            Width           =   780
         End
         Begin VB.CheckBox chk_PerimeterTrim 
            Caption         =   "#Use of perimeter trim"
            Height          =   240
            Left            =   5055
            TabIndex        =   653
            Tag             =   "chk_UsePerimeter"
            Top             =   660
            Width           =   2475
         End
         Begin VB.TextBox txt_Textbox 
            Height          =   330
            Index           =   110
            Left            =   1815
            TabIndex        =   35
            Tag             =   "RPL_CorW"
            Top             =   255
            Width           =   1140
         End
         Begin VB.TextBox txt_Textbox 
            Height          =   330
            Index           =   111
            Left            =   1815
            TabIndex        =   36
            Tag             =   "RPL_CorG1"
            Top             =   675
            Width           =   1140
         End
         Begin VB.TextBox txt_Textbox 
            Height          =   330
            Index           =   112
            Left            =   3075
            TabIndex        =   37
            Tag             =   "RPL_CorG2"
            Top             =   675
            Width           =   1140
         End
         Begin VB.Label lbl_Label 
            Caption         =   "#Id"
            Height          =   255
            Index           =   79
            Left            =   12270
            TabIndex        =   691
            Tag             =   "lbl_PanelId"
            Top             =   240
            Visible         =   0   'False
            Width           =   375
         End
         Begin VB.Label lbl_Label 
            Caption         =   "#Shadow gap [mm]"
            Height          =   255
            Index           =   129
            Left            =   7650
            TabIndex        =   655
            Tag             =   "lbl_ShadowGap"
            Top             =   660
            Width           =   1725
         End
         Begin VB.Label lbl_Label 
            Caption         =   "#Corridor width [mm]"
            Height          =   255
            Index           =   19
            Left            =   60
            TabIndex        =   468
            Tag             =   "lbl_CorridorWidth"
            Top             =   315
            Width           =   1710
         End
         Begin VB.Label lbl_Label 
            Caption         =   "#Corridor gap [mm]"
            Height          =   255
            Index           =   24
            Left            =   60
            TabIndex        =   467
            Tag             =   "lbl_CoridorGap"
            Top             =   735
            Width           =   1695
         End
      End
      Begin VB.TextBox txt_Textbox 
         Height          =   345
         Index           =   0
         Left            =   7035
         MaxLength       =   80
         TabIndex        =   4
         Tag             =   "PRD_Name"
         Top             =   172
         Width           =   4320
      End
      Begin VB.TextBox txt_Textbox 
         BackColor       =   &H8000000F&
         Height          =   330
         Index           =   1
         Left            =   4440
         Locked          =   -1  'True
         TabIndex        =   3
         TabStop         =   0   'False
         Tag             =   "PRD_Code"
         Top             =   172
         Width           =   1290
      End
      Begin VB.TextBox txt_Textbox 
         Height          =   330
         Index           =   2
         Left            =   1590
         MaxLength       =   30
         TabIndex        =   1
         Tag             =   "OFD_PosCus"
         Top             =   165
         Width           =   1500
      End
      Begin VB.TextBox txt_Textbox 
         Alignment       =   1  'Right Justify
         Height          =   330
         Index           =   4
         Left            =   4455
         TabIndex        =   8
         Tag             =   "PanelQtyPCS"
         Top             =   540
         Width           =   1275
      End
      Begin VB.TextBox txt_Textbox 
         Alignment       =   1  'Right Justify
         BackColor       =   &H8000000F&
         Height          =   330
         Index           =   5
         Left            =   7035
         Locked          =   -1  'True
         TabIndex        =   9
         TabStop         =   0   'False
         Tag             =   "PanelQtyPU"
         Top             =   555
         Width           =   780
      End
      Begin VB.OptionButton opt_QtyType 
         Caption         =   "#Qty [m2]"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   238
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   390
         Index           =   0
         Left            =   60
         TabIndex        =   5
         TabStop         =   0   'False
         Tag             =   "opt_QtyTypeM2"
         Top             =   510
         Width           =   1575
      End
      Begin VB.OptionButton opt_QtyType 
         Caption         =   "#Qty [pcs]"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   238
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   390
         Index           =   1
         Left            =   2820
         TabIndex        =   7
         TabStop         =   0   'False
         Tag             =   "opt_QtyTypePCS"
         Top             =   495
         Width           =   1665
      End
      Begin VB.TextBox txt_Textbox 
         Height          =   330
         Index           =   91
         Left            =   9645
         TabIndex        =   11
         Tag             =   "OFD_Pos"
         Top             =   540
         Width           =   1725
      End
      Begin Project1.ArmCombobox cbo_Vendor 
         Height          =   345
         Left            =   1590
         TabIndex        =   665
         Top             =   900
         Width           =   2160
         _ExtentX        =   3810
         _ExtentY        =   609
      End
      Begin Project1.ArmCombobox cbo_ShipPoint 
         Height          =   345
         Left            =   5670
         TabIndex        =   666
         Top             =   915
         Width           =   2160
         _ExtentX        =   3810
         _ExtentY        =   609
      End
      Begin Project1.A_calocx cal_ShipDate 
         Height          =   360
         Left            =   13005
         TabIndex        =   671
         Top             =   540
         Width           =   1845
         _ExtentX        =   3254
         _ExtentY        =   635
      End
      Begin VB.TextBox txt_Textbox 
         Height          =   330
         Index           =   103
         Left            =   1590
         MaxLength       =   20
         TabIndex        =   2
         Tag             =   "BI_SAP_Code"
         Top             =   165
         Width           =   1500
      End
      Begin VB.Label lbl_Label 
         Caption         =   "#Ship date"
         Height          =   255
         Index           =   31
         Left            =   11370
         TabIndex        =   672
         Tag             =   "lbl_OFD_ShipDate"
         Top             =   600
         Width           =   1695
      End
      Begin VB.Label lbl_Label 
         Caption         =   "#Shipping point"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   238
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   240
         Index           =   30
         Left            =   3825
         TabIndex        =   667
         Tag             =   "lbl_ShipPoint"
         Top             =   930
         Width           =   1890
      End
      Begin VB.Label lbl_Label 
         Caption         =   "#Plant/Vendor"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   238
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   345
         Index           =   11
         Left            =   90
         TabIndex        =   664
         Tag             =   "lbl_PlantVendor"
         Top             =   930
         Width           =   1545
      End
      Begin VB.Label lbl_Label 
         Caption         =   "#Wish date"
         Height          =   255
         Index           =   185
         Left            =   11370
         TabIndex        =   565
         Tag             =   "lbl_OFD_WshDat"
         Top             =   240
         Width           =   1695
      End
      Begin VB.Label lbl_Label 
         Caption         =   "#Delivery date"
         Height          =   255
         Index           =   23
         Left            =   11370
         TabIndex        =   564
         Tag             =   "lbl_OFD_DeliveryDate"
         Top             =   960
         Width           =   1695
      End
      Begin VB.Label lbl_Label 
         Caption         =   "#PU"
         Height          =   255
         Index           =   50
         Left            =   7845
         TabIndex        =   559
         Tag             =   "lbl_PU"
         Top             =   975
         Width           =   975
      End
      Begin VB.Label lbl_Label 
         Caption         =   "#Armstrong pos."
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   238
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Index           =   53
         Left            =   7875
         TabIndex        =   554
         Tag             =   "lbl_OFD_Pos"
         Top             =   600
         Width           =   1770
      End
      Begin VB.Label lbl_Label 
         Caption         =   "#Name"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   238
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Index           =   61
         Left            =   5820
         TabIndex        =   496
         Tag             =   "lbl_PanelName"
         Top             =   210
         Width           =   1230
      End
      Begin VB.Label lbl_Label 
         Caption         =   "#Code"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   238
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Index           =   62
         Left            =   3135
         TabIndex        =   495
         Tag             =   "lbl_PanelCode"
         Top             =   210
         Width           =   1275
      End
      Begin VB.Label lbl_Label 
         Caption         =   "#Customer position"
         Height          =   255
         Index           =   63
         Left            =   105
         TabIndex        =   494
         Tag             =   "lbl_PanelCodeC"
         Top             =   210
         Width           =   1500
      End
      Begin VB.Label lbl_Label 
         Caption         =   "#Quantity [pu]"
         Height          =   255
         Index           =   65
         Left            =   5820
         TabIndex        =   493
         Tag             =   "lbl_QuantityPU"
         Top             =   585
         Width           =   1215
      End
      Begin VB.Label lbl_Label 
         Caption         =   "#SAP Code"
         Height          =   255
         Index           =   45
         Left            =   105
         TabIndex        =   676
         Tag             =   "lbl_BI_SAP_Code"
         Top             =   210
         Width           =   1440
      End
   End
   Begin VB.Frame fra_Step 
      Height          =   1455
      Index           =   3
      Left            =   10755
      TabIndex        =   300
      Tag             =   "fra_Perforation"
      Top             =   570
      Width           =   2490
      Begin VB.Frame fra_PerfDefault 
         Height          =   570
         Left            =   105
         TabIndex        =   303
         Tag             =   "fra_StandardPerf"
         Top             =   105
         Width           =   14505
         Begin VB.OptionButton opt_StandardPerforation 
            Caption         =   "#No perforation"
            Height          =   270
            Index           =   0
            Left            =   195
            TabIndex        =   308
            TabStop         =   0   'False
            Tag             =   "opt_StandardPerfNone"
            Top             =   180
            Width           =   1965
         End
         Begin VB.OptionButton opt_StandardPerforation 
            Caption         =   "#Standard perforation (RG 2516)"
            Height          =   270
            Index           =   1
            Left            =   2178
            TabIndex        =   307
            TabStop         =   0   'False
            Tag             =   "opt_StandardPerf1"
            Top             =   180
            Width           =   3300
         End
         Begin VB.OptionButton opt_StandardPerforation 
            Caption         =   "#Other"
            Height          =   270
            Index           =   4
            Left            =   12285
            TabIndex        =   306
            TabStop         =   0   'False
            Tag             =   "opt_StandardPerfOther"
            Top             =   180
            Width           =   2145
         End
         Begin VB.OptionButton opt_StandardPerforation 
            Caption         =   "#Microperforation (RD 1522)"
            Height          =   270
            Index           =   2
            Left            =   5520
            TabIndex        =   305
            TabStop         =   0   'False
            Tag             =   "opt_StandardPerf2"
            Top             =   180
            Width           =   3225
         End
         Begin VB.OptionButton opt_StandardPerforation 
            Caption         =   "#Extra microperforation (RG 0701)"
            Height          =   270
            Index           =   3
            Left            =   8805
            TabIndex        =   304
            TabStop         =   0   'False
            Tag             =   "opt_StandardPerf3"
            Top             =   180
            Width           =   3450
         End
      End
      Begin VB.Frame fra_PerfDetail 
         Height          =   2595
         Left            =   60
         TabIndex        =   310
         Tag             =   "fra_PerfDetail"
         Top             =   7350
         Width           =   14280
         Begin VB.Frame fra_PBord 
            Caption         =   "#Border"
            Height          =   615
            Left            =   165
            TabIndex        =   649
            Tag             =   "fra_PBord"
            Top             =   120
            Width           =   6990
            Begin VB.OptionButton opt_UnperfBorder 
               Caption         =   "#Standard unperofated border (8 - 12 mm)"
               Height          =   330
               Index           =   0
               Left            =   330
               TabIndex        =   652
               Tag             =   "opt_UnperfBorderStd"
               Top             =   180
               Width           =   2445
            End
            Begin VB.OptionButton opt_UnperfBorder 
               Caption         =   "#Overperforated border"
               Height          =   345
               Index           =   1
               Left            =   2955
               TabIndex        =   651
               Tag             =   "opt_UnperfBorderOver"
               Top             =   150
               Width           =   2160
            End
            Begin VB.OptionButton opt_UnperfBorder 
               Caption         =   "#Other"
               Height          =   360
               Index           =   2
               Left            =   5130
               TabIndex        =   650
               Tag             =   "opt_UnperfBorderOther"
               Top             =   165
               Width           =   1755
            End
         End
         Begin VB.Frame fra_Price 
            Height          =   780
            Index           =   3
            Left            =   7200
            TabIndex        =   337
            Tag             =   "fra_PerfPrice"
            Top             =   1755
            Width           =   6870
            Begin VB.TextBox txt_Price 
               BackColor       =   &H8000000F&
               Height          =   345
               Index           =   20
               Left            =   2070
               Locked          =   -1  'True
               TabIndex        =   339
               TabStop         =   0   'False
               Tag             =   "txt_PerfPrice_A"
               Text            =   "0"
               Top             =   345
               Width           =   800
            End
            Begin VB.TextBox txt_Price 
               BackColor       =   &H8000000F&
               Height          =   345
               Index           =   21
               Left            =   3045
               Locked          =   -1  'True
               TabIndex        =   338
               TabStop         =   0   'False
               Tag             =   "txt_PerfPrice_M"
               Text            =   "0"
               Top             =   330
               Width           =   800
            End
            Begin VB.Label lbl_Label 
               Caption         =   "#Perforation cost"
               Height          =   255
               Index           =   3
               Left            =   120
               TabIndex        =   343
               Tag             =   "lbl_PerfPrice"
               Top             =   405
               Width           =   1590
            End
            Begin VB.Label lbl_Label 
               Caption         =   "#Auto"
               Height          =   255
               Index           =   87
               Left            =   2040
               TabIndex        =   342
               Tag             =   "lbl_PerfPriceAuto"
               Top             =   120
               Width           =   930
            End
            Begin VB.Label lbl_Label 
               Caption         =   "#Manual"
               Height          =   255
               Index           =   88
               Left            =   3030
               TabIndex        =   341
               Tag             =   "lbl_PerfPriceManual"
               Top             =   105
               Width           =   855
            End
            Begin VB.Label lbl_Price 
               AutoSize        =   -1  'True
               Caption         =   "#Curr"
               Height          =   195
               Index           =   10
               Left            =   3945
               TabIndex        =   340
               Tag             =   "_lbl_CURR_PerfPrice"
               Top             =   390
               Width           =   390
            End
         End
         Begin VB.Frame fra_Technical 
            Caption         =   "#Technical data"
            Height          =   1635
            Index           =   1
            Left            =   7200
            TabIndex        =   311
            Tag             =   "fra_PerfAttributes"
            Top             =   120
            Width           =   6870
            Begin VB.TextBox txt_Tech 
               BackColor       =   &H00FFFFC0&
               Height          =   375
               Index           =   16
               Left            =   1575
               TabIndex        =   320
               Tag             =   "PRF_SAMax"
               Top             =   570
               Width           =   780
            End
            Begin VB.TextBox txt_Tech 
               BackColor       =   &H00FFFFC0&
               Height          =   345
               Index           =   17
               Left            =   1575
               TabIndex        =   319
               Tag             =   "PRF_SBMin"
               Top             =   975
               Width           =   780
            End
            Begin VB.TextBox txt_Tech 
               BackColor       =   &H00FFFFC0&
               Height          =   345
               Index           =   18
               Left            =   5880
               TabIndex        =   318
               Top             =   615
               Visible         =   0   'False
               Width           =   675
            End
            Begin VB.TextBox txt_Tech 
               BackColor       =   &H00FFFFC0&
               Height          =   345
               Index           =   19
               Left            =   5895
               TabIndex        =   317
               Top             =   225
               Visible         =   0   'False
               Width           =   675
            End
            Begin VB.TextBox txt_Tech 
               BackColor       =   &H00FFFFC0&
               Height          =   345
               Index           =   20
               Left            =   1575
               TabIndex        =   316
               Tag             =   "PRF_SAMin"
               Top             =   195
               Width           =   780
            End
            Begin VB.TextBox txt_Tech 
               BackColor       =   &H00FFFFC0&
               Height          =   345
               Index           =   23
               Left            =   3870
               TabIndex        =   315
               Tag             =   "RPL_SCorr"
               Top             =   975
               Width           =   780
            End
            Begin VB.TextBox txt_Tech 
               BackColor       =   &H00FFFFC0&
               Height          =   345
               Index           =   24
               Left            =   5880
               TabIndex        =   314
               Top             =   1035
               Visible         =   0   'False
               Width           =   675
            End
            Begin VB.TextBox txt_Tech 
               BackColor       =   &H00FFFFC0&
               Height          =   345
               Index           =   25
               Left            =   3870
               TabIndex        =   313
               Tag             =   "PRF_Step"
               Top             =   225
               Width           =   780
            End
            Begin VB.TextBox txt_Tech 
               BackColor       =   &H00FFFFC0&
               Height          =   345
               Index           =   0
               Left            =   3870
               TabIndex        =   312
               Tag             =   "PRF_StLim"
               Top             =   600
               Width           =   780
            End
            Begin VB.Label lbl_Label 
               Caption         =   "#Step"
               Height          =   255
               Index           =   117
               Left            =   2580
               TabIndex        =   326
               Tag             =   "chk_PerfStep"
               Top             =   225
               Width           =   1380
            End
            Begin VB.Label lbl_Label 
               Caption         =   "#Step limit"
               Height          =   255
               Index           =   122
               Left            =   2580
               TabIndex        =   325
               Tag             =   "chk_PerfStepLimit"
               Top             =   615
               Width           =   1380
            End
            Begin VB.Label lbl_Label 
               Caption         =   "#Step A min"
               Height          =   255
               Index           =   6
               Left            =   210
               TabIndex        =   324
               Tag             =   "lbl_PerfStepAMin"
               Top             =   300
               Width           =   1185
            End
            Begin VB.Label lbl_Label 
               Caption         =   "#Step A max"
               Height          =   255
               Index           =   7
               Left            =   210
               TabIndex        =   323
               Tag             =   "lbl_PerfStepAMax"
               Top             =   645
               Width           =   1290
            End
            Begin VB.Label lbl_Label 
               Caption         =   "#Step B min"
               Height          =   255
               Index           =   36
               Left            =   210
               TabIndex        =   322
               Tag             =   "lbl_PerfStepBMin"
               Top             =   1005
               Width           =   1185
            End
            Begin VB.Label lbl_Label 
               Caption         =   "#Step corrected"
               Height          =   255
               Index           =   39
               Left            =   2565
               TabIndex        =   321
               Tag             =   "chk_PerfStepCorrected"
               Top             =   1020
               Width           =   1380
            End
         End
         Begin VB.Frame fra_PRF_Border 
            Caption         =   "#Unperforated border"
            Height          =   1815
            Left            =   165
            TabIndex        =   327
            Tag             =   "fra_PerfBorder"
            Top             =   720
            Width           =   3660
            Begin VB.CheckBox chk_PerfBorder 
               Caption         =   "#C Side over border [mm]"
               Height          =   270
               Index           =   0
               Left            =   96
               TabIndex        =   335
               Tag             =   "chk_PerfBorderC"
               Top             =   435
               Width           =   2670
            End
            Begin VB.TextBox txt_Textbox 
               Height          =   345
               Index           =   57
               Left            =   2805
               TabIndex        =   334
               Tag             =   "RPL_UBoWC"
               Text            =   "0"
               Top             =   420
               Width           =   735
            End
            Begin VB.CheckBox chk_PerfBorder 
               Caption         =   "#D Side over border [mm]"
               Height          =   270
               Index           =   1
               Left            =   96
               TabIndex        =   333
               Tag             =   "chk_PerfBorderD"
               Top             =   780
               Width           =   2670
            End
            Begin VB.TextBox txt_Textbox 
               Height          =   345
               Index           =   58
               Left            =   2805
               TabIndex        =   332
               Tag             =   "RPL_UBoWD"
               Text            =   "0"
               Top             =   750
               Width           =   735
            End
            Begin VB.CheckBox chk_PerfBorder 
               Caption         =   "#E Side over border [mm]"
               Height          =   270
               Index           =   2
               Left            =   96
               TabIndex        =   331
               Tag             =   "chk_PerfBorderE"
               Top             =   1110
               Width           =   2670
            End
            Begin VB.TextBox txt_Textbox 
               Height          =   345
               Index           =   59
               Left            =   2805
               TabIndex        =   330
               Tag             =   "RPL_UBoWE"
               Text            =   "0"
               Top             =   1080
               Width           =   735
            End
            Begin VB.CheckBox chk_PerfBorder 
               Caption         =   "#F Side over border [mm]"
               Height          =   270
               Index           =   3
               Left            =   96
               TabIndex        =   329
               Tag             =   "chk_PerfBorderF"
               Top             =   1440
               Width           =   2670
            End
            Begin VB.TextBox txt_Textbox 
               Height          =   345
               Index           =   60
               Left            =   2805
               TabIndex        =   328
               Tag             =   "RPL_UBoWF"
               Text            =   "0"
               Top             =   1410
               Width           =   735
            End
            Begin VB.Label lbl_Label 
               Caption         =   "#Wanted"
               Height          =   255
               Index           =   55
               Left            =   2745
               TabIndex        =   336
               Tag             =   "lbl_PerfBorderWanter"
               Top             =   180
               Width           =   870
            End
         End
         Begin VB.Frame fra_PRF_BorderReal 
            Height          =   1815
            Left            =   3930
            TabIndex        =   678
            Tag             =   "fra_PRF_BorderReal"
            Top             =   720
            Width           =   3225
            Begin VB.CheckBox chk_CorrectStep 
               Caption         =   "#Corrected step"
               Height          =   312
               Left            =   1110
               TabIndex        =   684
               Tag             =   "chk_PerfCorrectedSetp"
               Top             =   1470
               Width           =   2040
            End
            Begin VB.CheckBox chk_StandardPerf 
               Caption         =   "#Standard values"
               Height          =   312
               Left            =   1125
               TabIndex        =   683
               Tag             =   "chk_PerfStandardValues"
               Top             =   405
               Width           =   2040
            End
            Begin VB.TextBox txt_Textbox 
               Height          =   345
               Index           =   64
               Left            =   60
               TabIndex        =   682
               Tag             =   "RPL_UBorF"
               Text            =   "0"
               Top             =   1410
               Width           =   735
            End
            Begin VB.TextBox txt_Textbox 
               Height          =   345
               Index           =   63
               Left            =   60
               TabIndex        =   681
               Tag             =   "RPL_UBorE"
               Text            =   "0"
               Top             =   1080
               Width           =   735
            End
            Begin VB.TextBox txt_Textbox 
               Height          =   345
               Index           =   62
               Left            =   60
               TabIndex        =   680
               Tag             =   "RPL_UBorD"
               Text            =   "0"
               Top             =   750
               Width           =   735
            End
            Begin VB.TextBox txt_Textbox 
               Height          =   345
               Index           =   61
               Left            =   60
               TabIndex        =   679
               Tag             =   "RPL_UBorC"
               Text            =   "0"
               Top             =   420
               Width           =   735
            End
            Begin VB.Shape Shape2 
               BackStyle       =   1  'Opaque
               BorderWidth     =   2
               Height          =   600
               Left            =   1455
               Top             =   795
               Width           =   1050
            End
            Begin VB.Label lbl_Label 
               BackColor       =   &H00FFFFFF&
               Caption         =   "C"
               BeginProperty Font 
                  Name            =   "Arial"
                  Size            =   8.25
                  Charset         =   238
                  Weight          =   700
                  Underline       =   0   'False
                  Italic          =   0   'False
                  Strikethrough   =   0   'False
               EndProperty
               Height          =   255
               Index           =   181
               Left            =   1890
               TabIndex        =   689
               Tag             =   "_lbl_Side"
               Top             =   810
               Width           =   360
            End
            Begin VB.Label lbl_Label 
               BackColor       =   &H00FFFFFF&
               Caption         =   "D"
               BeginProperty Font 
                  Name            =   "Arial"
                  Size            =   8.25
                  Charset         =   238
                  Weight          =   700
                  Underline       =   0   'False
                  Italic          =   0   'False
                  Strikethrough   =   0   'False
               EndProperty
               Height          =   255
               Index           =   182
               Left            =   1905
               TabIndex        =   688
               Tag             =   "_lbl_Side"
               Top             =   1110
               Width           =   360
            End
            Begin VB.Label lbl_Label 
               BackColor       =   &H00FFFFFF&
               Caption         =   "E"
               BeginProperty Font 
                  Name            =   "Arial"
                  Size            =   8.25
                  Charset         =   238
                  Weight          =   700
                  Underline       =   0   'False
                  Italic          =   0   'False
                  Strikethrough   =   0   'False
               EndProperty
               Height          =   255
               Index           =   183
               Left            =   1530
               TabIndex        =   687
               Tag             =   "_lbl_Side"
               Top             =   960
               Width           =   360
            End
            Begin VB.Label lbl_Label 
               BackColor       =   &H00FFFFFF&
               Caption         =   "F"
               BeginProperty Font 
                  Name            =   "Arial"
                  Size            =   8.25
                  Charset         =   238
                  Weight          =   700
                  Underline       =   0   'False
                  Italic          =   0   'False
                  Strikethrough   =   0   'False
               EndProperty
               Height          =   255
               Index           =   184
               Left            =   2250
               TabIndex        =   686
               Tag             =   "_lbl_Side"
               Top             =   975
               Width           =   225
            End
            Begin VB.Label lbl_Label 
               Caption         =   "#Real"
               Height          =   255
               Index           =   54
               Left            =   105
               TabIndex        =   685
               Tag             =   "lbl_PerfBorderReal"
               Top             =   195
               Width           =   570
            End
         End
      End
      Begin VB.PictureBox pct_Perforation 
         Appearance      =   0  'Flat
         AutoRedraw      =   -1  'True
         BackColor       =   &H80000005&
         ForeColor       =   &H80000008&
         Height          =   6270
         Left            =   4950
         ScaleHeight     =   6240
         ScaleWidth      =   7785
         TabIndex        =   301
         Top             =   1110
         Width           =   7815
      End
      Begin Project1.ArmTreeView tvw_Perforation 
         Height          =   6240
         Left            =   75
         TabIndex        =   302
         Top             =   1140
         Width           =   4755
         _ExtentX        =   8387
         _ExtentY        =   11007
      End
      Begin Project1.ArmCombobox cbo_PerfView 
         Height          =   345
         Left            =   90
         TabIndex        =   309
         Top             =   735
         Width           =   4725
         _ExtentX        =   8334
         _ExtentY        =   609
      End
      Begin Project1.ArmCombobox cbo_Perforation 
         Height          =   345
         Left            =   4950
         TabIndex        =   344
         Top             =   735
         Width           =   7830
         _ExtentX        =   13811
         _ExtentY        =   609
      End
   End
   Begin VB.Frame fra_Step 
      Height          =   1125
      Index           =   2
      Left            =   6645
      TabIndex        =   396
      Tag             =   "fra_Gasket"
      Top             =   570
      Width           =   1920
      Begin VB.Frame fra_GasketDelivery 
         Height          =   1185
         Left            =   8610
         TabIndex        =   644
         Tag             =   "fra_GasketDelivery"
         Top             =   120
         Width           =   3210
         Begin VB.OptionButton opt_Gasket 
            Caption         =   "#No Gasket"
            Height          =   360
            Index           =   0
            Left            =   105
            TabIndex        =   647
            TabStop         =   0   'False
            Tag             =   "opt_NoGasket"
            Top             =   135
            Width           =   3015
         End
         Begin VB.OptionButton opt_Gasket 
            Caption         =   "#Gasket installed"
            Height          =   360
            Index           =   1
            Left            =   105
            TabIndex        =   646
            TabStop         =   0   'False
            Tag             =   "opt_GasketInstalled"
            Top             =   450
            Width           =   3015
         End
         Begin VB.OptionButton opt_Gasket 
            Caption         =   "#Gasket as separate item"
            Height          =   360
            Index           =   2
            Left            =   105
            TabIndex        =   645
            TabStop         =   0   'False
            Tag             =   "opt_GasketSeparate"
            Top             =   765
            Width           =   3015
         End
      End
      Begin VB.Frame fra_SpacerDelivery 
         Height          =   1185
         Left            =   11820
         TabIndex        =   639
         Tag             =   "fra_SpacerDelivery"
         Top             =   120
         Width           =   3390
         Begin VB.OptionButton opt_Spacer 
            Caption         =   "#No Spacer"
            Height          =   240
            Index           =   0
            Left            =   60
            TabIndex        =   643
            TabStop         =   0   'False
            Tag             =   "opt_NoSpacer"
            Top             =   150
            Width           =   3285
         End
         Begin VB.OptionButton opt_Spacer 
            Caption         =   "#Spacer installed"
            Height          =   240
            Index           =   1
            Left            =   60
            TabIndex        =   642
            TabStop         =   0   'False
            Tag             =   "opt_SpacerInstalled"
            Top             =   385
            Width           =   3285
         End
         Begin VB.OptionButton opt_Spacer 
            Caption         =   "#Spacer as separate item"
            Height          =   240
            Index           =   2
            Left            =   60
            TabIndex        =   641
            TabStop         =   0   'False
            Tag             =   "opt_SpacerSeparate"
            Top             =   620
            Width           =   3285
         End
         Begin VB.OptionButton opt_Spacer 
            Caption         =   "#Notch for spacer only"
            Height          =   240
            Index           =   3
            Left            =   60
            TabIndex        =   640
            TabStop         =   0   'False
            Tag             =   "opt_SpacerNotch"
            Top             =   855
            Width           =   3285
         End
      End
      Begin VB.Frame fra_Price 
         Height          =   960
         Index           =   2
         Left            =   45
         TabIndex        =   447
         Tag             =   "fra_GasketPrice"
         Top             =   8835
         Width           =   5520
         Begin VB.TextBox txt_Price 
            Alignment       =   1  'Right Justify
            BackColor       =   &H8000000F&
            Height          =   345
            Index           =   14
            Left            =   1740
            Locked          =   -1  'True
            TabIndex        =   449
            TabStop         =   0   'False
            Tag             =   "txt_GasketSurcharge_A"
            Text            =   "0"
            Top             =   510
            Width           =   800
         End
         Begin VB.TextBox txt_Price 
            Alignment       =   1  'Right Justify
            BackColor       =   &H8000000F&
            Height          =   345
            Index           =   15
            Left            =   2700
            Locked          =   -1  'True
            TabIndex        =   448
            TabStop         =   0   'False
            Tag             =   "txt_GasketSurcharge_M"
            Text            =   "0"
            Top             =   495
            Width           =   800
         End
         Begin VB.Label lbl_Label 
            Caption         =   "#Gasket surcharge"
            Height          =   255
            Index           =   38
            Left            =   150
            TabIndex        =   453
            Tag             =   "lbl_GasketSurcharge"
            Top             =   585
            Width           =   1530
         End
         Begin VB.Label lbl_Label 
            Caption         =   "#Auto"
            Height          =   255
            Index           =   5
            Left            =   1785
            TabIndex        =   452
            Tag             =   "lbl_GasketPriceAuto"
            Top             =   195
            Width           =   825
         End
         Begin VB.Label lbl_Label 
            Caption         =   "#Manual"
            Height          =   255
            Index           =   84
            Left            =   2745
            TabIndex        =   451
            Tag             =   "lbl_GasketPriceManual"
            Top             =   195
            Width           =   840
         End
         Begin VB.Label lbl_Price 
            AutoSize        =   -1  'True
            Caption         =   "#Curr"
            Height          =   195
            Index           =   8
            Left            =   3600
            TabIndex        =   450
            Tag             =   "_lbl_CURR_GasketSurcharge"
            Top             =   540
            Width           =   390
         End
      End
      Begin VB.TextBox txt_Textbox 
         Alignment       =   1  'Right Justify
         BackColor       =   &H00FFFFC0&
         Height          =   330
         Index           =   15
         Left            =   7800
         TabIndex        =   446
         Tag             =   "RPL_GapE_"
         Top             =   255
         Width           =   780
      End
      Begin VB.TextBox txt_Textbox 
         Alignment       =   1  'Right Justify
         BackColor       =   &H00FFFFC0&
         Height          =   330
         Index           =   14
         Left            =   7800
         TabIndex        =   445
         Tag             =   "RPL_GapF_"
         Top             =   615
         Width           =   780
      End
      Begin VB.TextBox txt_Textbox 
         Alignment       =   1  'Right Justify
         BackColor       =   &H00FFFFC0&
         Height          =   330
         Index           =   16
         Left            =   5940
         TabIndex        =   444
         Tag             =   "RPL_GapD_"
         Top             =   615
         Width           =   780
      End
      Begin VB.TextBox txt_Textbox 
         Alignment       =   1  'Right Justify
         BackColor       =   &H00FFFFC0&
         Height          =   330
         Index           =   13
         Left            =   5940
         TabIndex        =   443
         Tag             =   "RPL_GapC_"
         Top             =   225
         Width           =   780
      End
      Begin VB.TextBox txt_Textbox 
         Alignment       =   1  'Right Justify
         Height          =   330
         Index           =   25
         Left            =   4050
         TabIndex        =   442
         Tag             =   "RPL_PanB_"
         Top             =   615
         Width           =   780
      End
      Begin VB.TextBox txt_Textbox 
         Alignment       =   1  'Right Justify
         Height          =   330
         Index           =   26
         Left            =   1650
         TabIndex        =   441
         Tag             =   "RPL_PanA_"
         Top             =   615
         Width           =   780
      End
      Begin VB.TextBox txt_Textbox 
         Alignment       =   1  'Right Justify
         Height          =   330
         Index           =   27
         Left            =   4050
         TabIndex        =   440
         Tag             =   "RPL_ModB_"
         Top             =   255
         Width           =   780
      End
      Begin VB.TextBox txt_Textbox 
         Alignment       =   1  'Right Justify
         Height          =   330
         Index           =   28
         Left            =   1650
         TabIndex        =   439
         Tag             =   "RPL_ModA_"
         Top             =   255
         Width           =   780
      End
      Begin VB.Frame fra_Price 
         Height          =   960
         Index           =   14
         Left            =   5865
         TabIndex        =   432
         Tag             =   "fra_SpacerPrice"
         Top             =   8835
         Width           =   6084
         Begin VB.TextBox txt_Price 
            Alignment       =   1  'Right Justify
            BackColor       =   &H8000000F&
            Height          =   345
            Index           =   54
            Left            =   3570
            Locked          =   -1  'True
            TabIndex        =   434
            TabStop         =   0   'False
            Tag             =   "txt_GasketSurcharge2_M"
            Text            =   "0"
            Top             =   495
            Width           =   800
         End
         Begin VB.TextBox txt_Price 
            Alignment       =   1  'Right Justify
            BackColor       =   &H8000000F&
            Height          =   345
            Index           =   55
            Left            =   2640
            Locked          =   -1  'True
            TabIndex        =   433
            TabStop         =   0   'False
            Tag             =   "txt_GasketSurcharge2_A"
            Text            =   "0"
            Top             =   510
            Width           =   800
         End
         Begin VB.Label lbl_Label 
            Caption         =   "#Manual"
            Height          =   255
            Index           =   33
            Left            =   3615
            TabIndex        =   438
            Tag             =   "lbl_SpacerPriceManual"
            Top             =   195
            Width           =   840
         End
         Begin VB.Label lbl_Label 
            Caption         =   "#Auto"
            Height          =   255
            Index           =   40
            Left            =   2685
            TabIndex        =   437
            Tag             =   "lbl_SpacerPriceAuto"
            Top             =   195
            Width           =   810
         End
         Begin VB.Label lbl_Label 
            Caption         =   "#Spacer surcharge"
            Height          =   255
            Index           =   41
            Left            =   150
            TabIndex        =   436
            Tag             =   "lbl_GasketSurcharge2"
            Top             =   600
            Width           =   2445
         End
         Begin VB.Label lbl_Price 
            AutoSize        =   -1  'True
            Caption         =   "#Curr"
            Height          =   195
            Index           =   9
            Left            =   4470
            TabIndex        =   435
            Tag             =   "_lbl_CURR_GasketSurcharge2"
            Top             =   570
            Width           =   390
         End
      End
      Begin VB.Frame fra_Spacer 
         Caption         =   "#Spacer"
         Height          =   1755
         Left            =   1140
         TabIndex        =   414
         Tag             =   "fra_Spacer"
         Top             =   2160
         Width           =   2490
         Begin VB.PictureBox pct_Gasket2 
            Appearance      =   0  'Flat
            AutoRedraw      =   -1  'True
            BackColor       =   &H80000005&
            ForeColor       =   &H80000008&
            Height          =   2400
            Index           =   1
            Left            =   6735
            ScaleHeight     =   2370
            ScaleWidth      =   2565
            TabIndex        =   422
            Top             =   5040
            Width           =   2600
         End
         Begin VB.PictureBox pct_Gasket2 
            Appearance      =   0  'Flat
            AutoRedraw      =   -1  'True
            BackColor       =   &H80000005&
            ForeColor       =   &H80000008&
            Height          =   2400
            Index           =   3
            Left            =   10365
            ScaleHeight     =   2370
            ScaleWidth      =   2565
            TabIndex        =   421
            Top             =   2490
            Width           =   2600
         End
         Begin VB.PictureBox pct_Gasket2 
            Appearance      =   0  'Flat
            AutoRedraw      =   -1  'True
            BackColor       =   &H80000005&
            ForeColor       =   &H80000008&
            Height          =   2400
            Index           =   0
            Left            =   6660
            ScaleHeight     =   2370
            ScaleWidth      =   2565
            TabIndex        =   420
            Top             =   600
            Width           =   2600
         End
         Begin VB.PictureBox pct_Gasket2 
            Appearance      =   0  'Flat
            AutoRedraw      =   -1  'True
            BackColor       =   &H80000005&
            ForeColor       =   &H80000008&
            Height          =   2400
            Index           =   2
            Left            =   3060
            ScaleHeight     =   2370
            ScaleWidth      =   2565
            TabIndex        =   419
            Top             =   2400
            Width           =   2600
         End
         Begin VB.CheckBox chk_Gasket2 
            Height          =   270
            Index           =   0
            Left            =   7875
            TabIndex        =   418
            Tag             =   "chk_Gasket20"
            Top             =   3060
            Width           =   285
         End
         Begin VB.CheckBox chk_Gasket2 
            Height          =   270
            Index           =   1
            Left            =   7890
            TabIndex        =   417
            Tag             =   "chk_Gasket21"
            Top             =   4305
            Width           =   285
         End
         Begin VB.CheckBox chk_Gasket2 
            Height          =   270
            Index           =   2
            Left            =   6735
            TabIndex        =   416
            Tag             =   "chk_Gasket22"
            Top             =   3630
            Width           =   285
         End
         Begin VB.CheckBox chk_Gasket2 
            Height          =   270
            Index           =   3
            Left            =   9000
            TabIndex        =   415
            Tag             =   "chk_Gasket23"
            Top             =   3645
            Width           =   285
         End
         Begin Project1.ArmCombobox cbo_GSK2 
            Height          =   345
            Index           =   0
            Left            =   5805
            TabIndex        =   423
            Top             =   195
            Width           =   4260
            _ExtentX        =   7514
            _ExtentY        =   609
         End
         Begin Project1.ArmCombobox cbo_GSK2 
            Height          =   345
            Index           =   3
            Left            =   9540
            TabIndex        =   424
            Top             =   2085
            Width           =   4260
            _ExtentX        =   7514
            _ExtentY        =   609
         End
         Begin Project1.ArmCombobox cbo_GSK2 
            Height          =   345
            Index           =   2
            Left            =   2235
            TabIndex        =   425
            Top             =   1995
            Width           =   4260
            _ExtentX        =   7514
            _ExtentY        =   609
         End
         Begin Project1.ArmCombobox cbo_GSK2 
            Height          =   345
            Index           =   1
            Left            =   5955
            TabIndex        =   426
            Top             =   4635
            Width           =   4260
            _ExtentX        =   7514
            _ExtentY        =   609
         End
         Begin VB.Label lbl_Label 
            BackColor       =   &H00FFFFFF&
            Caption         =   "F"
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   238
               Weight          =   700
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   255
            Index           =   160
            Left            =   8565
            TabIndex        =   430
            Tag             =   "_lbl_Side"
            Top             =   3645
            Width           =   225
         End
         Begin VB.Label lbl_Label 
            BackColor       =   &H00FFFFFF&
            Caption         =   "E"
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   238
               Weight          =   700
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   255
            Index           =   159
            Left            =   7290
            TabIndex        =   429
            Tag             =   "_lbl_Side"
            Top             =   3645
            Width           =   360
         End
         Begin VB.Label lbl_Label 
            BackColor       =   &H00FFFFFF&
            Caption         =   "D"
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   238
               Weight          =   700
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   225
            Index           =   158
            Left            =   7905
            TabIndex        =   428
            Tag             =   "_lbl_Side"
            Top             =   3930
            Width           =   360
         End
         Begin VB.Label lbl_Label 
            BackColor       =   &H00FFFFFF&
            Caption         =   "C"
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   238
               Weight          =   700
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   255
            Index           =   157
            Left            =   7905
            TabIndex        =   427
            Tag             =   "_lbl_Side"
            Top             =   3450
            Width           =   360
         End
         Begin VB.Shape Shape5 
            BackStyle       =   1  'Opaque
            BorderWidth     =   2
            Height          =   840
            Left            =   7170
            Top             =   3405
            Width           =   1665
         End
      End
      Begin VB.Frame fra_Gasket 
         Caption         =   "#Gasket"
         Height          =   1815
         Left            =   4875
         TabIndex        =   397
         Tag             =   "fra_Gasket"
         Top             =   1995
         Width           =   3000
         Begin VB.PictureBox pct_Gasket 
            Appearance      =   0  'Flat
            AutoRedraw      =   -1  'True
            BackColor       =   &H80000005&
            ForeColor       =   &H80000008&
            Height          =   2400
            Index           =   1
            Left            =   6645
            ScaleHeight     =   2370
            ScaleWidth      =   2565
            TabIndex        =   405
            Top             =   4845
            Width           =   2600
         End
         Begin VB.PictureBox pct_Gasket 
            Appearance      =   0  'Flat
            AutoRedraw      =   -1  'True
            BackColor       =   &H80000005&
            ForeColor       =   &H80000008&
            Height          =   2400
            Index           =   3
            Left            =   9705
            ScaleHeight     =   2370
            ScaleWidth      =   2565
            TabIndex        =   404
            Top             =   2370
            Width           =   2600
         End
         Begin VB.PictureBox pct_Gasket 
            Appearance      =   0  'Flat
            AutoRedraw      =   -1  'True
            BackColor       =   &H80000005&
            ForeColor       =   &H80000008&
            Height          =   2400
            Index           =   0
            Left            =   6585
            ScaleHeight     =   2370
            ScaleWidth      =   2565
            TabIndex        =   403
            Top             =   600
            Width           =   2600
         End
         Begin VB.PictureBox pct_Gasket 
            Appearance      =   0  'Flat
            AutoRedraw      =   -1  'True
            BackColor       =   &H80000005&
            ForeColor       =   &H80000008&
            Height          =   2400
            Index           =   2
            Left            =   3495
            ScaleHeight     =   2370
            ScaleWidth      =   2565
            TabIndex        =   402
            Top             =   2430
            Width           =   2600
         End
         Begin VB.CheckBox chk_Gasket 
            Height          =   240
            Index           =   0
            Left            =   7755
            TabIndex        =   401
            Tag             =   "chk_Gasket0"
            Top             =   3045
            Width           =   300
         End
         Begin VB.CheckBox chk_Gasket 
            Height          =   240
            Index           =   1
            Left            =   7740
            TabIndex        =   400
            Tag             =   "chk_Gasket1"
            Top             =   4200
            Width           =   300
         End
         Begin VB.CheckBox chk_Gasket 
            Height          =   240
            Index           =   2
            Left            =   6585
            TabIndex        =   399
            Tag             =   "chk_Gasket2"
            Top             =   3615
            Width           =   300
         End
         Begin VB.CheckBox chk_Gasket 
            Height          =   240
            Index           =   3
            Left            =   8880
            TabIndex        =   398
            Tag             =   "chk_Gasket3"
            Top             =   3615
            Width           =   300
         End
         Begin Project1.ArmCombobox cbo_GSK 
            Height          =   345
            Index           =   0
            Left            =   6060
            TabIndex        =   406
            Top             =   210
            Width           =   3540
            _ExtentX        =   6244
            _ExtentY        =   609
         End
         Begin Project1.ArmCombobox cbo_GSK 
            Height          =   345
            Index           =   3
            Left            =   9300
            TabIndex        =   407
            Top             =   1980
            Width           =   3540
            _ExtentX        =   6244
            _ExtentY        =   609
         End
         Begin Project1.ArmCombobox cbo_GSK 
            Height          =   345
            Index           =   2
            Left            =   3030
            TabIndex        =   408
            Top             =   2040
            Width           =   3540
            _ExtentX        =   6244
            _ExtentY        =   609
         End
         Begin Project1.ArmCombobox cbo_GSK 
            Height          =   345
            Index           =   1
            Left            =   6150
            TabIndex        =   409
            Top             =   4455
            Width           =   3540
            _ExtentX        =   6244
            _ExtentY        =   609
         End
         Begin VB.Label lbl_Label 
            BackColor       =   &H00FFFFFF&
            Caption         =   "F"
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   238
               Weight          =   700
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   255
            Index           =   164
            Left            =   8415
            TabIndex        =   413
            Tag             =   "_lbl_Side"
            Top             =   3600
            Width           =   225
         End
         Begin VB.Label lbl_Label 
            BackColor       =   &H00FFFFFF&
            Caption         =   "E"
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   238
               Weight          =   700
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   255
            Index           =   163
            Left            =   7140
            TabIndex        =   412
            Tag             =   "_lbl_Side"
            Top             =   3615
            Width           =   360
         End
         Begin VB.Label lbl_Label 
            BackColor       =   &H00FFFFFF&
            Caption         =   "D"
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   238
               Weight          =   700
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   240
            Index           =   162
            Left            =   7755
            TabIndex        =   411
            Tag             =   "_lbl_Side"
            Top             =   3825
            Width           =   360
         End
         Begin VB.Label lbl_Label 
            BackColor       =   &H00FFFFFF&
            Caption         =   "C"
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   8.25
               Charset         =   238
               Weight          =   700
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   255
            Index           =   161
            Left            =   7755
            TabIndex        =   410
            Tag             =   "_lbl_Side"
            Top             =   3390
            Width           =   360
         End
         Begin VB.Shape Shape3 
            BackStyle       =   1  'Opaque
            BorderWidth     =   2
            Height          =   795
            Left            =   7020
            Top             =   3345
            Width           =   1665
         End
      End
      Begin MSComctlLib.TabStrip tbs_Gasket 
         Height          =   360
         Left            =   30
         TabIndex        =   431
         Tag             =   "tbs_Gasket"
         Top             =   990
         Width           =   15705
         _ExtentX        =   27702
         _ExtentY        =   635
         _Version        =   393216
         BeginProperty Tabs {1EFB6598-857C-11D1-B16A-00C0F0283628} 
            NumTabs         =   2
            BeginProperty Tab1 {1EFB659A-857C-11D1-B16A-00C0F0283628} 
               Caption         =   "#Gasket"
               Key             =   "GSK"
               Object.Tag             =   "Gasket"
               ImageVarType    =   2
            EndProperty
            BeginProperty Tab2 {1EFB659A-857C-11D1-B16A-00C0F0283628} 
               Caption         =   "#Spacer"
               Key             =   "SPC"
               Object.Tag             =   "Spacer"
               ImageVarType    =   2
            EndProperty
         EndProperty
      End
      Begin VB.Label lbl_Label 
         Caption         =   "#Gap E [mm]"
         Height          =   255
         Index           =   18
         Left            =   6735
         TabIndex        =   461
         Tag             =   "lbl_GapE"
         Top             =   300
         Width           =   1200
      End
      Begin VB.Label lbl_Label 
         Caption         =   "#Gap F [mm]"
         Height          =   255
         Index           =   17
         Left            =   6750
         TabIndex        =   460
         Tag             =   "lbl_GapF"
         Top             =   660
         Width           =   1170
      End
      Begin VB.Label lbl_Label 
         Caption         =   "#Gap D [mm]"
         Height          =   255
         Index           =   13
         Left            =   4845
         TabIndex        =   459
         Tag             =   "lbl_GapD"
         Top             =   660
         Width           =   1185
      End
      Begin VB.Label lbl_Label 
         Caption         =   "#Gap C [mm]"
         Height          =   255
         Index           =   12
         Left            =   4845
         TabIndex        =   458
         Tag             =   "lbl_GapC"
         Top             =   300
         Width           =   1200
      End
      Begin VB.Label lbl_Label 
         Caption         =   "#Panel width B [mm]"
         Height          =   255
         Index           =   80
         Left            =   2430
         TabIndex        =   457
         Tag             =   "lbl_PanelB_"
         Top             =   660
         Width           =   1635
      End
      Begin VB.Label lbl_Label 
         Caption         =   "#Panel length A [mm]"
         Height          =   255
         Index           =   81
         Left            =   30
         TabIndex        =   456
         Tag             =   "lbl_PanelA_"
         Top             =   660
         Width           =   1680
      End
      Begin VB.Label lbl_Label 
         Caption         =   "#Module width [mm]"
         Height          =   255
         Index           =   82
         Left            =   2445
         TabIndex        =   455
         Tag             =   "lbl_ModuleB_"
         Top             =   300
         Width           =   1650
      End
      Begin VB.Label lbl_Label 
         Caption         =   "#Module length [mm]"
         Height          =   255
         Index           =   83
         Left            =   30
         TabIndex        =   454
         Tag             =   "lbl_ModuleA_"
         Top             =   300
         Width           =   1695
      End
   End
   Begin VB.Frame fra_Step 
      Height          =   1305
      Index           =   6
      Left            =   6855
      TabIndex        =   38
      Tag             =   "fra_Coating"
      Top             =   2280
      Width           =   3105
      Begin VB.Frame fra_CoatingAttributes 
         Caption         =   "#Coating attributes"
         Height          =   1320
         Left            =   105
         TabIndex        =   62
         Tag             =   "fra_CoatingAttributes"
         Top             =   1020
         Width           =   14955
         Begin VB.CheckBox chk_SideVisible 
            Caption         =   "#Side F visible"
            Enabled         =   0   'False
            Height          =   480
            Index           =   3
            Left            =   12570
            TabIndex        =   66
            Tag             =   "chk_CoatingSideVisibleF"
            Top             =   630
            Width           =   2235
         End
         Begin VB.CheckBox chk_SideVisible 
            Caption         =   "#Side E visible"
            Enabled         =   0   'False
            Height          =   480
            Index           =   2
            Left            =   10305
            TabIndex        =   67
            Tag             =   "chk_CoatingSideVisibleE"
            Top             =   630
            Width           =   2235
         End
         Begin VB.CheckBox chk_SideVisible 
            Caption         =   "#Side D visible"
            Enabled         =   0   'False
            Height          =   480
            Index           =   1
            Left            =   8100
            TabIndex        =   68
            Tag             =   "chk_CoatingSideVisibleD"
            Top             =   630
            Width           =   2235
         End
         Begin VB.Frame fra_CoatingSide 
            BorderStyle     =   0  'None
            Height          =   960
            Left            =   75
            TabIndex        =   63
            Tag             =   "fra_CoatingSide"
            Top             =   225
            Width           =   3585
            Begin VB.OptionButton opt_CoatingSide 
               Caption         =   "#One side coated"
               Height          =   330
               Index           =   0
               Left            =   0
               TabIndex        =   673
               TabStop         =   0   'False
               Tag             =   "opt_CoatingSideOne"
               Top             =   0
               Width           =   3525
            End
            Begin VB.OptionButton opt_CoatingSide 
               Caption         =   "#Corrosive protection, backside full coverage"
               Height          =   330
               Index           =   2
               Left            =   0
               TabIndex        =   675
               TabStop         =   0   'False
               Tag             =   "opt_CoatingSideFull"
               Top             =   615
               Width           =   3540
            End
            Begin VB.OptionButton opt_CoatingSide 
               Caption         =   "#Both side coated"
               Height          =   330
               Index           =   1
               Left            =   0
               TabIndex        =   674
               TabStop         =   0   'False
               Tag             =   "opt_CoatingSideBoth"
               Top             =   300
               Width           =   3510
            End
         End
         Begin VB.CheckBox chk_NotchingClosed 
            Caption         =   "#Side F notching closed"
            Enabled         =   0   'False
            Height          =   480
            Index           =   3
            Left            =   12570
            TabIndex        =   580
            Tag             =   "chk_CoatingNotchingClosedF"
            Top             =   150
            Width           =   2235
         End
         Begin VB.CheckBox chk_NotchingClosed 
            Caption         =   "#Side E notching closed"
            Enabled         =   0   'False
            Height          =   480
            Index           =   2
            Left            =   10305
            TabIndex        =   579
            Tag             =   "chk_CoatingNotchingClosedE"
            Top             =   150
            Width           =   2235
         End
         Begin VB.CheckBox chk_NotchingClosed 
            Caption         =   "#Side D notching closed"
            Enabled         =   0   'False
            Height          =   480
            Index           =   1
            Left            =   8100
            TabIndex        =   578
            Tag             =   "chk_CoatingNotchingClosedD"
            Top             =   150
            Width           =   2235
         End
         Begin VB.CheckBox chk_NotchingClosed 
            Caption         =   "#Side C notching closed"
            Enabled         =   0   'False
            Height          =   480
            Index           =   0
            Left            =   5910
            TabIndex        =   577
            Tag             =   "chk_CoatingNotchingClosedC"
            Top             =   150
            Width           =   2235
         End
         Begin VB.CheckBox chk_SideVisible 
            Caption         =   "#Side C visible"
            Enabled         =   0   'False
            Height          =   480
            Index           =   0
            Left            =   5910
            TabIndex        =   69
            Tag             =   "chk_CoatingSideVisibleC"
            Top             =   630
            Width           =   2235
         End
         Begin VB.OptionButton opt_CoatingMaterial 
            Caption         =   "#Powder"
            Height          =   330
            Index           =   0
            Left            =   3690
            TabIndex        =   65
            TabStop         =   0   'False
            Tag             =   "opt_CoatingMaterialPowder"
            Top             =   165
            Value           =   -1  'True
            Visible         =   0   'False
            Width           =   1980
         End
         Begin VB.OptionButton opt_CoatingMaterial 
            Caption         =   "#Paint"
            Height          =   330
            Index           =   1
            Left            =   3690
            TabIndex        =   64
            TabStop         =   0   'False
            Tag             =   "opt_CoatingMaterialPaint"
            Top             =   570
            Visible         =   0   'False
            Width           =   1980
         End
      End
      Begin VB.Frame fra_Price 
         Height          =   1230
         Index           =   6
         Left            =   150
         TabIndex        =   51
         Tag             =   "fra_CoatingPrice"
         Top             =   8550
         Width           =   6555
         Begin VB.TextBox txt_Price 
            Alignment       =   1  'Right Justify
            Height          =   300
            Index           =   25
            Left            =   3240
            TabIndex        =   56
            Tag             =   "txt_CoatingSetupCharge_A"
            Top             =   810
            Width           =   800
         End
         Begin VB.TextBox txt_Price 
            Alignment       =   1  'Right Justify
            Height          =   300
            Index           =   24
            Left            =   3240
            TabIndex        =   55
            Tag             =   "txt_CoatingPrice_A"
            Top             =   435
            Width           =   800
         End
         Begin VB.TextBox txt_Price 
            Alignment       =   1  'Right Justify
            Height          =   300
            Index           =   26
            Left            =   4185
            TabIndex        =   54
            Tag             =   "txt_CoatingPrice_M"
            Top             =   435
            Width           =   800
         End
         Begin VB.TextBox txt_Price 
            Alignment       =   1  'Right Justify
            Height          =   300
            Index           =   27
            Left            =   4185
            TabIndex        =   53
            Tag             =   "txt_CoatingSetupCharge_M"
            Top             =   825
            Width           =   800
         End
         Begin VB.CheckBox chk_Price 
            Caption         =   "#Setup charge per coating"
            Height          =   345
            Index           =   4
            Left            =   135
            TabIndex        =   52
            Tag             =   "chk_CoatingSetupCharge"
            Top             =   780
            Width           =   3075
         End
         Begin VB.Label lbl_Label 
            Caption         =   "#Coating price"
            Height          =   255
            Index           =   22
            Left            =   105
            TabIndex        =   61
            Tag             =   "lbl_CoatingPrice"
            Top             =   435
            Width           =   1665
         End
         Begin VB.Label lbl_Label 
            Caption         =   "#Auto"
            Height          =   255
            Index           =   91
            Left            =   3255
            TabIndex        =   60
            Tag             =   "lbl_CoatingPriceAuto"
            Top             =   165
            Width           =   840
         End
         Begin VB.Label lbl_Label 
            Caption         =   "#Manual"
            Height          =   255
            Index           =   92
            Left            =   4185
            TabIndex        =   59
            Tag             =   "lbl_CoatingPriceManual"
            Top             =   180
            Width           =   840
         End
         Begin VB.Label lbl_Price 
            AutoSize        =   -1  'True
            Caption         =   "#Curr"
            Height          =   195
            Index           =   14
            Left            =   5070
            TabIndex        =   58
            Tag             =   "_lbl_CURR_CoatingPrice"
            Top             =   465
            Width           =   390
         End
         Begin VB.Label lbl_Price 
            AutoSize        =   -1  'True
            Caption         =   "#Curr"
            Height          =   195
            Index           =   15
            Left            =   5070
            TabIndex        =   57
            Tag             =   "_lbl_CURR_CoatingSetupCharge"
            Top             =   840
            Width           =   390
         End
      End
      Begin VB.Frame fra_CoatingDetail 
         Caption         =   "#Coating"
         ForeColor       =   &H80000008&
         Height          =   1605
         Left            =   4785
         TabIndex        =   42
         Tag             =   "fra_CoatingDetail"
         Top             =   6945
         Width           =   10245
         Begin VB.TextBox txt_Textbox 
            Height          =   330
            Index           =   107
            Left            =   690
            TabIndex        =   45
            Tag             =   "COA_Code"
            Top             =   210
            Width           =   2010
         End
         Begin VB.TextBox txt_Textbox 
            Height          =   330
            Index           =   108
            Left            =   3555
            TabIndex        =   44
            Tag             =   "COA_Name"
            Top             =   180
            Width           =   6600
         End
         Begin VB.TextBox txt_Textbox 
            Height          =   705
            Index           =   109
            Left            =   120
            TabIndex        =   43
            Tag             =   "COA_Desc"
            Top             =   810
            Width           =   10035
         End
         Begin VB.Label lbl_Label 
            Caption         =   "#Code"
            Height          =   255
            Index           =   20
            Left            =   90
            TabIndex        =   48
            Tag             =   "lbl_CoatingCode"
            Top             =   270
            Width           =   615
         End
         Begin VB.Label lbl_Label 
            Caption         =   "#Name"
            Height          =   255
            Index           =   21
            Left            =   2745
            TabIndex        =   47
            Tag             =   "lbl_CoatingName"
            Top             =   225
            Width           =   855
         End
         Begin VB.Label lbl_Label 
            Caption         =   "#Description"
            Height          =   255
            Index           =   43
            Left            =   135
            TabIndex        =   46
            Tag             =   "lbl_CoatingDesc"
            Top             =   555
            Width           =   2700
         End
      End
      Begin VB.Frame fra_CoaSelection 
         Caption         =   "#Coating selection"
         Height          =   690
         Left            =   120
         TabIndex        =   39
         Tag             =   "fra_StandardCoating"
         Top             =   225
         Width           =   14940
         Begin VB.OptionButton opt_StandardCoating 
            Caption         =   "#Standard RAL 9010"
            Height          =   270
            Index           =   0
            Left            =   345
            TabIndex        =   40
            TabStop         =   0   'False
            Tag             =   "opt_StandardCoating1"
            Top             =   270
            Width           =   2835
         End
         Begin VB.OptionButton opt_StandardCoating 
            Caption         =   "#Other coating"
            Height          =   270
            Index           =   1
            Left            =   3270
            TabIndex        =   41
            TabStop         =   0   'False
            Tag             =   "opt_OtherCoating"
            Top             =   270
            Width           =   2805
         End
      End
      Begin Project1.ArmGrid grd_Coating 
         Height          =   4485
         Left            =   4785
         TabIndex        =   49
         Tag             =   "grd_Coating"
         Top             =   2460
         Width           =   10245
         _ExtentX        =   18071
         _ExtentY        =   7911
      End
      Begin Project1.ArmTreeView tvw_Coating 
         Height          =   6120
         Left            =   120
         TabIndex        =   50
         Tag             =   "tvw_Coating"
         Top             =   2460
         Width           =   4620
         _ExtentX        =   8149
         _ExtentY        =   10795
      End
   End
   Begin VB.Frame fra_Step 
      Height          =   885
      Index           =   4
      Left            =   360
      TabIndex        =   500
      Tag             =   "fra_Packing"
      Top             =   2070
      Width           =   1245
      Begin VB.CheckBox chk_SpcPkg 
         Caption         =   "#Thermo pallette"
         Height          =   285
         Left            =   1905
         TabIndex        =   648
         Tag             =   "chk_SpcPkg"
         Top             =   1395
         Width           =   4485
      End
      Begin VB.TextBox txt_Textbox 
         BackColor       =   &H8000000F&
         Height          =   345
         Index           =   118
         Left            =   1920
         TabIndex        =   515
         TabStop         =   0   'False
         Tag             =   "RPL_PU_"
         Top             =   945
         Width           =   1605
      End
      Begin VB.Frame fra_Price 
         Height          =   1875
         Index           =   4
         Left            =   150
         TabIndex        =   508
         Tag             =   "fra_PackingPrice"
         Top             =   4725
         Width           =   6795
         Begin VB.TextBox txt_Price 
            Alignment       =   1  'Right Justify
            Height          =   345
            Index           =   49
            Left            =   2730
            Locked          =   -1  'True
            TabIndex        =   569
            TabStop         =   0   'False
            Tag             =   "txt_LabelingPrice_M"
            Text            =   "0"
            Top             =   945
            Width           =   800
         End
         Begin VB.TextBox txt_Price 
            Alignment       =   1  'Right Justify
            Height          =   345
            Index           =   48
            Left            =   1800
            Locked          =   -1  'True
            TabIndex        =   568
            TabStop         =   0   'False
            Tag             =   "txt_LabelingPrice_A"
            Text            =   "0"
            Top             =   945
            Width           =   800
         End
         Begin VB.TextBox txt_Price 
            Alignment       =   1  'Right Justify
            Height          =   345
            Index           =   22
            Left            =   1800
            Locked          =   -1  'True
            TabIndex        =   510
            TabStop         =   0   'False
            Tag             =   "txt_PackingPrice_A"
            Text            =   "0"
            Top             =   540
            Width           =   800
         End
         Begin VB.TextBox txt_Price 
            Alignment       =   1  'Right Justify
            Height          =   345
            Index           =   23
            Left            =   2730
            Locked          =   -1  'True
            TabIndex        =   509
            TabStop         =   0   'False
            Tag             =   "txt_PackingPrice_M"
            Text            =   "0"
            Top             =   540
            Width           =   800
         End
         Begin VB.Label lbl_Price 
            AutoSize        =   -1  'True
            Caption         =   "#Curr"
            Height          =   195
            Index           =   26
            Left            =   3615
            TabIndex        =   571
            Tag             =   "_lbl_CURR_LabelingPrice"
            Top             =   990
            Width           =   390
         End
         Begin VB.Label lbl_Label 
            Caption         =   "#Labeling cost"
            Height          =   255
            Index           =   187
            Left            =   105
            TabIndex        =   570
            Tag             =   "lbl_LabelingPrice"
            Top             =   990
            Width           =   1530
         End
         Begin VB.Label lbl_Label 
            Caption         =   "#Packaging cost"
            Height          =   255
            Index           =   4
            Left            =   105
            TabIndex        =   514
            Tag             =   "lbl_PackingPrice"
            Top             =   585
            Width           =   1530
         End
         Begin VB.Label lbl_Label 
            Caption         =   "#Auto"
            Height          =   255
            Index           =   89
            Left            =   1860
            TabIndex        =   513
            Tag             =   "lbl_PackingPriceAuto"
            Top             =   195
            Width           =   795
         End
         Begin VB.Label lbl_Label 
            Caption         =   "#Manual"
            Height          =   255
            Index           =   90
            Left            =   2730
            TabIndex        =   512
            Tag             =   "lbl_PackingPriceManual"
            Top             =   195
            Width           =   840
         End
         Begin VB.Label lbl_Price 
            AutoSize        =   -1  'True
            Caption         =   "#Curr"
            Height          =   195
            Index           =   11
            Left            =   3615
            TabIndex        =   511
            Tag             =   "_lbl_CURR_PackingPrice"
            Top             =   585
            Width           =   390
         End
      End
      Begin VB.Frame fra_LabelLogo 
         Caption         =   "#Label logo"
         Height          =   2220
         Left            =   8115
         TabIndex        =   502
         Tag             =   "fra_LabelLogo"
         Top             =   1560
         Width           =   6735
         Begin VB.OptionButton opt_PackLogo 
            Caption         =   "#Armstrong"
            Height          =   285
            Index           =   0
            Left            =   360
            TabIndex        =   507
            Tag             =   "opt_PackLogoArmstrong"
            Top             =   270
            Value           =   -1  'True
            Width           =   2340
         End
         Begin VB.OptionButton opt_PackLogo 
            Caption         =   "#GEMA"
            Height          =   285
            Index           =   1
            Left            =   360
            TabIndex        =   506
            Tag             =   "opt_PackLogoGema"
            Top             =   652
            Width           =   2340
         End
         Begin VB.OptionButton opt_PackLogo 
            Caption         =   "#Customer logo"
            Height          =   285
            Index           =   2
            Left            =   360
            TabIndex        =   505
            Tag             =   "opt_PackLogoCustomer"
            Top             =   1019
            Width           =   2340
         End
         Begin VB.OptionButton opt_PackLogo 
            Caption         =   "#Empty"
            Height          =   285
            Index           =   3
            Left            =   360
            TabIndex        =   504
            Tag             =   "opt_PackLogoEmpty"
            Top             =   1365
            Width           =   2340
         End
         Begin VB.OptionButton opt_PackLogo 
            Caption         =   "#Position label"
            Height          =   285
            Index           =   4
            Left            =   360
            TabIndex        =   503
            Tag             =   "opt_PackLogoPosition"
            Top             =   1755
            Width           =   2340
         End
      End
      Begin VB.TextBox txt_Textbox 
         Height          =   285
         Index           =   117
         Left            =   8100
         MaxLength       =   100
         TabIndex        =   501
         Tag             =   "RPL_LabTxt"
         Top             =   4170
         Width           =   6690
      End
      Begin Project1.ArmCombobox cbo_Packing 
         Height          =   345
         Left            =   1920
         TabIndex        =   516
         Top             =   495
         Width           =   4590
         _ExtentX        =   8096
         _ExtentY        =   609
      End
      Begin Project1.ArmCombobox cbo_LabelLanguage 
         Height          =   345
         Left            =   10155
         TabIndex        =   517
         Top             =   1050
         Width           =   4590
         _ExtentX        =   8096
         _ExtentY        =   609
      End
      Begin Project1.ArmCombobox cbo_Labeling 
         Height          =   345
         Left            =   10155
         TabIndex        =   566
         Tag             =   "cbo_Labeling"
         Top             =   585
         Width           =   4590
         _ExtentX        =   8096
         _ExtentY        =   609
      End
      Begin VB.Label lbl_Label 
         Caption         =   "#Labeling"
         Height          =   255
         Index           =   186
         Left            =   8130
         TabIndex        =   567
         Tag             =   "lbl_Labeling"
         Top             =   630
         Width           =   1215
      End
      Begin VB.Label lbl_Label 
         Caption         =   "#Packing"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   238
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Index           =   46
         Left            =   90
         TabIndex        =   521
         Tag             =   "lbl_Packing"
         Top             =   570
         Width           =   1200
      End
      Begin VB.Label lbl_Label 
         Caption         =   "#Packing units"
         Height          =   255
         Index           =   47
         Left            =   75
         TabIndex        =   520
         Tag             =   "lbl_PackingUnits"
         Top             =   990
         Width           =   1215
      End
      Begin VB.Label lbl_Label 
         Caption         =   "#Label language"
         Height          =   255
         Index           =   136
         Left            =   8130
         TabIndex        =   519
         Tag             =   "lbl_LabelLanguage"
         Top             =   1095
         Width           =   1215
      End
      Begin VB.Label lbl_Label 
         Caption         =   "#Label free text"
         Height          =   255
         Index           =   137
         Left            =   8085
         TabIndex        =   518
         Tag             =   "lbl_PackLabelFreeText"
         Top             =   3900
         Width           =   1215
      End
   End
   Begin VB.Frame fra_Step 
      Height          =   945
      Index           =   1
      Left            =   3165
      TabIndex        =   345
      Tag             =   "fra_Bending"
      Top             =   675
      Width           =   1155
      Begin VB.PictureBox pct_Bending 
         Appearance      =   0  'Flat
         AutoRedraw      =   -1  'True
         AutoSize        =   -1  'True
         BackColor       =   &H80000005&
         ForeColor       =   &H80000008&
         Height          =   2500
         Index           =   3
         Left            =   9870
         ScaleHeight     =   2475
         ScaleWidth      =   4665
         TabIndex        =   387
         Top             =   4635
         Width           =   4700
      End
      Begin VB.PictureBox pct_Bending 
         Appearance      =   0  'Flat
         AutoRedraw      =   -1  'True
         AutoSize        =   -1  'True
         BackColor       =   &H80000005&
         ForeColor       =   &H80000008&
         Height          =   2500
         Index           =   1
         Left            =   5055
         ScaleHeight     =   2475
         ScaleWidth      =   4665
         TabIndex        =   386
         Top             =   7365
         Width           =   4700
      End
      Begin VB.PictureBox pct_Bending 
         Appearance      =   0  'Flat
         AutoRedraw      =   -1  'True
         AutoSize        =   -1  'True
         BackColor       =   &H80000005&
         ForeColor       =   &H80000008&
         Height          =   2500
         Index           =   0
         Left            =   5055
         ScaleHeight     =   2475
         ScaleWidth      =   4665
         TabIndex        =   385
         Top             =   1845
         Width           =   4700
      End
      Begin VB.PictureBox pct_Bending 
         Appearance      =   0  'Flat
         AutoRedraw      =   -1  'True
         AutoSize        =   -1  'True
         BackColor       =   &H80000005&
         ForeColor       =   &H80000008&
         Height          =   2500
         Index           =   2
         Left            =   120
         ScaleHeight     =   2475
         ScaleWidth      =   4665
         TabIndex        =   383
         Top             =   4620
         Width           =   4700
      End
      Begin VB.Frame fra_Price 
         Height          =   1605
         Index           =   1
         Left            =   9840
         TabIndex        =   382
         Tag             =   "fra_BendindPrice"
         Top             =   150
         Visible         =   0   'False
         Width           =   4710
      End
      Begin VB.Frame fra_Bending 
         Height          =   2775
         Index           =   0
         Left            =   135
         TabIndex        =   373
         Tag             =   "fra_Bending0"
         Top             =   1785
         Width           =   4695
         Begin VB.CheckBox chk_RPL_NClo 
            Caption         =   "#Notch closed"
            Height          =   285
            Index           =   1
            Left            =   2415
            TabIndex        =   573
            Tag             =   "chk_BendingNotchClosedD"
            Top             =   2220
            Width           =   2175
         End
         Begin VB.CheckBox chk_RPL_NClo 
            Caption         =   "#Notch closed"
            Height          =   285
            Index           =   0
            Left            =   150
            TabIndex        =   572
            Tag             =   "chk_BendingNotchClosedC"
            Top             =   2220
            Width           =   2175
         End
         Begin VB.TextBox txt_Textbox 
            Height          =   345
            Index           =   11
            Left            =   2310
            TabIndex        =   378
            Tag             =   "RPL_HC"
            Top             =   405
            Width           =   675
         End
         Begin VB.TextBox txt_Textbox 
            Height          =   345
            Index           =   12
            Left            =   3510
            TabIndex        =   377
            Tag             =   "RPL_HD"
            Top             =   420
            Width           =   675
         End
         Begin VB.CheckBox chk_RPL_BVis 
            Caption         =   "#Visible"
            Height          =   285
            Index           =   0
            Left            =   150
            TabIndex        =   376
            Tag             =   "chk_BendingSideVisibleC"
            Top             =   2445
            Width           =   2175
         End
         Begin VB.CheckBox chk_RPL_BVis 
            Caption         =   "#Visible"
            Height          =   285
            Index           =   1
            Left            =   2415
            TabIndex        =   375
            Tag             =   "chk_BendingSideVisibleD"
            Top             =   2445
            Width           =   2175
         End
         Begin VB.CheckBox chk_StandardBendingA 
            Caption         =   "#Standard values"
            Height          =   210
            Left            =   255
            TabIndex        =   374
            Tag             =   "chk_BendingStandardA"
            Top             =   0
            Width           =   2505
         End
         Begin VB.Frame fra_BendingUZA 
            Height          =   1515
            Left            =   45
            TabIndex        =   583
            Tag             =   "fra_BendingUZA"
            Top             =   720
            Width           =   4605
            Begin VB.CheckBox chk_StandardUZSA 
               Caption         =   "#Standard"
               Height          =   210
               Left            =   210
               TabIndex        =   638
               Tag             =   "chk_StandardUZSA"
               Top             =   -15
               Width           =   1710
            End
            Begin VB.TextBox txt_Textbox 
               Height          =   345
               Index           =   32
               Left            =   2265
               TabIndex        =   584
               Tag             =   "RPL_UC"
               Top             =   135
               Width           =   675
            End
            Begin VB.TextBox txt_Textbox 
               Height          =   345
               Index           =   34
               Left            =   3465
               TabIndex        =   585
               Tag             =   "RPL_UD"
               Top             =   135
               Width           =   675
            End
            Begin VB.TextBox txt_Textbox 
               Height          =   345
               Index           =   92
               Left            =   3465
               TabIndex        =   588
               Tag             =   "RPL_UMinD"
               Top             =   465
               Width           =   675
            End
            Begin VB.TextBox txt_Textbox 
               Height          =   345
               Index           =   93
               Left            =   2265
               TabIndex        =   589
               Tag             =   "RPL_UMinC"
               Top             =   465
               Width           =   675
            End
            Begin VB.TextBox txt_Textbox 
               Height          =   345
               Index           =   94
               Left            =   3465
               TabIndex        =   590
               Tag             =   "RPL_UMaxD"
               Top             =   795
               Width           =   675
            End
            Begin VB.TextBox txt_Textbox 
               Height          =   345
               Index           =   95
               Left            =   2265
               TabIndex        =   591
               Tag             =   "RPL_UMaxC"
               Top             =   795
               Width           =   675
            End
            Begin VB.TextBox txt_Textbox 
               Height          =   345
               Index           =   33
               Left            =   2265
               TabIndex        =   586
               Tag             =   "RPL_SC"
               Top             =   1125
               Width           =   675
            End
            Begin VB.TextBox txt_Textbox 
               Height          =   345
               Index           =   35
               Left            =   3465
               TabIndex        =   587
               Tag             =   "RPL_SD"
               Top             =   1125
               Width           =   675
            End
            Begin VB.Label lbl_Label 
               Caption         =   "#Size U/Z max [mm]"
               Height          =   255
               Index           =   29
               Left            =   75
               TabIndex        =   595
               Tag             =   "lbl_BendingSizeUZMaxA"
               Top             =   840
               Width           =   1890
            End
            Begin VB.Label lbl_Label 
               Caption         =   "#Size U/Z min [mm]"
               Height          =   255
               Index           =   26
               Left            =   75
               TabIndex        =   594
               Tag             =   "lbl_BendingSizeUZMinA"
               Top             =   510
               Width           =   1860
            End
            Begin VB.Label lbl_Label 
               Caption         =   "#Size S [mm]"
               Height          =   255
               Index           =   107
               Left            =   75
               TabIndex        =   593
               Tag             =   "lbl_BendingSizeSA"
               Top             =   1170
               Width           =   1860
            End
            Begin VB.Label lbl_Label 
               Caption         =   "#Size U/Z [mm]"
               Height          =   300
               Index           =   106
               Left            =   75
               TabIndex        =   592
               Tag             =   "lbl_BendingSizeUZA"
               Top             =   225
               Width           =   1860
            End
         End
         Begin VB.Label lbl_Label 
            Caption         =   "#Height h [mm]"
            Height          =   255
            Index           =   103
            Left            =   105
            TabIndex        =   381
            Tag             =   "lbl_BendingSizeHA"
            Top             =   405
            Width           =   1110
         End
         Begin VB.Label lbl_Label 
            Caption         =   "#Side C"
            Height          =   255
            Index           =   104
            Left            =   2325
            TabIndex        =   380
            Tag             =   "lbl_BendingSideC"
            Top             =   195
            Width           =   885
         End
         Begin VB.Label lbl_Label 
            Caption         =   "#Side D"
            Height          =   255
            Index           =   105
            Left            =   3510
            TabIndex        =   379
            Tag             =   "lbl_BendingSideD"
            Top             =   195
            Width           =   885
         End
      End
      Begin VB.Frame fra_Technical 
         Caption         =   "#Coil definition"
         Height          =   2790
         Index           =   0
         Left            =   9900
         TabIndex        =   361
         Tag             =   "fra_Bending1"
         Top             =   7200
         Width           =   4695
         Begin VB.TextBox txt_Tech 
            BackColor       =   &H00FFFFC0&
            Height          =   345
            Index           =   1
            Left            =   1455
            TabIndex        =   364
            Tag             =   "RPL_CoilW"
            Top             =   645
            Width           =   810
         End
         Begin VB.TextBox txt_Tech 
            BackColor       =   &H00FFFFC0&
            Height          =   345
            Index           =   13
            Left            =   1455
            TabIndex        =   362
            Tag             =   "RPL_CoWMin"
            Top             =   240
            Width           =   810
         End
         Begin VB.TextBox txt_Tech 
            BackColor       =   &H00FFFFC0&
            Height          =   345
            Index           =   14
            Left            =   3765
            TabIndex        =   363
            Tag             =   "RPL_CoWMax"
            Top             =   255
            Width           =   810
         End
         Begin VB.TextBox txt_Tech 
            BackColor       =   &H00FFFFC0&
            Height          =   345
            Index           =   15
            Left            =   3765
            TabIndex        =   365
            TabStop         =   0   'False
            Tag             =   "RPL_Thick"
            Top             =   645
            Width           =   810
         End
         Begin VB.TextBox txt_Tech 
            BackColor       =   &H00FFFFC0&
            Height          =   345
            Index           =   21
            Left            =   3765
            TabIndex        =   367
            Tag             =   "RPL_CutB"
            Top             =   1035
            Width           =   810
         End
         Begin VB.TextBox txt_Tech 
            BackColor       =   &H00FFFFC0&
            Height          =   345
            Index           =   22
            Left            =   1455
            TabIndex        =   366
            Tag             =   "RPL_CutA"
            Top             =   1035
            Width           =   810
         End
         Begin VB.Label lbl_Label 
            Caption         =   "#Coil width [mm]"
            Height          =   255
            Index           =   97
            Left            =   90
            TabIndex        =   555
            Tag             =   "lbl_CoilWidth"
            Top             =   690
            Width           =   1410
         End
         Begin VB.Label lbl_Label 
            Caption         =   "#Width min [mm]"
            Height          =   255
            Index           =   114
            Left            =   90
            TabIndex        =   372
            Tag             =   "lbl_RPL_CoWMin"
            Top             =   300
            Width           =   1410
         End
         Begin VB.Label lbl_Label 
            Caption         =   "#Width max [mm]"
            Height          =   255
            Index           =   115
            Left            =   2355
            TabIndex        =   371
            Tag             =   "lbl_RPL_CoWMax"
            Top             =   300
            Width           =   1380
         End
         Begin VB.Label lbl_Label 
            Caption         =   "#Thickness [mm]"
            Height          =   255
            Index           =   116
            Left            =   2355
            TabIndex        =   370
            Tag             =   "lbl_CoilThickness"
            Top             =   690
            Width           =   1380
         End
         Begin VB.Label lbl_Label 
            Caption         =   "#Cut width [mm]"
            Height          =   255
            Index           =   126
            Left            =   2355
            TabIndex        =   369
            Tag             =   "lbl_RPL_CutB"
            Top             =   1080
            Width           =   1215
         End
         Begin VB.Label lbl_Label 
            Caption         =   "#Cut length [mm]"
            Height          =   255
            Index           =   127
            Left            =   90
            TabIndex        =   368
            Tag             =   "lbl_RPL_CutA"
            Top             =   1065
            Width           =   1245
         End
      End
      Begin VB.Frame fra_Bending 
         Height          =   2865
         Index           =   2
         Left            =   165
         TabIndex        =   352
         Tag             =   "fra_Bending2"
         Top             =   7200
         Width           =   4695
         Begin VB.CheckBox chk_RPL_NClo 
            Caption         =   "#Notch closed"
            Height          =   270
            Index           =   3
            Left            =   2400
            TabIndex        =   575
            Tag             =   "chk_BendingNotchClosedF"
            Top             =   2295
            Width           =   2175
         End
         Begin VB.CheckBox chk_RPL_NClo 
            Caption         =   "#Notch closed"
            Height          =   285
            Index           =   2
            Left            =   195
            TabIndex        =   574
            Tag             =   "chk_BendingNotchClosedE"
            Top             =   2265
            Width           =   2175
         End
         Begin VB.TextBox txt_Textbox 
            Height          =   345
            Index           =   30
            Left            =   2250
            TabIndex        =   357
            Tag             =   "RPL_HE"
            Top             =   450
            Width           =   675
         End
         Begin VB.TextBox txt_Textbox 
            Height          =   345
            Index           =   31
            Left            =   3420
            TabIndex        =   356
            Tag             =   "RPL_HF"
            Top             =   450
            Width           =   675
         End
         Begin VB.CheckBox chk_RPL_BVis 
            Caption         =   "#Visible"
            Height          =   285
            Index           =   2
            Left            =   195
            TabIndex        =   355
            Tag             =   "chk_BendingSideVisibleE"
            Top             =   2490
            Width           =   2175
         End
         Begin VB.CheckBox chk_RPL_BVis 
            Caption         =   "#Visible"
            Height          =   285
            Index           =   3
            Left            =   2400
            TabIndex        =   354
            Tag             =   "chk_BendingSideVisibleF"
            Top             =   2505
            Width           =   2175
         End
         Begin VB.CheckBox chk_StandardBendingB 
            Caption         =   "#Standard values"
            Height          =   210
            Left            =   270
            TabIndex        =   353
            Tag             =   "chk_BendingStandardB"
            Top             =   15
            Width           =   2685
         End
         Begin VB.Frame fra_BendingUZB 
            Height          =   1515
            Left            =   60
            TabIndex        =   596
            Tag             =   "fra_BendingUZB"
            Top             =   765
            Width           =   4590
            Begin VB.CheckBox chk_StandardUZSB 
               Caption         =   "#Standard"
               Height          =   210
               Left            =   210
               TabIndex        =   637
               Tag             =   "chk_StandardUZSB"
               Top             =   0
               Width           =   1635
            End
            Begin VB.TextBox txt_Textbox 
               Height          =   345
               Index           =   36
               Left            =   2190
               TabIndex        =   597
               Tag             =   "RPL_UE"
               Top             =   210
               Width           =   675
            End
            Begin VB.TextBox txt_Textbox 
               Height          =   345
               Index           =   38
               Left            =   3360
               TabIndex        =   598
               Tag             =   "RPL_UF"
               Top             =   210
               Width           =   675
            End
            Begin VB.TextBox txt_Textbox 
               Height          =   345
               Index           =   96
               Left            =   2685
               TabIndex        =   601
               Tag             =   "RPL_UMinF"
               Top             =   1080
               Visible         =   0   'False
               Width           =   675
            End
            Begin VB.TextBox txt_Textbox 
               Height          =   345
               Index           =   97
               Left            =   1230
               TabIndex        =   602
               Tag             =   "RPL_UMinE"
               Top             =   1095
               Visible         =   0   'False
               Width           =   675
            End
            Begin VB.TextBox txt_Textbox 
               Height          =   345
               Index           =   98
               Left            =   3390
               TabIndex        =   603
               Tag             =   "RPL_UMaxF"
               Top             =   1080
               Visible         =   0   'False
               Width           =   675
            End
            Begin VB.TextBox txt_Textbox 
               Height          =   345
               Index           =   99
               Left            =   1920
               TabIndex        =   604
               Tag             =   "RPL_UMaxE"
               Top             =   1080
               Visible         =   0   'False
               Width           =   675
            End
            Begin VB.TextBox txt_Textbox 
               Height          =   345
               Index           =   37
               Left            =   2190
               TabIndex        =   599
               Tag             =   "RPL_SE"
               Top             =   540
               Width           =   675
            End
            Begin VB.TextBox txt_Textbox 
               Height          =   345
               Index           =   39
               Left            =   3360
               TabIndex        =   600
               Tag             =   "RPL_SF"
               Top             =   540
               Width           =   675
            End
            Begin VB.Label lbl_Label 
               Caption         =   "#Size S [mm]"
               Height          =   255
               Index           =   112
               Left            =   60
               TabIndex        =   606
               Tag             =   "lbl_BendingSizeSB"
               Top             =   585
               Width           =   1800
            End
            Begin VB.Label lbl_Label 
               Caption         =   "#Size U/Z [mm]"
               Height          =   255
               Index           =   111
               Left            =   60
               TabIndex        =   605
               Tag             =   "lbl_BendingSizeUZB"
               Top             =   285
               Width           =   1800
            End
         End
         Begin VB.Label lbl_Label 
            Caption         =   "#Height h [mm]"
            Height          =   255
            Index           =   108
            Left            =   135
            TabIndex        =   360
            Tag             =   "lbl_BendingSizeHB"
            Top             =   465
            Width           =   1110
         End
         Begin VB.Label lbl_Label 
            Caption         =   "#Side E"
            Height          =   255
            Index           =   109
            Left            =   2265
            TabIndex        =   359
            Tag             =   "lbl_BendingSideE"
            Top             =   225
            Width           =   885
         End
         Begin VB.Label lbl_Label 
            Caption         =   "#Side F"
            Height          =   255
            Index           =   110
            Left            =   3420
            TabIndex        =   358
            Tag             =   "lbl_BendingSideF"
            Top             =   225
            Width           =   885
         End
      End
      Begin VB.Frame fra_Bending 
         Height          =   2820
         Index           =   3
         Left            =   9855
         TabIndex        =   348
         Tag             =   "fra_Bending3"
         Top             =   1755
         Width           =   4695
         Begin VB.Frame fra_InOutApp 
            Caption         =   "#Application"
            Height          =   804
            Left            =   96
            TabIndex        =   349
            Tag             =   "fra_Application"
            Top             =   180
            Visible         =   0   'False
            Width           =   4512
            Begin VB.OptionButton opt_InOut 
               Caption         =   "#Inside"
               Height          =   276
               Index           =   0
               Left            =   144
               TabIndex        =   351
               Tag             =   "opt_ApplicationInside"
               Top             =   336
               Width           =   1872
            End
            Begin VB.OptionButton opt_InOut 
               Caption         =   "#Outside"
               Height          =   276
               Index           =   1
               Left            =   2484
               TabIndex        =   350
               Tag             =   "opt_ApplicationOutside"
               Top             =   312
               Width           =   1872
            End
         End
      End
      Begin VB.Frame fra_BendingOption 
         Caption         =   "#Bending available options"
         Height          =   1590
         Left            =   150
         TabIndex        =   346
         Tag             =   "fra_AvailableBending"
         Top             =   135
         Width           =   4680
         Begin MSComctlLib.ListView lvw_BendOption 
            Height          =   1305
            Left            =   60
            TabIndex        =   347
            Tag             =   "lvw_BendOption"
            Top             =   210
            Width           =   4515
            _ExtentX        =   7964
            _ExtentY        =   2302
            View            =   3
            LabelEdit       =   1
            LabelWrap       =   -1  'True
            HideSelection   =   0   'False
            HideColumnHeaders=   -1  'True
            _Version        =   393217
            ForeColor       =   -2147483640
            BackColor       =   -2147483643
            BorderStyle     =   1
            Appearance      =   1
            NumItems        =   1
            BeginProperty ColumnHeader(1) {BDD1F052-858B-11D1-B16A-00C0F0283628} 
               Object.Tag             =   "Name"
               Object.Width           =   5292
            EndProperty
         End
      End
      Begin Project1.ArmCombobox cbo_Bending 
         Height          =   345
         Index           =   0
         Left            =   7425
         TabIndex        =   384
         Top             =   4755
         Width           =   1320
         _ExtentX        =   2328
         _ExtentY        =   609
      End
      Begin Project1.ArmCombobox cbo_Bending 
         Height          =   345
         Index           =   3
         Left            =   8265
         TabIndex        =   388
         Top             =   5940
         Width           =   1320
         _ExtentX        =   2328
         _ExtentY        =   609
      End
      Begin Project1.ArmCombobox cbo_Bending 
         Height          =   345
         Index           =   1
         Left            =   7425
         TabIndex        =   389
         Top             =   6660
         Width           =   1320
         _ExtentX        =   2328
         _ExtentY        =   609
      End
      Begin Project1.ArmCombobox cbo_Bending 
         Height          =   345
         Index           =   2
         Left            =   5115
         TabIndex        =   390
         Top             =   5955
         Width           =   1320
         _ExtentX        =   2328
         _ExtentY        =   609
      End
      Begin VB.Label lbl_Label 
         Caption         =   "#Changing bendings can have significant implications"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   238
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H000000FF&
         Height          =   765
         Index           =   27
         Left            =   5175
         TabIndex        =   581
         Tag             =   "lbl_ChangeBendingInfo"
         Top             =   690
         Width           =   4440
      End
      Begin VB.Shape Shape1 
         BorderWidth     =   3
         Height          =   2505
         Left            =   5010
         Top             =   4605
         Width           =   4695
      End
      Begin VB.Label lbl_Label 
         Alignment       =   2  'Center
         Caption         =   "E"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   13.5
            Charset         =   238
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   360
         Index           =   75
         Left            =   5115
         TabIndex        =   395
         Tag             =   "_lbl_BndSideE"
         Top             =   5520
         Width           =   600
      End
      Begin VB.Label lbl_Label 
         Alignment       =   2  'Center
         Caption         =   "C"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   13.5
            Charset         =   238
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   360
         Index           =   72
         Left            =   6765
         TabIndex        =   394
         Tag             =   "_lbl_BndSideC"
         Top             =   4755
         Width           =   600
      End
      Begin VB.Label lbl_Label 
         Alignment       =   2  'Center
         Caption         =   "D"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   13.5
            Charset         =   238
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   360
         Index           =   74
         Left            =   6765
         TabIndex        =   393
         Tag             =   "_lbl_BndSideD"
         Top             =   6645
         Width           =   600
      End
      Begin VB.Label lbl_Label 
         Alignment       =   2  'Center
         Caption         =   "F"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   13.5
            Charset         =   238
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   360
         Index           =   73
         Left            =   9000
         TabIndex        =   392
         Tag             =   "_lbl_BndSideF"
         Top             =   5550
         Width           =   600
      End
      Begin VB.Label lbl_Label 
         Alignment       =   2  'Center
         Caption         =   "#View from back of tile"
         Height          =   255
         Index           =   128
         Left            =   5970
         TabIndex        =   391
         Tag             =   "lbl_BendingViewInfo"
         Top             =   5550
         Width           =   2835
      End
   End
   Begin VB.Frame fra_Step 
      Height          =   1140
      Index           =   12
      Left            =   11280
      TabIndex        =   522
      Tag             =   "fra_Summary"
      Top             =   4800
      Width           =   2730
      Begin VB.Frame fra_OptAttributes 
         Height          =   675
         Left            =   870
         TabIndex        =   656
         Tag             =   "fra_OptAttributes"
         Top             =   1020
         Width           =   6135
         Begin Project1.ArmCombobox cbo_Level 
            Height          =   345
            Left            =   1920
            TabIndex        =   657
            Top             =   210
            Width           =   630
            _ExtentX        =   1111
            _ExtentY        =   609
         End
         Begin VB.Label lbl_Label 
            Caption         =   "#Level"
            Height          =   255
            Index           =   138
            Left            =   90
            TabIndex        =   658
            Tag             =   "lbl_SummaryLevel"
            Top             =   255
            Width           =   1755
         End
      End
      Begin VB.Frame fra_PanelSummary 
         Caption         =   "#Summary"
         Height          =   2700
         Left            =   5835
         TabIndex        =   551
         Tag             =   "fra_PanelSummary"
         Top             =   930
         Width           =   4695
         Begin Project1.ArmGrid grd_Summary 
            Height          =   2415
            Left            =   180
            TabIndex        =   552
            Tag             =   "grd_Summary"
            Top             =   225
            Width           =   4365
            _ExtentX        =   7699
            _ExtentY        =   4260
         End
      End
      Begin VB.Frame fra_Price 
         Height          =   660
         Index           =   12
         Left            =   10320
         TabIndex        =   523
         Tag             =   "fra_AttribPrice"
         Top             =   5295
         Visible         =   0   'False
         Width           =   630
      End
      Begin MSComctlLib.TabStrip tbs_Summary 
         Height          =   375
         Left            =   270
         TabIndex        =   553
         Tag             =   "tbs_Summary"
         Top             =   180
         Width           =   15165
         _ExtentX        =   26749
         _ExtentY        =   661
         _Version        =   393216
         BeginProperty Tabs {1EFB6598-857C-11D1-B16A-00C0F0283628} 
            NumTabs         =   1
            BeginProperty Tab1 {1EFB659A-857C-11D1-B16A-00C0F0283628} 
               Caption         =   "#Summary"
               Key             =   "fra_PanelSummary"
               Object.Tag             =   "fra_PanelSummary"
               ImageVarType    =   2
            EndProperty
         EndProperty
      End
   End
   Begin VB.Frame fra_Step 
      Height          =   1290
      Index           =   5
      Left            =   3945
      TabIndex        =   258
      Tag             =   "fra_Inlay"
      Top             =   2115
      Width           =   1680
      Begin VB.Frame fra_InlayAttributes 
         Height          =   2700
         Left            =   9480
         TabIndex        =   291
         Tag             =   "fra_InlayAttributes"
         Top             =   225
         Width           =   5685
         Begin VB.PictureBox pct_Inlay 
            Appearance      =   0  'Flat
            AutoRedraw      =   -1  'True
            BackColor       =   &H80000005&
            ForeColor       =   &H80000008&
            Height          =   1455
            Left            =   75
            ScaleHeight     =   1425
            ScaleWidth      =   5475
            TabIndex        =   292
            Tag             =   "pct_Inlay"
            Top             =   1155
            Width           =   5505
         End
         Begin VB.Frame fra_SteelPlate 
            Caption         =   "#Top cover plate"
            Height          =   1005
            Left            =   45
            TabIndex        =   293
            Tag             =   "fra_SteelPlate"
            Top             =   135
            Visible         =   0   'False
            Width           =   5565
            Begin VB.OptionButton opt_TopPlate 
               Caption         =   "#Plate with notch"
               Height          =   225
               Index           =   2
               Left            =   3420
               TabIndex        =   557
               Tag             =   "opt_PlateNotch"
               Top             =   285
               Width           =   2040
            End
            Begin VB.TextBox txt_Textbox 
               Alignment       =   1  'Right Justify
               Height          =   300
               Index           =   40
               Left            =   4200
               TabIndex        =   296
               Tag             =   "RPL_PlCnt"
               Top             =   630
               Width           =   690
            End
            Begin VB.OptionButton opt_TopPlate 
               Caption         =   "#None"
               Height          =   225
               Index           =   0
               Left            =   120
               TabIndex        =   295
               Tag             =   "opt_PlateNone"
               Top             =   285
               Width           =   1335
            End
            Begin VB.OptionButton opt_TopPlate 
               Caption         =   "#Plate with rivet"
               Height          =   225
               Index           =   1
               Left            =   1440
               TabIndex        =   294
               Tag             =   "opt_PlateRivet"
               Top             =   285
               Width           =   1965
            End
            Begin VB.Label lbl_Label 
               Caption         =   "#Rivet/notch count"
               Height          =   255
               Index           =   8
               Left            =   1965
               TabIndex        =   297
               Tag             =   "lbl_RivetNotchCount"
               Top             =   645
               Width           =   2175
            End
         End
      End
      Begin VB.Frame fra_InlaySelection 
         Height          =   570
         Left            =   90
         TabIndex        =   289
         Tag             =   "fra_InlaySelection"
         Top             =   165
         Width           =   8550
         Begin VB.CheckBox chk_NoInlay 
            Caption         =   "#No Inlay"
            Height          =   210
            Left            =   165
            TabIndex        =   290
            Tag             =   "chk_NoInlay"
            Top             =   225
            Width           =   4650
         End
      End
      Begin VB.Frame fra_Inlay 
         Caption         =   "#Inlay"
         Height          =   7080
         Left            =   60
         TabIndex        =   259
         Tag             =   "fra_InlayDetail"
         Top             =   2910
         Width           =   15105
         Begin VB.CommandButton btn_Inlay 
            Caption         =   "..."
            Height          =   315
            Left            =   8955
            TabIndex        =   663
            Tag             =   "btn_Inlay"
            Top             =   4950
            Width           =   420
         End
         Begin VB.Frame fra_InlayType 
            Caption         =   "#Type"
            Height          =   3180
            Left            =   75
            TabIndex        =   659
            Tag             =   "fra_InlayType"
            Top             =   930
            Width           =   3285
            Begin VB.OptionButton opt_InlayType 
               Caption         =   "#Customized"
               Height          =   270
               Index           =   2
               Left            =   150
               TabIndex        =   662
               Tag             =   "opt_InlayTypeCustomized"
               Top             =   1155
               Width           =   2940
            End
            Begin VB.OptionButton opt_InlayType 
               Caption         =   "#Acoustical pad"
               Height          =   270
               Index           =   1
               Left            =   150
               TabIndex        =   661
               Tag             =   "opt_InlayTypeAcousticalPad"
               Top             =   727
               Width           =   2940
            End
            Begin VB.OptionButton opt_InlayType 
               Caption         =   "#Fleece"
               Height          =   270
               Index           =   0
               Left            =   150
               TabIndex        =   660
               Tag             =   "opt_InlayTypeFleece"
               Top             =   300
               Width           =   2940
            End
         End
         Begin Project1.ArmCombobox cbo_InlayDelivery 
            Height          =   345
            Left            =   1680
            TabIndex        =   609
            Top             =   6465
            Width           =   3210
            _ExtentX        =   5662
            _ExtentY        =   609
         End
         Begin VB.TextBox txt_Textbox 
            BackColor       =   &H00FFFFFF&
            Height          =   315
            Index           =   105
            Left            =   6900
            TabIndex        =   261
            Tag             =   "INL_Code"
            Top             =   4245
            Width           =   2460
         End
         Begin VB.TextBox txt_Textbox 
            Height          =   1095
            Index           =   102
            Left            =   1680
            TabIndex        =   264
            Tag             =   "INL_Desc"
            Top             =   5325
            Visible         =   0   'False
            Width           =   7695
         End
         Begin VB.Frame fra_Price 
            Height          =   1245
            Index           =   5
            Left            =   9720
            TabIndex        =   274
            Tag             =   "fra_InlayPrice"
            Top             =   5415
            Width           =   5130
            Begin VB.TextBox txt_Price 
               Alignment       =   1  'Right Justify
               Height          =   300
               Index           =   19
               Left            =   3420
               TabIndex        =   279
               Tag             =   "txt_InlaySetupCharge_M"
               Top             =   870
               Width           =   800
            End
            Begin VB.TextBox txt_Price 
               Alignment       =   1  'Right Justify
               Height          =   300
               Index           =   18
               Left            =   3420
               TabIndex        =   278
               Tag             =   "txt_InlayPrice_M"
               Top             =   495
               Width           =   800
            End
            Begin VB.TextBox txt_Price 
               Alignment       =   1  'Right Justify
               Height          =   300
               Index           =   16
               Left            =   2475
               TabIndex        =   277
               Tag             =   "txt_InlayPrice_A"
               Top             =   480
               Width           =   800
            End
            Begin VB.TextBox txt_Price 
               Alignment       =   1  'Right Justify
               Height          =   300
               Index           =   17
               Left            =   2475
               TabIndex        =   276
               Tag             =   "txt_InlaySetupCharge_A"
               Top             =   855
               Width           =   800
            End
            Begin VB.CheckBox chk_Price 
               Caption         =   "#Setup charge per call"
               Height          =   240
               Index           =   3
               Left            =   90
               TabIndex        =   275
               Tag             =   "chk_InlaySetupCharge"
               Top             =   870
               Width           =   2355
            End
            Begin VB.Label lbl_Label 
               Caption         =   "#Manual"
               Height          =   255
               Index           =   86
               Left            =   3435
               TabIndex        =   284
               Tag             =   "lbl_InlayPriceManual"
               Top             =   195
               Width           =   705
            End
            Begin VB.Label lbl_Label 
               Caption         =   "#Auto"
               Height          =   255
               Index           =   85
               Left            =   2520
               TabIndex        =   283
               Tag             =   "lbl_InlayPriceAuto"
               Top             =   195
               Width           =   645
            End
            Begin VB.Label lbl_Label 
               Caption         =   "#Inlay price"
               Height          =   255
               Index           =   25
               Left            =   165
               TabIndex        =   282
               Tag             =   "lbl_InlayPrice"
               Top             =   480
               Width           =   1665
            End
            Begin VB.Label lbl_Price 
               AutoSize        =   -1  'True
               Caption         =   "#Curr"
               Height          =   195
               Index           =   12
               Left            =   4305
               TabIndex        =   281
               Tag             =   "_lbl_CURR_InlayPrice"
               Top             =   555
               Width           =   390
            End
            Begin VB.Label lbl_Price 
               AutoSize        =   -1  'True
               Caption         =   "#Curr"
               Height          =   195
               Index           =   13
               Left            =   4305
               TabIndex        =   280
               Tag             =   "_lbl_CURR_InlaySetupCharge"
               Top             =   930
               Width           =   390
            End
         End
         Begin VB.Frame fra_InlaySize 
            Height          =   1185
            Left            =   9720
            TabIndex        =   265
            Tag             =   "fra_InlaySize"
            Top             =   4215
            Width           =   5100
            Begin VB.CheckBox chk_StandardInlay 
               Caption         =   "#Standard size"
               Height          =   240
               Left            =   315
               TabIndex        =   560
               Tag             =   "chk_InlayStandard"
               Top             =   -15
               Width           =   2985
            End
            Begin VB.TextBox txt_Textbox 
               BackColor       =   &H00FFFFC0&
               Height          =   315
               Index           =   104
               Left            =   4065
               TabIndex        =   268
               Tag             =   "INL_Surface"
               Top             =   420
               Width           =   870
            End
            Begin VB.TextBox txt_Textbox 
               BackColor       =   &H00FFFFC0&
               Height          =   315
               Index           =   8
               Left            =   1770
               TabIndex        =   267
               Tag             =   "PIN_SizeA"
               Top             =   405
               Width           =   870
            End
            Begin VB.TextBox txt_Textbox 
               BackColor       =   &H00FFFFC0&
               Height          =   315
               Index           =   17
               Left            =   1770
               TabIndex        =   266
               Tag             =   "PIN_SizeB"
               Top             =   780
               Width           =   870
            End
            Begin VB.Label lbl_Label 
               Caption         =   "#Inlay size [m2]"
               Height          =   255
               Index           =   123
               Left            =   2685
               TabIndex        =   271
               Tag             =   "lbl_InlaySize"
               Top             =   435
               Width           =   1665
            End
            Begin VB.Label lbl_Label 
               Caption         =   "#Inlay length A [mm]"
               Height          =   255
               Index           =   70
               Left            =   120
               TabIndex        =   270
               Tag             =   "lbl_InlayA"
               Top             =   435
               Width           =   1665
            End
            Begin VB.Label lbl_Label 
               Caption         =   "#Inlay width B [mm]"
               Height          =   255
               Index           =   71
               Left            =   120
               TabIndex        =   269
               Tag             =   "lbl_InlayB"
               Top             =   795
               Width           =   1665
            End
         End
         Begin VB.TextBox txt_Textbox 
            Height          =   315
            Index           =   101
            Left            =   1695
            TabIndex        =   263
            Tag             =   "INL_Name"
            Top             =   4965
            Width           =   7200
         End
         Begin VB.TextBox txt_Textbox 
            Height          =   315
            Index           =   29
            Left            =   1695
            TabIndex        =   260
            Tag             =   "INL_TypeDesc"
            Top             =   4245
            Width           =   3255
         End
         Begin VB.TextBox txt_Textbox 
            Height          =   315
            Index           =   90
            Left            =   1695
            TabIndex        =   262
            Tag             =   "INL_Vend"
            Top             =   4605
            Width           =   7665
         End
         Begin Project1.ArmGrid grd_InlayDetail 
            Height          =   3165
            Left            =   3450
            TabIndex        =   272
            Tag             =   "grd_InlayDetail"
            Top             =   1005
            Width           =   11430
            _ExtentX        =   17542
            _ExtentY        =   5583
         End
         Begin Project1.ToolbarControl tlb_InlayDetail 
            Height          =   690
            Left            =   120
            TabIndex        =   273
            Tag             =   "2913"
            Top             =   225
            Width           =   14835
            _ExtentX        =   26167
            _ExtentY        =   1217
         End
         Begin Project1.ArmCombobox cbo_InlayPurchase 
            Height          =   345
            Left            =   6510
            TabIndex        =   610
            Top             =   6465
            Width           =   2895
            _ExtentX        =   5106
            _ExtentY        =   609
         End
         Begin VB.Label lbl_Label 
            Caption         =   "#Purchase type"
            Height          =   255
            Index           =   189
            Left            =   5025
            TabIndex        =   608
            Tag             =   "lbl_InlayPurchase"
            Top             =   6525
            Width           =   1485
         End
         Begin VB.Label lbl_Label 
            Caption         =   "#Kind of delivery"
            Height          =   255
            Index           =   188
            Left            =   90
            TabIndex        =   607
            Tag             =   "lbl_InlayDelivery"
            Top             =   6525
            Width           =   1665
         End
         Begin VB.Label lbl_Label 
            Caption         =   "#Inlay code"
            Height          =   255
            Index           =   124
            Left            =   4980
            TabIndex        =   558
            Tag             =   "lbl_InlayCode"
            Top             =   4275
            Width           =   1830
         End
         Begin VB.Label lbl_Label 
            Caption         =   "#Name"
            Height          =   255
            Index           =   156
            Left            =   120
            TabIndex        =   288
            Tag             =   "lbl_InlayName"
            Top             =   4995
            Width           =   1665
         End
         Begin VB.Label lbl_Label 
            Caption         =   "#Description"
            Height          =   255
            Index           =   68
            Left            =   135
            TabIndex        =   287
            Tag             =   "lbl_InlayDesc"
            Top             =   5355
            Width           =   1665
         End
         Begin VB.Label lbl_Label 
            Caption         =   "#Type"
            Height          =   255
            Index           =   154
            Left            =   135
            TabIndex        =   286
            Tag             =   "lbl_InlayType"
            Top             =   4275
            Width           =   1665
         End
         Begin VB.Label lbl_Label 
            Caption         =   "#Vendor"
            Height          =   255
            Index           =   155
            Left            =   120
            TabIndex        =   285
            Tag             =   "lbl_InlayVendor"
            Top             =   4635
            Width           =   1665
         End
      End
      Begin Project1.ArmGrid grd_Inlay 
         Height          =   2115
         Left            =   90
         TabIndex        =   298
         Tag             =   "grd_Inlay"
         Top             =   795
         Width           =   8580
         _ExtentX        =   15134
         _ExtentY        =   3731
      End
      Begin Project1.ToolbarControl tlb_InlayMain 
         Height          =   2700
         Left            =   8715
         TabIndex        =   299
         Tag             =   "2912"
         Top             =   195
         Width           =   690
         _ExtentX        =   1217
         _ExtentY        =   4763
      End
   End
   Begin VB.Frame fra_Step 
      Height          =   1230
      Index           =   11
      Left            =   8205
      TabIndex        =   497
      Tag             =   "fra_OptSurcharge"
      Top             =   4560
      Width           =   2115
      Begin VB.Frame fra_Price 
         Height          =   735
         Index           =   11
         Left            =   13065
         TabIndex        =   498
         Tag             =   "fra_OptionPrice"
         Top             =   7995
         Visible         =   0   'False
         Width           =   1815
      End
      Begin Project1.ArmGrid grd_Option 
         Height          =   7620
         Left            =   120
         TabIndex        =   499
         Tag             =   "grd_Option"
         Top             =   210
         Width           =   14970
         _ExtentX        =   26405
         _ExtentY        =   13441
      End
   End
   Begin VB.Frame fra_Step 
      Height          =   1185
      Index           =   7
      Left            =   11370
      TabIndex        =   194
      Tag             =   "fra_Ventilation"
      Top             =   2505
      Width           =   1980
      Begin VB.Frame fra_Cutout 
         Height          =   7875
         Index           =   0
         Left            =   84
         TabIndex        =   196
         Tag             =   "fra_VentDetail"
         Top             =   1980
         Width           =   14955
         Begin VB.Frame fra_PerfBorderV 
            Caption         =   "#Unperforated border"
            Height          =   1944
            Left            =   96
            TabIndex        =   234
            Tag             =   "fra_PerfBorderV"
            Top             =   6072
            Visible         =   0   'False
            Width           =   6852
            Begin VB.CheckBox chk_CorrectStepV 
               Caption         =   "#Corrected step"
               Height          =   312
               Left            =   4290
               TabIndex        =   248
               Tag             =   "chk_VentCorrectedStep"
               Top             =   720
               Width           =   2415
            End
            Begin VB.CheckBox chk_StandardPerfV 
               Caption         =   "#Standard values"
               Height          =   312
               Left            =   4290
               TabIndex        =   247
               Tag             =   "chk_VentStandardValues"
               Top             =   372
               Width           =   2475
            End
            Begin VB.TextBox txt_Textbox 
               Height          =   345
               Index           =   65
               Left            =   2610
               TabIndex        =   246
               Tag             =   "PCT_UBoWF_V"
               Text            =   "0"
               Top             =   1428
               Width           =   525
            End
            Begin VB.CheckBox chk_PerfBorderV 
               Caption         =   "#F Side over border [mm]"
               Height          =   270
               Index           =   3
               Left            =   96
               TabIndex        =   245
               Tag             =   "chk_VentBorderF"
               Top             =   1464
               Width           =   2490
            End
            Begin VB.TextBox txt_Textbox 
               Height          =   345
               Index           =   66
               Left            =   3375
               TabIndex        =   244
               Tag             =   "PCT_UBorF_V"
               Text            =   "0"
               Top             =   1428
               Width           =   525
            End
            Begin VB.TextBox txt_Textbox 
               Height          =   345
               Index           =   67
               Left            =   2610
               TabIndex        =   243
               Tag             =   "PCT_UBoWE_V"
               Text            =   "0"
               Top             =   1080
               Width           =   525
            End
            Begin VB.CheckBox chk_PerfBorderV 
               Caption         =   "#E Side over border [mm]"
               Height          =   270
               Index           =   2
               Left            =   96
               TabIndex        =   242
               Tag             =   "chk_VentBorderE"
               Top             =   1116
               Width           =   2475
            End
            Begin VB.TextBox txt_Textbox 
               Height          =   345
               Index           =   68
               Left            =   3375
               TabIndex        =   241
               Tag             =   "PCT_UBorE_V"
               Text            =   "0"
               Top             =   1080
               Width           =   525
            End
            Begin VB.TextBox txt_Textbox 
               Height          =   345
               Index           =   69
               Left            =   2610
               TabIndex        =   240
               Tag             =   "PCT_UBoWD_V"
               Text            =   "0"
               Top             =   732
               Width           =   525
            End
            Begin VB.CheckBox chk_PerfBorderV 
               Caption         =   "#D Side over border [mm]"
               Height          =   270
               Index           =   1
               Left            =   96
               TabIndex        =   239
               Tag             =   "chk_VentBorderD"
               Top             =   768
               Width           =   2475
            End
            Begin VB.TextBox txt_Textbox 
               Height          =   345
               Index           =   70
               Left            =   3375
               TabIndex        =   238
               Tag             =   "PCT_UBorD_V"
               Text            =   "0"
               Top             =   744
               Width           =   525
            End
            Begin VB.TextBox txt_Textbox 
               Height          =   345
               Index           =   71
               Left            =   2610
               TabIndex        =   237
               Tag             =   "PCT_UBoWC_V"
               Text            =   "0"
               Top             =   384
               Width           =   525
            End
            Begin VB.CheckBox chk_PerfBorderV 
               Caption         =   "#C Side over border [mm]"
               Height          =   270
               Index           =   0
               Left            =   96
               TabIndex        =   236
               Tag             =   "chk_VentBorderC"
               Top             =   420
               Width           =   2490
            End
            Begin VB.TextBox txt_Textbox 
               Height          =   345
               Index           =   72
               Left            =   3375
               TabIndex        =   235
               Tag             =   "PCT_UBorC_V"
               Text            =   "0"
               Top             =   384
               Width           =   525
            End
            Begin VB.Label lbl_Label 
               BackColor       =   &H00FFFFFF&
               Caption         =   "C"
               BeginProperty Font 
                  Name            =   "Arial"
                  Size            =   8.25
                  Charset         =   238
                  Weight          =   700
                  Underline       =   0   'False
                  Italic          =   0   'False
                  Strikethrough   =   0   'False
               EndProperty
               Height          =   255
               Index           =   177
               Left            =   4920
               TabIndex        =   254
               Tag             =   "_lbl_Side"
               Top             =   1125
               Width           =   360
            End
            Begin VB.Label lbl_Label 
               BackColor       =   &H00FFFFFF&
               Caption         =   "D"
               BeginProperty Font 
                  Name            =   "Arial"
                  Size            =   8.25
                  Charset         =   238
                  Weight          =   700
                  Underline       =   0   'False
                  Italic          =   0   'False
                  Strikethrough   =   0   'False
               EndProperty
               Height          =   255
               Index           =   178
               Left            =   4920
               TabIndex        =   253
               Tag             =   "_lbl_Side"
               Top             =   1425
               Width           =   360
            End
            Begin VB.Label lbl_Label 
               BackColor       =   &H00FFFFFF&
               Caption         =   "E"
               BeginProperty Font 
                  Name            =   "Arial"
                  Size            =   8.25
                  Charset         =   238
                  Weight          =   700
                  Underline       =   0   'False
                  Italic          =   0   'False
                  Strikethrough   =   0   'False
               EndProperty
               Height          =   255
               Index           =   179
               Left            =   4545
               TabIndex        =   252
               Tag             =   "_lbl_Side"
               Top             =   1275
               Width           =   360
            End
            Begin VB.Label lbl_Label 
               BackColor       =   &H00FFFFFF&
               Caption         =   "F"
               BeginProperty Font 
                  Name            =   "Arial"
                  Size            =   8.25
                  Charset         =   238
                  Weight          =   700
                  Underline       =   0   'False
                  Italic          =   0   'False
                  Strikethrough   =   0   'False
               EndProperty
               Height          =   255
               Index           =   180
               Left            =   5265
               TabIndex        =   251
               Tag             =   "_lbl_Side"
               Top             =   1290
               Width           =   225
            End
            Begin VB.Label lbl_Label 
               Caption         =   "#Wanted"
               Height          =   255
               Index           =   141
               Left            =   2550
               TabIndex        =   250
               Tag             =   "lbl_VentBorderWanted"
               Top             =   150
               Width           =   690
            End
            Begin VB.Label lbl_Label 
               Caption         =   "#Real"
               Height          =   255
               Index           =   142
               Left            =   3420
               TabIndex        =   249
               Tag             =   "lbl_VentBorderReal"
               Top             =   150
               Width           =   570
            End
            Begin VB.Shape shp_VentSides 
               BackStyle       =   1  'Opaque
               BorderWidth     =   2
               Height          =   600
               Left            =   4470
               Top             =   1110
               Width           =   1050
            End
         End
         Begin VB.PictureBox pct_ShapeTypeV 
            Appearance      =   0  'Flat
            AutoRedraw      =   -1  'True
            BackColor       =   &H80000005&
            ForeColor       =   &H80000008&
            Height          =   2700
            Left            =   84
            ScaleHeight     =   2670
            ScaleWidth      =   6825
            TabIndex        =   233
            Top             =   2004
            Width           =   6852
         End
         Begin VB.Frame fra_VentParam 
            Height          =   1344
            Left            =   84
            TabIndex        =   214
            Tag             =   "fra_VentParam"
            Top             =   4740
            Width           =   6864
            Begin VB.TextBox txt_Textbox 
               Height          =   345
               Index           =   56
               Left            =   1668
               TabIndex        =   222
               TabStop         =   0   'False
               Tag             =   "PCT_SizeD_V"
               Text            =   "0"
               Top             =   588
               Width           =   960
            End
            Begin VB.TextBox txt_Textbox 
               Height          =   345
               Index           =   51
               Left            =   4785
               TabIndex        =   220
               TabStop         =   0   'False
               Tag             =   "PCT_SizeM_V"
               Text            =   "0"
               Top             =   924
               Width           =   960
            End
            Begin VB.TextBox txt_Textbox 
               Height          =   345
               Index           =   52
               Left            =   4800
               TabIndex        =   219
               TabStop         =   0   'False
               Tag             =   "PCT_SizeL_V"
               Text            =   "0"
               Top             =   552
               Width           =   960
            End
            Begin VB.TextBox txt_Textbox 
               Height          =   345
               Index           =   53
               Left            =   1656
               TabIndex        =   218
               TabStop         =   0   'False
               Tag             =   "PCT_SizeK_V"
               Text            =   "0"
               Top             =   924
               Width           =   960
            End
            Begin VB.TextBox txt_Textbox 
               Height          =   345
               Index           =   54
               Left            =   1656
               TabIndex        =   217
               TabStop         =   0   'False
               Tag             =   "PCT_SizeJ_V"
               Text            =   "0"
               Top             =   564
               Width           =   960
            End
            Begin VB.CommandButton btn_CenterCutout 
               Caption         =   "#Center"
               Height          =   495
               Index           =   0
               Left            =   5865
               TabIndex        =   216
               Tag             =   "btn_VentCenter"
               Top             =   720
               Width           =   915
            End
            Begin VB.CheckBox chk_StandardVent 
               Caption         =   "#Standard ventilation parameters"
               Height          =   192
               Left            =   195
               TabIndex        =   215
               Tag             =   "chk_StandardVent"
               Top             =   0
               Width           =   3120
            End
            Begin Project1.ArmCombobox cbo_VentPerf 
               Height          =   345
               Left            =   4800
               TabIndex        =   221
               Top             =   195
               Width           =   1965
               _ExtentX        =   3466
               _ExtentY        =   609
            End
            Begin Project1.ArmCombobox cbo_VentArea 
               Height          =   345
               Left            =   1650
               TabIndex        =   223
               Top             =   225
               Width           =   1710
               _ExtentX        =   3016
               _ExtentY        =   609
            End
            Begin VB.Label lbl_VentDiameter 
               Caption         =   "#Area diameter (d)"
               Height          =   255
               Left            =   60
               TabIndex        =   230
               Tag             =   "lbl_VentDiameter"
               Top             =   645
               Width           =   1935
            End
            Begin VB.Label lbl_Label 
               Caption         =   "#Perforation"
               Height          =   252
               Index           =   144
               Left            =   3420
               TabIndex        =   229
               Tag             =   "lbl_VentPerforation"
               Top             =   288
               Width           =   1284
            End
            Begin VB.Label lbl_Label 
               Caption         =   "#Short side border M [mm]"
               Height          =   252
               Index           =   145
               Left            =   2736
               TabIndex        =   228
               Tag             =   "lbl_VentShortSideBorder"
               Top             =   996
               Width           =   1932
            End
            Begin VB.Label lbl_Label 
               Caption         =   "#Long side border L [mm]"
               Height          =   252
               Index           =   146
               Left            =   2736
               TabIndex        =   227
               Tag             =   "lbl_VentLongSideBorder"
               Top             =   636
               Width           =   1932
            End
            Begin VB.Label lbl_VentWidth 
               Caption         =   "#Area width K [mm]"
               Height          =   255
               Left            =   60
               TabIndex        =   226
               Tag             =   "lbl_VentWidth"
               Top             =   990
               Width           =   1935
            End
            Begin VB.Label lbl_VentLength 
               Caption         =   "#Area length J [mm]"
               Height          =   240
               Left            =   108
               TabIndex        =   225
               Tag             =   "lbl_VentLength"
               Top             =   624
               Width           =   1932
            End
            Begin VB.Label lbl_VentArea 
               Caption         =   "#Area size [mmxmm]"
               Height          =   255
               Left            =   60
               TabIndex        =   224
               Tag             =   "lbl_VentAreaSize"
               Top             =   315
               Width           =   1545
            End
         End
         Begin VB.Frame fra_Price 
            Height          =   1404
            Index           =   7
            Left            =   7008
            TabIndex        =   199
            Tag             =   "fra_VentPrice"
            Top             =   6324
            Width           =   7872
            Begin VB.TextBox txt_Price 
               Alignment       =   1  'Right Justify
               Height          =   300
               Index           =   33
               Left            =   6375
               TabIndex        =   207
               Tag             =   "txt_VentAddChange_M"
               Top             =   1020
               Width           =   800
            End
            Begin VB.TextBox txt_Price 
               Alignment       =   1  'Right Justify
               Height          =   300
               Index           =   32
               Left            =   6375
               TabIndex        =   206
               Tag             =   "txt_VentPrice_M"
               Top             =   396
               Width           =   800
            End
            Begin VB.TextBox txt_Price 
               Alignment       =   1  'Right Justify
               Height          =   300
               Index           =   31
               Left            =   6375
               TabIndex        =   205
               Tag             =   "txt_VentSetupCharge_M"
               Top             =   708
               Width           =   800
            End
            Begin VB.TextBox txt_Price 
               Alignment       =   1  'Right Justify
               Height          =   300
               Index           =   29
               Left            =   5430
               TabIndex        =   204
               Tag             =   "txt_VentSetupCharge_A"
               Top             =   708
               Width           =   800
            End
            Begin VB.TextBox txt_Price 
               Alignment       =   1  'Right Justify
               Height          =   300
               Index           =   28
               Left            =   5430
               TabIndex        =   203
               Tag             =   "txt_VentPrice_A"
               Top             =   396
               Width           =   800
            End
            Begin VB.TextBox txt_Price 
               Alignment       =   1  'Right Justify
               Height          =   300
               Index           =   30
               Left            =   5430
               TabIndex        =   202
               Tag             =   "txt_VentAddChange_A"
               Top             =   1020
               Width           =   800
            End
            Begin VB.CheckBox chk_Price 
               Caption         =   "#Setup charge per call"
               Height          =   210
               Index           =   5
               Left            =   165
               TabIndex        =   201
               Tag             =   "chk_VentSetupCharge"
               Top             =   781
               Width           =   5250
            End
            Begin VB.CheckBox chk_Price 
               Caption         =   "#Additional change of position per panel position"
               Height          =   210
               Index           =   6
               Left            =   165
               TabIndex        =   200
               Tag             =   "chk_VentAddChange"
               Top             =   1065
               Width           =   5250
            End
            Begin VB.Label lbl_Label 
               Caption         =   "#Manual"
               Height          =   255
               Index           =   94
               Left            =   6405
               TabIndex        =   213
               Tag             =   "lbl_VentPriceManual"
               Top             =   150
               Width           =   885
            End
            Begin VB.Label lbl_Label 
               Caption         =   "#Auto"
               Height          =   255
               Index           =   93
               Left            =   5445
               TabIndex        =   212
               Tag             =   "lbl_VentPriceAuto"
               Top             =   150
               Width           =   885
            End
            Begin VB.Label lbl_Label 
               Caption         =   "#Ventilation perforation cost"
               Height          =   255
               Index           =   37
               Left            =   165
               TabIndex        =   211
               Tag             =   "lbl_VentPrice"
               Top             =   435
               Width           =   5250
            End
            Begin VB.Label lbl_Price 
               Caption         =   "#Curr"
               Height          =   240
               Index           =   16
               Left            =   7305
               TabIndex        =   210
               Tag             =   "_lbl_CURR_VentPrice"
               Top             =   435
               Width           =   435
            End
            Begin VB.Label lbl_Price 
               Caption         =   "#Curr"
               Height          =   240
               Index           =   17
               Left            =   7305
               TabIndex        =   209
               Tag             =   "_lbl_CURR_VentSetupCharge"
               Top             =   750
               Width           =   435
            End
            Begin VB.Label lbl_Price 
               Caption         =   "#Curr"
               Height          =   240
               Index           =   18
               Left            =   7305
               TabIndex        =   208
               Tag             =   "_lbl_CURR_VentAddChange"
               Top             =   1080
               Width           =   435
            End
         End
         Begin VB.PictureBox pct_Vent 
            Appearance      =   0  'Flat
            AutoRedraw      =   -1  'True
            BackColor       =   &H80000005&
            ForeColor       =   &H80000008&
            Height          =   5448
            Left            =   7008
            ScaleHeight     =   5415
            ScaleWidth      =   7830
            TabIndex        =   198
            Top             =   912
            Width           =   7860
         End
         Begin VB.TextBox txt_Textbox 
            BackColor       =   &H8000000F&
            Height          =   684
            Index           =   148
            Left            =   72
            Locked          =   -1  'True
            MultiLine       =   -1  'True
            TabIndex        =   197
            Tag             =   "VET_Desc"
            Top             =   1290
            Width           =   6864
         End
         Begin Project1.ToolbarControl tlb_CutoutDetail 
            Height          =   690
            Index           =   0
            Left            =   60
            TabIndex        =   231
            Tag             =   "2915"
            Top             =   165
            Width           =   14835
            _ExtentX        =   26167
            _ExtentY        =   1217
         End
         Begin Project1.ArmCombobox cbo_Vent 
            Height          =   345
            Left            =   2145
            TabIndex        =   232
            Top             =   915
            Width           =   4815
            _ExtentX        =   8493
            _ExtentY        =   609
         End
         Begin VB.Label lbl_Label 
            Caption         =   "#Ventilation perforation"
            Height          =   252
            Index           =   32
            Left            =   96
            TabIndex        =   255
            Tag             =   "lbl_VentType"
            Top             =   984
            Width           =   2088
         End
      End
      Begin VB.CheckBox chk_NoVentilation 
         Caption         =   "#No ventilation"
         Height          =   240
         Left            =   120
         TabIndex        =   195
         Tag             =   "chk_NoVentilation"
         Top             =   180
         Width           =   3510
      End
      Begin Project1.ToolbarControl tlb_CutoutMain 
         Height          =   1860
         Index           =   0
         Left            =   14325
         TabIndex        =   256
         Tag             =   "2914"
         Top             =   120
         Width           =   690
         _ExtentX        =   1217
         _ExtentY        =   3281
      End
      Begin Project1.ArmGrid grd_Cutout 
         Height          =   1515
         Index           =   0
         Left            =   90
         TabIndex        =   257
         Tag             =   "grd_Vent"
         Top             =   465
         Width           =   14145
         _ExtentX        =   24950
         _ExtentY        =   2672
      End
   End
   Begin VB.Frame fra_Step 
      Height          =   1095
      Index           =   9
      Left            =   4140
      TabIndex        =   70
      Tag             =   "fra_Cutout"
      Top             =   4425
      Width           =   1920
      Begin VB.Frame fra_Cutout 
         Height          =   7875
         Index           =   2
         Left            =   120
         TabIndex        =   72
         Tag             =   "fra_CutoutDetail"
         Top             =   1980
         Width           =   14955
         Begin VB.PictureBox pct_Cutout 
            Appearance      =   0  'Flat
            AutoRedraw      =   -1  'True
            BackColor       =   &H80000005&
            ForeColor       =   &H80000008&
            Height          =   4932
            Left            =   7080
            ScaleHeight     =   4905
            ScaleWidth      =   7800
            TabIndex        =   124
            Top             =   930
            Width           =   7830
         End
         Begin VB.Frame fra_Price 
            Caption         =   "#Cost"
            Height          =   1836
            Index           =   9
            Left            =   7080
            TabIndex        =   107
            Tag             =   "fra_CutoutPrice"
            Top             =   5970
            Width           =   7830
            Begin VB.TextBox txt_Price 
               Height          =   345
               Index           =   43
               Left            =   5805
               TabIndex        =   118
               TabStop         =   0   'False
               Tag             =   "txt_CutoutSurcharge_A"
               Text            =   "0"
               Top             =   1335
               Width           =   690
            End
            Begin VB.TextBox txt_Price 
               Height          =   345
               Index           =   42
               Left            =   5805
               TabIndex        =   117
               TabStop         =   0   'False
               Tag             =   "txt_CutoutAddChange_A"
               Text            =   "0"
               Top             =   945
               Width           =   690
            End
            Begin VB.TextBox txt_Price 
               Height          =   345
               Index           =   41
               Left            =   5805
               TabIndex        =   116
               TabStop         =   0   'False
               Tag             =   "txt_CutoutSetupCharge_A"
               Text            =   "0"
               Top             =   585
               Width           =   690
            End
            Begin VB.TextBox txt_Price 
               Height          =   345
               Index           =   40
               Left            =   5805
               TabIndex        =   115
               TabStop         =   0   'False
               Tag             =   "txt_CutoutPrice_A"
               Text            =   "0"
               Top             =   195
               Width           =   690
            End
            Begin VB.TextBox txt_Price 
               Height          =   345
               Index           =   44
               Left            =   6495
               TabIndex        =   114
               TabStop         =   0   'False
               Tag             =   "txt_CutoutPrice_M"
               Text            =   "0"
               Top             =   195
               Width           =   690
            End
            Begin VB.TextBox txt_Price 
               Height          =   345
               Index           =   45
               Left            =   6495
               TabIndex        =   113
               TabStop         =   0   'False
               Tag             =   "txt_CutoutSetupCharge_M"
               Text            =   "0"
               Top             =   585
               Width           =   690
            End
            Begin VB.TextBox txt_Price 
               Height          =   345
               Index           =   46
               Left            =   6495
               TabIndex        =   112
               TabStop         =   0   'False
               Tag             =   "txt_CutoutAddChange_M"
               Text            =   "0"
               Top             =   945
               Width           =   690
            End
            Begin VB.TextBox txt_Price 
               Height          =   345
               Index           =   47
               Left            =   6495
               TabIndex        =   111
               TabStop         =   0   'False
               Tag             =   "txt_CutoutSurcharge_M"
               Text            =   "0"
               Top             =   1335
               Width           =   690
            End
            Begin VB.CheckBox chk_Price 
               Caption         =   "#Setup charge per position"
               Height          =   195
               Index           =   9
               Left            =   105
               TabIndex        =   110
               Tag             =   "chk_CutoutSetupCharge"
               Top             =   675
               Width           =   5730
            End
            Begin VB.CheckBox chk_Price 
               Caption         =   "#Additional change of position per pannel position"
               Height          =   195
               Index           =   10
               Left            =   120
               TabIndex        =   109
               Tag             =   "chk_CutoutAddChange"
               Top             =   1035
               Width           =   5730
            End
            Begin VB.CheckBox chk_Price 
               Caption         =   "#Surcharge at perforated panels for unperforated area around cut-out"
               Height          =   195
               Index           =   11
               Left            =   105
               TabIndex        =   108
               Tag             =   "chk_CutoutSurcharge"
               Top             =   1395
               Width           =   5730
            End
            Begin VB.Label lbl_Label 
               Caption         =   "#Cut-out cost"
               Height          =   255
               Index           =   9
               Left            =   105
               TabIndex        =   123
               Tag             =   "lbl_CutoutPrice"
               Top             =   255
               Width           =   5730
            End
            Begin VB.Label lbl_Price 
               Caption         =   "#Curr"
               Height          =   240
               Index           =   22
               Left            =   7230
               TabIndex        =   122
               Tag             =   "_lbl_CURR_CutoutPrice"
               Top             =   255
               Width           =   435
            End
            Begin VB.Label lbl_Price 
               Caption         =   "#Curr"
               Height          =   240
               Index           =   23
               Left            =   7230
               TabIndex        =   121
               Tag             =   "_lbl_CURR_CutoutSetupCharge"
               Top             =   645
               Width           =   435
            End
            Begin VB.Label lbl_Price 
               Caption         =   "#Curr"
               Height          =   240
               Index           =   24
               Left            =   7230
               TabIndex        =   120
               Tag             =   "_lbl_CURR_CutoutAddChange"
               Top             =   1020
               Width           =   435
            End
            Begin VB.Label lbl_Price 
               Caption         =   "#Curr"
               Height          =   240
               Index           =   25
               Left            =   7230
               TabIndex        =   119
               Tag             =   "_lbl_CURR_CutoutSurcharge"
               Top             =   1380
               Width           =   435
            End
         End
         Begin VB.Frame fra_CutoutParams 
            Caption         =   "#Cutout parameters"
            Height          =   1005
            Left            =   60
            TabIndex        =   95
            Tag             =   "fra_CutoutParams"
            Top             =   4860
            Width           =   6915
            Begin VB.TextBox txt_Textbox 
               Height          =   345
               Index           =   18
               Left            =   1800
               TabIndex        =   101
               TabStop         =   0   'False
               Tag             =   "PCT_SizeD_C"
               Text            =   "0"
               Top             =   168
               Width           =   960
            End
            Begin VB.TextBox txt_Textbox 
               Height          =   345
               Index           =   22
               Left            =   4785
               TabIndex        =   100
               TabStop         =   0   'False
               Tag             =   "PCT_SizeM_C"
               Text            =   "0"
               Top             =   585
               Width           =   960
            End
            Begin VB.TextBox txt_Textbox 
               Height          =   345
               Index           =   21
               Left            =   4785
               TabIndex        =   99
               TabStop         =   0   'False
               Tag             =   "PCT_SizeL_C"
               Text            =   "0"
               Top             =   195
               Width           =   960
            End
            Begin VB.TextBox txt_Textbox 
               Height          =   345
               Index           =   20
               Left            =   1800
               TabIndex        =   98
               TabStop         =   0   'False
               Tag             =   "PCT_SizeK_C"
               Text            =   "0"
               Top             =   540
               Width           =   960
            End
            Begin VB.TextBox txt_Textbox 
               Height          =   345
               Index           =   19
               Left            =   1800
               TabIndex        =   97
               TabStop         =   0   'False
               Tag             =   "PCT_SizeJ_C"
               Text            =   "0"
               Top             =   168
               Width           =   960
            End
            Begin VB.CommandButton btn_CenterCutout 
               Caption         =   "#Center"
               Height          =   495
               Index           =   2
               Left            =   5865
               TabIndex        =   96
               Tag             =   "btn_CutoutCenter"
               Top             =   300
               Width           =   915
            End
            Begin VB.Label lbl_CutoutDiameter 
               Caption         =   "#Cut-out diameter (d)"
               Height          =   255
               Left            =   120
               TabIndex        =   106
               Tag             =   "lbl_CutoutSizeD"
               Top             =   255
               Width           =   1935
            End
            Begin VB.Label lbl_Label 
               Caption         =   "#Short side border M [mm]"
               Height          =   255
               Index           =   35
               Left            =   2835
               TabIndex        =   105
               Tag             =   "lbl_CutoutSizeM"
               Top             =   615
               Width           =   1935
            End
            Begin VB.Label lbl_Label 
               Caption         =   "#Long side border L [mm]"
               Height          =   255
               Index           =   34
               Left            =   2835
               TabIndex        =   104
               Tag             =   "lbl_CutoutSizeL"
               Top             =   240
               Width           =   1935
            End
            Begin VB.Label lbl_CutoutWidth 
               Caption         =   "#Cut-out width K [mm]"
               Height          =   255
               Left            =   120
               TabIndex        =   103
               Tag             =   "lbl_CutoutSizeK"
               Top             =   615
               Width           =   1935
            End
            Begin VB.Label lbl_CutoutLength 
               Caption         =   "#Cut-out length J [mm]"
               Height          =   252
               Left            =   120
               TabIndex        =   102
               Tag             =   "lbl_CutoutSizeJ"
               Top             =   252
               Width           =   1512
            End
         End
         Begin VB.TextBox txt_Textbox 
            BackColor       =   &H8000000F&
            Height          =   705
            Index           =   144
            Left            =   105
            Locked          =   -1  'True
            MultiLine       =   -1  'True
            TabIndex        =   94
            Tag             =   "CUT_Desc"
            Top             =   1365
            Width           =   6840
         End
         Begin VB.PictureBox pct_ShapeTypeC 
            Appearance      =   0  'Flat
            AutoRedraw      =   -1  'True
            BackColor       =   &H80000005&
            ForeColor       =   &H80000008&
            Height          =   2700
            Left            =   90
            ScaleHeight     =   2670
            ScaleWidth      =   6840
            TabIndex        =   93
            Tag             =   "IMG_Id®B®R"
            Top             =   2145
            Width           =   6864
         End
         Begin VB.Frame fra_PerfBorderC 
            Caption         =   "#Unperforated border"
            Height          =   1896
            Left            =   84
            TabIndex        =   73
            Tag             =   "fra_CutoutUnperfBorder"
            Top             =   5868
            Width           =   6852
            Begin VB.CheckBox chk_CorrectStepC 
               Caption         =   "#Corrected step"
               Height          =   312
               Left            =   4155
               TabIndex        =   87
               Tag             =   "chk_CutoutCorrectedStep"
               Top             =   720
               Width           =   2550
            End
            Begin VB.CheckBox chk_StandardPerfC 
               Caption         =   "#Standard values"
               Height          =   312
               Left            =   4155
               TabIndex        =   86
               Tag             =   "chk_CutoutPerfStandardValues"
               Top             =   372
               Width           =   2595
            End
            Begin VB.TextBox txt_Textbox 
               Height          =   345
               Index           =   81
               Left            =   2475
               TabIndex        =   85
               Tag             =   "PCT_UBoWF_C"
               Text            =   "0"
               Top             =   1428
               Width           =   525
            End
            Begin VB.CheckBox chk_PerfBorderC 
               Caption         =   "#F Side over border [mm]"
               Height          =   270
               Index           =   3
               Left            =   96
               TabIndex        =   84
               Tag             =   "chk_CutoutPerfBorderF"
               Top             =   1464
               Width           =   2355
            End
            Begin VB.TextBox txt_Textbox 
               Height          =   345
               Index           =   82
               Left            =   3240
               TabIndex        =   83
               Tag             =   "PCT_UBorF_C"
               Text            =   "0"
               Top             =   1428
               Width           =   525
            End
            Begin VB.TextBox txt_Textbox 
               Height          =   345
               Index           =   83
               Left            =   2475
               TabIndex        =   82
               Tag             =   "PCT_UBoWE_C"
               Text            =   "0"
               Top             =   1065
               Width           =   525
            End
            Begin VB.CheckBox chk_PerfBorderC 
               Caption         =   "#E Side over border [mm]"
               Height          =   270
               Index           =   2
               Left            =   96
               TabIndex        =   81
               Tag             =   "chk_CutoutPerfBorderE"
               Top             =   1116
               Width           =   2370
            End
            Begin VB.TextBox txt_Textbox 
               Height          =   345
               Index           =   84
               Left            =   3240
               TabIndex        =   80
               Tag             =   "PCT_UBorE_C"
               Text            =   "0"
               Top             =   1080
               Width           =   525
            End
            Begin VB.TextBox txt_Textbox 
               Height          =   345
               Index           =   85
               Left            =   2475
               TabIndex        =   79
               Tag             =   "PCT_UBoWD_C"
               Text            =   "0"
               Top             =   732
               Width           =   525
            End
            Begin VB.CheckBox chk_PerfBorderC 
               Caption         =   "#D Side over border [mm]"
               Height          =   270
               Index           =   1
               Left            =   96
               TabIndex        =   78
               Tag             =   "chk_CutoutPerfBorderD"
               Top             =   780
               Width           =   2340
            End
            Begin VB.TextBox txt_Textbox 
               Height          =   345
               Index           =   86
               Left            =   3240
               TabIndex        =   77
               Tag             =   "PCT_UBorD_C"
               Text            =   "0"
               Top             =   744
               Width           =   525
            End
            Begin VB.TextBox txt_Textbox 
               Height          =   345
               Index           =   87
               Left            =   2475
               TabIndex        =   76
               Tag             =   "PCT_UBoWC_C"
               Text            =   "0"
               Top             =   384
               Width           =   525
            End
            Begin VB.CheckBox chk_PerfBorderC 
               Caption         =   "#C Side over border [mm]"
               Height          =   270
               Index           =   0
               Left            =   96
               TabIndex        =   75
               Tag             =   "chk_CutoutPerfBorderC"
               Top             =   420
               Width           =   2355
            End
            Begin VB.TextBox txt_Textbox 
               Height          =   345
               Index           =   88
               Left            =   3240
               TabIndex        =   74
               Tag             =   "PCT_UBorC_C"
               Text            =   "0"
               Top             =   384
               Width           =   525
            End
            Begin VB.Label lbl_Label 
               BackColor       =   &H00FFFFFF&
               Caption         =   "C"
               BeginProperty Font 
                  Name            =   "Arial"
                  Size            =   8.25
                  Charset         =   238
                  Weight          =   700
                  Underline       =   0   'False
                  Italic          =   0   'False
                  Strikethrough   =   0   'False
               EndProperty
               Height          =   255
               Index           =   169
               Left            =   4785
               TabIndex        =   0
               Tag             =   "_lbl_Side"
               Top             =   1140
               Width           =   360
            End
            Begin VB.Label lbl_Label 
               BackColor       =   &H00FFFFFF&
               Caption         =   "D"
               BeginProperty Font 
                  Name            =   "Arial"
                  Size            =   8.25
                  Charset         =   238
                  Weight          =   700
                  Underline       =   0   'False
                  Italic          =   0   'False
                  Strikethrough   =   0   'False
               EndProperty
               Height          =   255
               Index           =   170
               Left            =   4785
               TabIndex        =   92
               Tag             =   "_lbl_Side"
               Top             =   1425
               Width           =   360
            End
            Begin VB.Label lbl_Label 
               BackColor       =   &H00FFFFFF&
               Caption         =   "E"
               BeginProperty Font 
                  Name            =   "Arial"
                  Size            =   8.25
                  Charset         =   238
                  Weight          =   700
                  Underline       =   0   'False
                  Italic          =   0   'False
                  Strikethrough   =   0   'False
               EndProperty
               Height          =   255
               Index           =   171
               Left            =   4410
               TabIndex        =   91
               Tag             =   "_lbl_Side"
               Top             =   1275
               Width           =   360
            End
            Begin VB.Label lbl_Label 
               BackColor       =   &H00FFFFFF&
               Caption         =   "F"
               BeginProperty Font 
                  Name            =   "Arial"
                  Size            =   8.25
                  Charset         =   238
                  Weight          =   700
                  Underline       =   0   'False
                  Italic          =   0   'False
                  Strikethrough   =   0   'False
               EndProperty
               Height          =   255
               Index           =   172
               Left            =   5130
               TabIndex        =   90
               Tag             =   "_lbl_Side"
               Top             =   1290
               Width           =   225
            End
            Begin VB.Label lbl_Label 
               Caption         =   "#Wanted"
               Height          =   255
               Index           =   148
               Left            =   2415
               TabIndex        =   89
               Tag             =   "lbl_CutoutBorderWanted"
               Top             =   150
               Width           =   750
            End
            Begin VB.Label lbl_Label 
               Caption         =   "#Real"
               Height          =   255
               Index           =   149
               Left            =   3285
               TabIndex        =   88
               Tag             =   "lbl_CutoutBorderReal"
               Top             =   150
               Width           =   570
            End
            Begin VB.Shape shp_CutSides 
               BackStyle       =   1  'Opaque
               BorderWidth     =   2
               Height          =   600
               Left            =   4335
               Top             =   1110
               Width           =   1050
            End
         End
         Begin Project1.ArmCombobox cbo_cutout 
            Height          =   345
            Left            =   2205
            TabIndex        =   125
            Top             =   945
            Width           =   4740
            _ExtentX        =   8361
            _ExtentY        =   609
         End
         Begin Project1.ToolbarControl tlb_CutoutDetail 
            Height          =   690
            Index           =   2
            Left            =   60
            TabIndex        =   126
            Tag             =   "2919"
            Top             =   165
            Width           =   14835
            _ExtentX        =   26167
            _ExtentY        =   1217
         End
         Begin VB.Label lbl_Label 
            Caption         =   "#Cut-out type"
            Height          =   255
            Index           =   28
            Left            =   120
            TabIndex        =   127
            Tag             =   "lbl_CutoutType"
            Top             =   1020
            Width           =   2055
         End
      End
      Begin VB.CheckBox chk_NoCutout 
         Caption         =   "#No Cutout"
         Height          =   285
         Left            =   135
         TabIndex        =   71
         Tag             =   "chk_NoCutout"
         Top             =   150
         Width           =   2010
      End
      Begin Project1.ToolbarControl tlb_CutoutMain 
         Height          =   1755
         Index           =   2
         Left            =   14370
         TabIndex        =   128
         Tag             =   "2918"
         Top             =   225
         Width           =   690
         _ExtentX        =   1217
         _ExtentY        =   3096
      End
      Begin Project1.ArmGrid grd_Cutout 
         Height          =   1545
         Index           =   2
         Left            =   135
         TabIndex        =   129
         Tag             =   "grd_Cutout"
         Top             =   450
         Width           =   14190
         _ExtentX        =   25030
         _ExtentY        =   2725
      End
   End
   Begin VB.Frame fra_Step 
      Height          =   1365
      Index           =   8
      Left            =   315
      TabIndex        =   130
      Tag             =   "fra_Loudspeaker"
      Top             =   3780
      Width           =   2535
      Begin VB.Frame fra_Cutout 
         Height          =   7980
         Index           =   1
         Left            =   144
         TabIndex        =   132
         Tag             =   "fra_LoudDetail"
         Top             =   2004
         Width           =   14955
         Begin VB.PictureBox pct_ShapeTypeL 
            Appearance      =   0  'Flat
            AutoRedraw      =   -1  'True
            BackColor       =   &H80000005&
            ForeColor       =   &H80000008&
            Height          =   2520
            Left            =   60
            ScaleHeight     =   2490
            ScaleWidth      =   6840
            TabIndex        =   190
            Top             =   2040
            Width           =   6864
         End
         Begin VB.Frame fra_LoudParams 
            Height          =   1416
            Left            =   60
            TabIndex        =   171
            Tag             =   "fra_LoudParams"
            Top             =   4620
            Width           =   6864
            Begin VB.CommandButton btn_CenterCutout 
               Caption         =   "#Center"
               Height          =   495
               Index           =   1
               Left            =   5865
               TabIndex        =   179
               Tag             =   "btn_LoudCenter"
               Top             =   756
               Width           =   915
            End
            Begin VB.TextBox txt_Textbox 
               Height          =   345
               Index           =   47
               Left            =   1656
               TabIndex        =   178
               TabStop         =   0   'False
               Tag             =   "PCT_SizeJ_L"
               Text            =   "0"
               Top             =   636
               Width           =   960
            End
            Begin VB.TextBox txt_Textbox 
               Height          =   345
               Index           =   48
               Left            =   1665
               TabIndex        =   177
               TabStop         =   0   'False
               Tag             =   "PCT_SizeK_L"
               Text            =   "0"
               Top             =   996
               Width           =   960
            End
            Begin VB.TextBox txt_Textbox 
               Height          =   345
               Index           =   49
               Left            =   4785
               TabIndex        =   176
               TabStop         =   0   'False
               Tag             =   "PCT_SizeL_L"
               Text            =   "0"
               Top             =   648
               Width           =   960
            End
            Begin VB.TextBox txt_Textbox 
               Height          =   345
               Index           =   50
               Left            =   4785
               TabIndex        =   175
               TabStop         =   0   'False
               Tag             =   "PCT_SizeM_L"
               Text            =   "0"
               Top             =   1008
               Width           =   960
            End
            Begin VB.TextBox txt_Textbox 
               Height          =   345
               Index           =   55
               Left            =   1656
               TabIndex        =   173
               TabStop         =   0   'False
               Tag             =   "PCT_SizeD_L"
               Text            =   "0"
               Top             =   636
               Width           =   960
            End
            Begin VB.CheckBox chk_StandardLoud 
               Caption         =   "#Standard loudspeaker parameters"
               Height          =   192
               Left            =   216
               TabIndex        =   172
               Tag             =   "chk_StandardLoud"
               Top             =   30
               Width           =   3156
            End
            Begin Project1.ArmCombobox cbo_LoudPerf 
               Height          =   345
               Left            =   4770
               TabIndex        =   174
               Top             =   285
               Width           =   2040
               _ExtentX        =   3598
               _ExtentY        =   609
            End
            Begin Project1.ArmCombobox cbo_LoudArea 
               Height          =   300
               Left            =   1644
               TabIndex        =   180
               Top             =   312
               Width           =   1704
               _ExtentX        =   3016
               _ExtentY        =   609
            End
            Begin VB.Label lbl_LoudLength 
               Caption         =   "#Area length (J)"
               Height          =   252
               Left            =   120
               TabIndex        =   187
               Tag             =   "lbl_AreaJ"
               Top             =   672
               Width           =   1932
            End
            Begin VB.Label lbl_LoudWidth 
               Caption         =   "#Area width K [mm]"
               Height          =   252
               Left            =   120
               TabIndex        =   186
               Tag             =   "lbl_AreaK"
               Top             =   1068
               Width           =   1932
            End
            Begin VB.Label lbl_Label 
               Caption         =   "#Long side border L [mm]"
               Height          =   252
               Index           =   139
               Left            =   2736
               TabIndex        =   185
               Tag             =   "lbl_LoudSizeL"
               Top             =   696
               Width           =   1932
            End
            Begin VB.Label lbl_Label 
               Caption         =   "#Short side border M [mm]"
               Height          =   252
               Index           =   140
               Left            =   2736
               TabIndex        =   184
               Tag             =   "lbl_LoudSizeM"
               Top             =   1068
               Width           =   1932
            End
            Begin VB.Label lbl_Label 
               Caption         =   "#Perforation"
               Height          =   252
               Index           =   56
               Left            =   3408
               TabIndex        =   183
               Tag             =   "lbl_LoudPerforation"
               Top             =   372
               Width           =   1500
            End
            Begin VB.Label lbl_LoudDiameter 
               Caption         =   "#Area diameter d [mm]"
               Height          =   252
               Left            =   120
               TabIndex        =   182
               Tag             =   "lbl_LoudDiameter"
               Top             =   696
               Width           =   1932
            End
            Begin VB.Label lbl_LoudArea 
               Caption         =   "#Area size [mm]x[mm]"
               Height          =   255
               Left            =   105
               TabIndex        =   181
               Tag             =   "lbl_LoudAreaSize"
               Top             =   345
               Width           =   1590
            End
         End
         Begin VB.TextBox txt_Textbox 
            BackColor       =   &H8000000F&
            Height          =   690
            Index           =   149
            Left            =   60
            Locked          =   -1  'True
            MultiLine       =   -1  'True
            TabIndex        =   170
            Tag             =   "LSP_Desc"
            Top             =   1290
            Width           =   6870
         End
         Begin VB.Frame fra_Price 
            Height          =   1695
            Index           =   8
            Left            =   7020
            TabIndex        =   155
            Tag             =   "fra_LoudPrice"
            Top             =   6192
            Width           =   7860
            Begin VB.TextBox txt_Price 
               Alignment       =   1  'Right Justify
               Height          =   300
               Index           =   39
               Left            =   6435
               TabIndex        =   163
               Tag             =   "txt_LoudAddChange_M"
               Top             =   984
               Width           =   800
            End
            Begin VB.TextBox txt_Price 
               Alignment       =   1  'Right Justify
               Height          =   300
               Index           =   38
               Left            =   6435
               TabIndex        =   162
               Tag             =   "txt_LoudPrice_M"
               Top             =   360
               Width           =   800
            End
            Begin VB.TextBox txt_Price 
               Alignment       =   1  'Right Justify
               Height          =   300
               Index           =   37
               Left            =   6435
               TabIndex        =   161
               Tag             =   "txt_LoudSetupCharge_M"
               Top             =   684
               Width           =   800
            End
            Begin VB.TextBox txt_Price 
               Alignment       =   1  'Right Justify
               Height          =   300
               Index           =   35
               Left            =   5475
               TabIndex        =   160
               Tag             =   "txt_LoudSetupCharge_A"
               Top             =   672
               Width           =   800
            End
            Begin VB.TextBox txt_Price 
               Alignment       =   1  'Right Justify
               Height          =   300
               Index           =   34
               Left            =   5475
               TabIndex        =   159
               Tag             =   "txt_LoudPrice_A"
               Top             =   360
               Width           =   800
            End
            Begin VB.TextBox txt_Price 
               Alignment       =   1  'Right Justify
               Height          =   300
               Index           =   36
               Left            =   5475
               TabIndex        =   158
               Tag             =   "txt_LoudAddChange_A"
               Top             =   984
               Width           =   800
            End
            Begin VB.CheckBox chk_Price 
               Caption         =   "#Setup charge per position"
               Height          =   255
               Index           =   7
               Left            =   120
               TabIndex        =   157
               Tag             =   "chk_LoudSetupCharge"
               Top             =   712
               Width           =   5340
            End
            Begin VB.CheckBox chk_Price 
               Caption         =   "#Additionally change of position per panel"
               Height          =   255
               Index           =   8
               Left            =   120
               TabIndex        =   156
               Tag             =   "chk_LoudAddChange"
               Top             =   1005
               Width           =   5340
            End
            Begin VB.Label lbl_Label 
               Caption         =   "#Manual"
               Height          =   255
               Index           =   96
               Left            =   6435
               TabIndex        =   169
               Tag             =   "lbl_LoudPriceManual"
               Top             =   135
               Width           =   855
            End
            Begin VB.Label lbl_Label 
               Caption         =   "#Auto"
               Height          =   255
               Index           =   95
               Left            =   5490
               TabIndex        =   168
               Tag             =   "lbl_LoudPriceAuto"
               Top             =   135
               Width           =   855
            End
            Begin VB.Label lbl_Label 
               Caption         =   "#Loudspeaker perforation cost"
               Height          =   255
               Index           =   44
               Left            =   120
               TabIndex        =   167
               Tag             =   "lbl_LoudPrice"
               Top             =   420
               Width           =   5340
            End
            Begin VB.Label lbl_Price 
               Caption         =   "#Curr"
               Height          =   240
               Index           =   19
               Left            =   7320
               TabIndex        =   166
               Tag             =   "_lbl_CURR_LoudPrice"
               Top             =   390
               Width           =   435
            End
            Begin VB.Label lbl_Price 
               Caption         =   "#Curr"
               Height          =   240
               Index           =   20
               Left            =   7320
               TabIndex        =   165
               Tag             =   "_lbl_CURR_LoudSetupCharge"
               Top             =   720
               Width           =   435
            End
            Begin VB.Label lbl_Price 
               Caption         =   "#Curr"
               Height          =   240
               Index           =   21
               Left            =   7320
               TabIndex        =   164
               Tag             =   "_lbl_CURR_LoudAddChange"
               Top             =   1035
               Width           =   435
            End
         End
         Begin VB.PictureBox pct_Loud 
            Appearance      =   0  'Flat
            AutoRedraw      =   -1  'True
            BackColor       =   &H80000005&
            ForeColor       =   &H80000008&
            Height          =   5250
            Left            =   7020
            ScaleHeight     =   5220
            ScaleWidth      =   6840
            TabIndex        =   154
            Top             =   930
            Width           =   6876
         End
         Begin VB.Frame fra_PerfBorderL 
            Caption         =   "#Unperforated border"
            Height          =   1860
            Left            =   45
            TabIndex        =   133
            Tag             =   "fra_UnperfBorder"
            Top             =   6030
            Visible         =   0   'False
            Width           =   6852
            Begin VB.TextBox txt_Textbox 
               Height          =   345
               Index           =   73
               Left            =   3765
               TabIndex        =   147
               Tag             =   "PCT_UBorC_L"
               Text            =   "0"
               Top             =   384
               Width           =   525
            End
            Begin VB.CheckBox chk_PerfBorderL 
               Caption         =   "#C Side over border [mm]"
               Height          =   270
               Index           =   0
               Left            =   96
               TabIndex        =   146
               Tag             =   "chk_LoudPerfBorderC"
               Top             =   420
               Width           =   2835
            End
            Begin VB.TextBox txt_Textbox 
               Height          =   345
               Index           =   74
               Left            =   3000
               TabIndex        =   145
               Tag             =   "PCT_UBoWC_L"
               Text            =   "0"
               Top             =   384
               Width           =   525
            End
            Begin VB.TextBox txt_Textbox 
               Height          =   345
               Index           =   75
               Left            =   3765
               TabIndex        =   144
               Tag             =   "PCT_UBorD_L"
               Text            =   "0"
               Top             =   732
               Width           =   525
            End
            Begin VB.CheckBox chk_PerfBorderL 
               Caption         =   "#D Side over border [mm]"
               Height          =   270
               Index           =   1
               Left            =   96
               TabIndex        =   143
               Tag             =   "chk_LoudPerfBorderD"
               Top             =   768
               Width           =   2850
            End
            Begin VB.TextBox txt_Textbox 
               Height          =   345
               Index           =   76
               Left            =   3000
               TabIndex        =   142
               Tag             =   "PCT_UBoWD_L"
               Text            =   "0"
               Top             =   732
               Width           =   525
            End
            Begin VB.TextBox txt_Textbox 
               Height          =   345
               Index           =   77
               Left            =   3765
               TabIndex        =   141
               Tag             =   "PCT_UBorE_L"
               Text            =   "0"
               Top             =   1080
               Width           =   525
            End
            Begin VB.CheckBox chk_PerfBorderL 
               Caption         =   "#E Side over border [mm]"
               Height          =   270
               Index           =   2
               Left            =   96
               TabIndex        =   140
               Tag             =   "chk_LoudPerfBorderE"
               Top             =   1116
               Width           =   2835
            End
            Begin VB.TextBox txt_Textbox 
               Height          =   345
               Index           =   78
               Left            =   3000
               TabIndex        =   139
               Tag             =   "PCT_UBoWE_L"
               Text            =   "0"
               Top             =   1080
               Width           =   525
            End
            Begin VB.TextBox txt_Textbox 
               Height          =   345
               Index           =   79
               Left            =   3765
               TabIndex        =   138
               Tag             =   "PCT_UBorF_L"
               Text            =   "0"
               Top             =   1428
               Width           =   525
            End
            Begin VB.CheckBox chk_PerfBorderL 
               Caption         =   "#F Side over border [mm]"
               Height          =   270
               Index           =   3
               Left            =   96
               TabIndex        =   137
               Tag             =   "chk_LoudPerfBorderF"
               Top             =   1455
               Width           =   2850
            End
            Begin VB.TextBox txt_Textbox 
               Height          =   345
               Index           =   80
               Left            =   3000
               TabIndex        =   136
               Tag             =   "PCT_UBoWF_L"
               Text            =   "0"
               Top             =   1428
               Width           =   525
            End
            Begin VB.CheckBox chk_StandardPerfL 
               Caption         =   "#Standard values"
               Height          =   312
               Left            =   4785
               TabIndex        =   135
               Tag             =   "chk_LoudPerfStandardValues"
               Top             =   390
               Width           =   1965
            End
            Begin VB.CheckBox chk_CorrectStepL 
               Caption         =   "#Corrected step"
               Height          =   312
               Left            =   4785
               TabIndex        =   134
               Tag             =   "chk_LoudCorrectedStep"
               Top             =   1440
               Width           =   1890
            End
            Begin VB.Label lbl_Label 
               Caption         =   "#Real"
               Height          =   255
               Index           =   143
               Left            =   3795
               TabIndex        =   153
               Tag             =   "lbl_LoudPerfBorderReal"
               Top             =   150
               Width           =   570
            End
            Begin VB.Label lbl_Label 
               Caption         =   "#Wanted"
               Height          =   255
               Index           =   147
               Left            =   2940
               TabIndex        =   152
               Tag             =   "lbl_LoudPerfBorderWanted"
               Top             =   150
               Width           =   720
            End
            Begin VB.Label lbl_Label 
               BackColor       =   &H00FFFFFF&
               Caption         =   "F"
               BeginProperty Font 
                  Name            =   "Arial"
                  Size            =   8.25
                  Charset         =   238
                  Weight          =   700
                  Underline       =   0   'False
                  Italic          =   0   'False
                  Strikethrough   =   0   'False
               EndProperty
               Height          =   255
               Index           =   176
               Left            =   5655
               TabIndex        =   151
               Tag             =   "_lbl_Side"
               Top             =   930
               Width           =   225
            End
            Begin VB.Label lbl_Label 
               BackColor       =   &H00FFFFFF&
               Caption         =   "E"
               BeginProperty Font 
                  Name            =   "Arial"
                  Size            =   8.25
                  Charset         =   238
                  Weight          =   700
                  Underline       =   0   'False
                  Italic          =   0   'False
                  Strikethrough   =   0   'False
               EndProperty
               Height          =   255
               Index           =   175
               Left            =   4935
               TabIndex        =   150
               Tag             =   "_lbl_Side"
               Top             =   915
               Width           =   360
            End
            Begin VB.Label lbl_Label 
               BackColor       =   &H00FFFFFF&
               Caption         =   "D"
               BeginProperty Font 
                  Name            =   "Arial"
                  Size            =   8.25
                  Charset         =   238
                  Weight          =   700
                  Underline       =   0   'False
                  Italic          =   0   'False
                  Strikethrough   =   0   'False
               EndProperty
               Height          =   255
               Index           =   174
               Left            =   5310
               TabIndex        =   149
               Tag             =   "_lbl_Side"
               Top             =   1065
               Width           =   360
            End
            Begin VB.Label lbl_Label 
               BackColor       =   &H00FFFFFF&
               Caption         =   "C"
               BeginProperty Font 
                  Name            =   "Arial"
                  Size            =   8.25
                  Charset         =   238
                  Weight          =   700
                  Underline       =   0   'False
                  Italic          =   0   'False
                  Strikethrough   =   0   'False
               EndProperty
               Height          =   255
               Index           =   173
               Left            =   5310
               TabIndex        =   148
               Tag             =   "_lbl_Side"
               Top             =   765
               Width           =   360
            End
            Begin VB.Shape shp_LoudSides 
               BackStyle       =   1  'Opaque
               BorderWidth     =   2
               Height          =   600
               Left            =   4860
               Top             =   750
               Width           =   1050
            End
         End
         Begin Project1.ToolbarControl tlb_CutoutDetail 
            Height          =   690
            Index           =   1
            Left            =   60
            TabIndex        =   188
            Tag             =   "2917"
            Top             =   165
            Width           =   14835
            _ExtentX        =   26167
            _ExtentY        =   1217
         End
         Begin Project1.ArmCombobox cbo_Loud 
            Height          =   345
            Left            =   2580
            TabIndex        =   189
            Top             =   900
            Width           =   4335
            _ExtentX        =   7646
            _ExtentY        =   609
         End
         Begin VB.Label lbl_Label 
            Caption         =   "#Louspeaker perforation type"
            Height          =   252
            Index           =   42
            Left            =   120
            TabIndex        =   191
            Tag             =   "lbl_LoudType"
            Top             =   960
            Width           =   2088
         End
      End
      Begin VB.CheckBox chk_NoLoudspeaker 
         Caption         =   "#No Loudspeaker"
         Height          =   255
         Left            =   135
         TabIndex        =   131
         Tag             =   "chk_NoLoudspeaker"
         Top             =   165
         Width           =   1830
      End
      Begin Project1.ToolbarControl tlb_CutoutMain 
         Height          =   1776
         Index           =   1
         Left            =   14352
         TabIndex        =   192
         Tag             =   "2916"
         Top             =   228
         Width           =   672
         _ExtentX        =   1217
         _ExtentY        =   3122
      End
      Begin Project1.ArmGrid grd_Cutout 
         Height          =   1530
         Index           =   1
         Left            =   105
         TabIndex        =   193
         Tag             =   "grd_Loud"
         Top             =   450
         Width           =   14190
         _ExtentX        =   25030
         _ExtentY        =   2699
      End
   End
   Begin VB.CommandButton btn_Back 
      Height          =   612
      Left            =   12090
      Style           =   1  'Graphical
      TabIndex        =   544
      Tag             =   "btn_Back"
      Top             =   10380
      Width           =   612
   End
   Begin VB.CommandButton btn_Next 
      Height          =   612
      Left            =   12705
      Style           =   1  'Graphical
      TabIndex        =   545
      Tag             =   "btn_Next"
      Top             =   10380
      Width           =   612
   End
   Begin VB.CommandButton btn_Default 
      Height          =   612
      Left            =   13320
      Style           =   1  'Graphical
      TabIndex        =   546
      Tag             =   "btn_Next"
      Top             =   10380
      Width           =   612
   End
   Begin VB.CommandButton btn_Validate 
      Height          =   612
      Left            =   13935
      Style           =   1  'Graphical
      TabIndex        =   547
      Tag             =   "btn_Validate"
      Top             =   10380
      Width           =   612
   End
   Begin VB.CommandButton btn_Quit 
      Height          =   612
      Left            =   14565
      Style           =   1  'Graphical
      TabIndex        =   548
      Tag             =   "btn_Quit"
      Top             =   10380
      Width           =   612
   End
   Begin VB.Frame fra_Step 
      Height          =   1170
      Index           =   10
      Left            =   1770
      TabIndex        =   531
      Tag             =   "fra_Shape"
      Top             =   6840
      Width           =   2250
      Begin VB.Frame fra_ShapeDim 
         Caption         =   "#Dimension"
         Height          =   1560
         Left            =   105
         TabIndex        =   533
         Tag             =   "fra_ShapeDim"
         Top             =   4185
         Width           =   10785
         Begin VB.TextBox txt_ShapeAngle 
            Height          =   330
            Left            =   1425
            TabIndex        =   537
            Top             =   885
            Width           =   1140
         End
         Begin VB.TextBox txt_ShapeThickness 
            Height          =   330
            Left            =   4095
            TabIndex        =   536
            Top             =   885
            Width           =   1185
         End
         Begin VB.TextBox txt_ShapeLength 
            Height          =   330
            Left            =   1425
            TabIndex        =   535
            Top             =   465
            Width           =   1140
         End
         Begin VB.TextBox txt_ShapeWidth 
            Height          =   330
            Left            =   4110
            TabIndex        =   534
            Top             =   465
            Width           =   1185
         End
         Begin VB.Label lbl_Label 
            Caption         =   "#Thickness"
            Height          =   255
            Index           =   57
            Left            =   2790
            TabIndex        =   541
            Tag             =   "lbl_ShapeThickness"
            Top             =   930
            Width           =   1215
         End
         Begin VB.Label lbl_Label 
            Caption         =   "#Angle"
            Height          =   255
            Index           =   58
            Left            =   120
            TabIndex        =   540
            Tag             =   "lbl_ShapeAngle"
            Top             =   885
            Width           =   1215
         End
         Begin VB.Label lbl_Label 
            Caption         =   "#Length"
            Height          =   255
            Index           =   59
            Left            =   135
            TabIndex        =   539
            Tag             =   "lbl_ShapeA"
            Top             =   510
            Width           =   1215
         End
         Begin VB.Label lbl_Label 
            Caption         =   "#Width"
            Height          =   255
            Index           =   60
            Left            =   2775
            TabIndex        =   538
            Tag             =   "lbl_ShapeB"
            Top             =   495
            Width           =   1215
         End
      End
      Begin VB.Frame fra_Price 
         Caption         =   "#"
         Height          =   1260
         Index           =   13
         Left            =   120
         TabIndex        =   532
         Tag             =   "fra_ShapePrice"
         Top             =   5805
         Width           =   10800
      End
      Begin MSComctlLib.ListView lvw_Shape 
         Height          =   3900
         Left            =   90
         TabIndex        =   549
         Tag             =   "lvw_Shape"
         Top             =   240
         Width           =   10890
         _ExtentX        =   19209
         _ExtentY        =   6879
         LabelEdit       =   1
         LabelWrap       =   -1  'True
         HideSelection   =   0   'False
         _Version        =   393217
         ForeColor       =   -2147483640
         BackColor       =   -2147483643
         BorderStyle     =   1
         Appearance      =   1
         NumItems        =   0
      End
   End
   Begin VB.Frame fra_PriceSummary 
      Caption         =   "#Summary price"
      Height          =   615
      Left            =   180
      TabIndex        =   524
      Tag             =   "fra_PriceSummary"
      Top             =   10380
      Width           =   8895
      Begin VB.CheckBox chk_FreeOfCharge 
         Caption         =   "#Free of charge"
         Height          =   225
         Left            =   6885
         TabIndex        =   670
         Tag             =   "chk_FreeOfCharge"
         Top             =   255
         Width           =   1950
      End
      Begin VB.TextBox txt_Price 
         Height          =   315
         Index           =   0
         Left            =   1410
         TabIndex        =   526
         Tag             =   "txt_SummaryPriceM2_A"
         Top             =   225
         Width           =   1290
      End
      Begin VB.TextBox txt_Price 
         Height          =   315
         Index           =   1
         Left            =   4725
         TabIndex        =   525
         Tag             =   "txt_SummaryPricePCS_A"
         Top             =   210
         Width           =   1290
      End
      Begin VB.Label lbl_Label 
         Caption         =   "#Price [m2]"
         Height          =   255
         Index           =   76
         Left            =   195
         TabIndex        =   530
         Tag             =   "lbl_SummaryPriceM2"
         Top             =   255
         Width           =   1170
      End
      Begin VB.Label lbl_Label 
         Caption         =   "#Price [pcs]"
         Height          =   255
         Index           =   77
         Left            =   3450
         TabIndex        =   529
         Tag             =   "lbl_SummaryPricePCS"
         Top             =   240
         Width           =   1005
      End
      Begin VB.Label lbl_Price 
         Caption         =   "#Curr"
         Height          =   240
         Index           =   0
         Left            =   2805
         TabIndex        =   528
         Tag             =   "_lbl_CURR_SummaryPriceM2"
         Top             =   270
         Width           =   435
      End
      Begin VB.Label lbl_Price 
         Caption         =   "#Curr"
         Height          =   240
         Index           =   1
         Left            =   6135
         TabIndex        =   527
         Tag             =   "_lbl_CURR_SummaryPricePCS"
         Top             =   270
         Width           =   435
      End
   End
   Begin VB.CommandButton btn_Image 
      Height          =   612
      Left            =   11400
      Style           =   1  'Graphical
      TabIndex        =   543
      Tag             =   "btn_Image"
      Top             =   10380
      Width           =   612
   End
   Begin VB.CommandButton btn_Error 
      Height          =   612
      Left            =   10770
      Style           =   1  'Graphical
      TabIndex        =   542
      Tag             =   "btn_Error"
      Top             =   10380
      Width           =   612
   End
   Begin MSComctlLib.TabStrip tbs_Step 
      Height          =   375
      Left            =   0
      TabIndex        =   550
      Tag             =   "tbs_Step"
      Top             =   0
      Width           =   15165
      _ExtentX        =   26749
      _ExtentY        =   661
      _Version        =   393216
      BeginProperty Tabs {1EFB6598-857C-11D1-B16A-00C0F0283628} 
         NumTabs         =   1
         BeginProperty Tab1 {1EFB659A-857C-11D1-B16A-00C0F0283628} 
            ImageVarType    =   2
         EndProperty
      EndProperty
   End
   Begin MSComctlLib.ImageList iml_Icons 
      Left            =   360
      Top             =   8520
      _ExtentX        =   1005
      _ExtentY        =   1005
      BackColor       =   -2147483633
      MaskColor       =   16711935
      _Version        =   393216
   End
   Begin MSComctlLib.ImageList iml_Shapes 
      Left            =   345
      Top             =   9090
      _ExtentX        =   1005
      _ExtentY        =   1005
      BackColor       =   -2147483633
      ImageWidth      =   32
      ImageHeight     =   32
      MaskColor       =   16777215
      _Version        =   393216
      BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628} 
         NumListImages   =   6
         BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "DPC_Config.ctx":0000
            Key             =   ""
         EndProperty
         BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "DPC_Config.ctx":031A
            Key             =   ""
         EndProperty
         BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "DPC_Config.ctx":0634
            Key             =   ""
         EndProperty
         BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "DPC_Config.ctx":094E
            Key             =   ""
         EndProperty
         BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "DPC_Config.ctx":0C68
            Key             =   ""
         EndProperty
         BeginProperty ListImage6 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "DPC_Config.ctx":0F82
            Key             =   ""
         EndProperty
      EndProperty
   End
End
Attribute VB_Name = "DPC_Config"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
Option Explicit

Private Const SEP = "®©"
Private Const C_SEP As String = "@@"
Private Const SEP1 As String = "®"
Private Const SEP2 As String = "©"
Private Const CL_COLOR_ENABLED As Long = &H80000005
Private Const CL_COLOR_DISABLED As Long = &H8000000F
Private Const SCREEN_NAME As String = "DPC_Config"
Private Const SW_SHOWNORMAL = 1

Private Const LOCALE_SDECIMAL = &HE ' Decimal separator
Private Const LOCALE_STHOUSAND = &HF ' Thousand separator
Private Const LOCALE_USER_DEFAULT = &H400
Private Const C_ERRORRAISE As Long = 2500
Private Const C_MSG_ID_BASE As Long = 9700

Private Const TREEVIEW_PERFORATION As String = "DPC_Perforation"
'Private Const TREEVIEW_INLAY As String = "DPC_Inlay"
Private Const TREEVIEW_COATING As String = "DPC_Coating"

#If ENV = LIVE Then
Private mo_Sys As Object
Private mo_Db As Object
Private mo_DbBaeurer As Object
Private mo_FSO As Object
#Else
Private mo_Sys As ARMSYSCOMLib.ArmSYS
Private mo_Db As ARMSYSCOMLib.ArmDb
Private mo_DbBaeurer As ARMSYSCOMLib.ArmDb
Private mo_FSO As Scripting.FileSystemObject
#End If

Private mo_Tools As DPC_Tools

Public Result As Boolean
Private ml_U_Code As Long

Public CURR_CodeCOF As String

Private ms_Caption As String
Private ms_DPCImageCachePath As String

Public mo_PrdConfig As New DPC_Product
Private mo_PrdTemp As New DPC_Product

Private mo_CurrentInlay As DPC_Inlay
Private mo_CurrentCutout As DPC_Cutout

Private me_CutoutScreen(2) As eDPCScreenMode
Private me_SubconstScreen As eDPCScreenMode
Private me_InlayScreen As eDPCScreenMode
Private me_BOMScreen As eDPCScreenMode
Private me_BORScreen As eDPCScreenMode
Private me_PrdScreen As eDPCScreenMode

Private mb_Initialized As Boolean
Private ms_DecimalSeparator As String
Private ms_ThousandSeparator As String
Private mc_ScreenLabels As Long
Private mc_Toolbars As Long
Private mo_WshNetwork As Object
Private ms_ComputerName As String
Private ms_Language_Code                As String       'current user interface language
Private ms_COF_Lang                     As String       'current user data language
Private ms_LoginName                    As String       'contain loginname
Private ms_UserName                     As String       'contain name of logged user as defined in GEN_People

Private mb_InternalInit As Boolean
Private mb_CurrentTextBoxChanged As Boolean
Private ml_fra_Image(3) As Long
Private mb_IsProduction As Boolean
Private mv_Edge As Variant
Private mv_PerfTreeviewInfo As Variant
Private mv_CoatingTreeviewInfo As Variant
Private mv_InlayTreeviewInfo As Variant

Private ms_BaeurerServer As String
Private ms_BaeurerDatabase As String
Private ms_BaeurerLoginName As String
Private ms_BaeurerPassword As String
Private ms_BaeurerSource As String
Private ml_BaeurerFi_Nr As Long

Private COLOR_SUBOPTION As Long
Private COLOR_SUBREPLACE As Long

Public CanChangeManualPrice As Boolean

Private Enum ArmErr
    DBCnxFailed = vbObjectError + 1             ' Unable to connect to the database
    CPTAlreadyInitialized = vbObjectError + 2   ' We try to initialize a component that is already initialized
    CPTNotInitialized = vbObjectError + 3       ' We try to use or free that is not initialized yet
    InvalidArgument = vbObjectError + 4
    PropertyNotSet = vbObjectError + 5
    SQLFailure = vbObjectError + 6               ' A SQL runtime error has occured : syntax wrong....
    SQLBadRowAffectedCount = vbObjectError + 7   ' A SQL request has not affected the expected rowcount (ex: one Update do nothing)
    SQLBadRowExpectedCount = vbObjectError + 8   ' A SQL request does not return the expected rowcount : select an item return nothing...
    DrivingError = vbObjectError + 9
    CompFncFailed = vbObjectError + 10           ' when component function fail
    GridLoadFailed = vbObjectError + 11          ' load function failed ... bad sql
    QuietException = vbObjectError + 12          ' do not display error message
    SQLTableReferenceConstraint = vbObjectError + 13 ' A SQL request cannot be executed : Table reference constraint
    DuplicityDetected = vbObjectError + 2301     ' detected row with same unique id
End Enum

Private Enum ArmCusErr
    DuplicityDetected = C_ERRORRAISE + 2301                ' detected row with same unique id
End Enum

Public Event quit()

Public Property Set Tools(ByRef ao_Tools As Object)
On Error GoTo ErrorHandler

  Set mo_Tools = ao_Tools
  Exit Property
ErrorHandler:
  Call ErrorHandler("Tools.Set")
End Property

Public Property Set ArmDb(ByRef ao_Db As Object)
On Error GoTo ErrorHandler

  Set mo_Db = ao_Db
  Exit Property
ErrorHandler:
  Call ErrorHandler("ArmDb.Set")
End Property

Public Property Let Language_Code(as_Language_Code As String)
On Error GoTo ErrHandler
  
  ms_Language_Code = as_Language_Code
  Exit Property
ErrHandler:
  Call ErrorHandler("Language_Code.Let")
End Property

Public Property Get Language_Code() As String
On Error GoTo ErrHandler
  
  Language_Code = ms_Language_Code
  Exit Property
ErrHandler:
  Call ErrorHandler("Language_Code.Get")
End Property

Property Let COF_Lang(as_Value As String)
On Error GoTo ErrHandler

  ms_COF_Lang = as_Value
  Exit Property
ErrHandler:
  Call ErrorMessage("COF_Lang.Let")
End Property

Public Property Get COF_Lang() As String
On Error GoTo ErrHandler
  
  COF_Lang = ms_COF_Lang
  Exit Property
ErrHandler:
  Call ErrorHandler("COF_Lang.Get")
End Property

Public Property Let U_Code(ByVal al_U_Code As Long)
On Error GoTo ErrorHandler

  ml_U_Code = al_U_Code
  Exit Property
ErrorHandler:
  Call ErrorHandler("U_Code.Let")
End Property

Public Property Let LoginName(ByVal as_Value As String)
On Error GoTo ErrorHandler

  ms_LoginName = as_Value
  Exit Property
ErrorHandler:
  Call ErrorHandler("LoginName.Let")
End Property

Public Property Let Caption(ByVal as_Value As String)
On Error GoTo ErrHandler
    
  ms_Caption = as_Value
  Exit Property
ErrHandler:
  Call ErrorHandler("Caption.Let")
End Property

Public Property Get Caption() As String
On Error GoTo ErrHandler
    
  Caption = ms_Caption
  Exit Property
ErrHandler:
  Call ErrorHandler("Caption.Get")
End Property

Public Property Let Name(ByVal as_Value As String)
On Error GoTo ErrHandler
    
  UserControl.Extender.Name = as_Value
  Exit Property
ErrHandler:
  Call ErrorHandler("Name.Let")
End Property

Public Property Get Name() As String
On Error GoTo ErrHandler
    
  Name = UserControl.Extender.Name
  Exit Property
ErrHandler:
  Call ErrorHandler("Name.Get")
End Property

Public Property Let Tag(ByVal as_Value As String)
On Error GoTo ErrHandler
    
  UserControl.Tag = as_Value
  Exit Property
ErrHandler:
  Call ErrorHandler("Tag.Let")
End Property

Public Property Get Tag() As String
On Error GoTo ErrHandler
    
  Tag = UserControl.Tag
  Exit Property
ErrHandler:
  Call ErrorHandler("Tag.Get")
End Property

Public Property Let Visible(ByVal aVisible As Boolean)
On Error GoTo ErrHandler
    
  UserControl.Extender.Visible = aVisible
  Exit Property
ErrHandler:
  Call ErrorHandler("Visible.Let")
End Property

Public Property Get Visible() As Boolean
On Error GoTo ErrHandler
    
  Visible = UserControl.Extender.Visible
  Exit Property
ErrHandler:
  Call ErrorHandler("Visible.Get")
End Property

Public Property Let Top(ByVal aTop As Single)
On Error GoTo ErrHandler
    
  UserControl.Extender.Top = aTop
  Exit Property
ErrHandler:
  Call ErrorHandler("Top.Let")
End Property

Public Property Get Top() As Single
On Error GoTo ErrHandler
    
  Top = UserControl.Extender.Top
  Exit Property
ErrHandler:
  Call ErrorHandler("Top.Get")
End Property

Public Property Let Height(ByVal aHeight As Single)
On Error GoTo ErrHandler
    
  UserControl.Extender.Height = aHeight
  Exit Property
ErrHandler:
  Call ErrorHandler("Height.Let")
End Property

Public Property Get Height() As Single
On Error GoTo ErrHandler
    
  Height = UserControl.Extender.Height
  Exit Property
ErrHandler:
  Call ErrorHandler("Height.Get")
End Property

Public Property Let Left(ByVal aLeft As Single)
On Error GoTo ErrHandler
    
  UserControl.Extender.Left = aLeft
  Exit Property
ErrHandler:
  Call ErrorHandler("Left.Let")
End Property

Public Property Get Left() As Single
On Error GoTo ErrHandler
    
  Left = UserControl.Extender.Left
  Exit Property
ErrHandler:
  Call ErrorHandler("Left.Get")
End Property

Public Property Let Width(ByVal aWidth As Single)
On Error GoTo ErrHandler
    
  UserControl.Extender.Width = aWidth
  Exit Property
ErrHandler:
  Call ErrorHandler(".Let")
End Property

Public Property Get Width() As Single
On Error GoTo ErrHandler
    
  Width = UserControl.Extender.Width
  Exit Property
ErrHandler:
  Call ErrorHandler("Width.Get")
End Property

Public Sub Move(ByVal aLeft As Single, ByVal aTop As Single, ByVal aWidth As Single, ByVal aHeight As Single)
On Error GoTo ErrHandler
  
  Call UserControl.Extender.Move(aLeft, aTop, aWidth, aHeight)
  Exit Sub
ErrHandler:
  Call ErrorHandler("Move")
End Sub

Public Property Let Enabled(ByVal ab_Value As Boolean)
On Error GoTo ErrHandler

  UserControl.Enabled = ab_Value
  Exit Property
ErrHandler:
  Call ErrorHandler("Enabled.Let")
End Property

Public Property Get Enabled() As Boolean
 On Error GoTo ErrHandler

  Enabled = UserControl.Enabled
  Exit Property
ErrHandler:
  Call ErrorHandler("Enabled.Get")
End Property

Public Sub Zorder()
On Error GoTo ErrHandler

  Call UserControl.Extender.Zorder
  Exit Sub
ErrHandler:
  Call ErrorHandler("Zorder")
End Sub

Public Sub Refresh()
On Error GoTo ErrHandler

  Call UserControl.Refresh
  Exit Sub
ErrHandler:
  Call ErrorHandler("Refresh")
End Sub

Public Property Get hwnd() As Long
On Error GoTo ErrHandler
  
  hwnd = UserControl.hwnd
  Exit Property
ErrHandler:
  Call ErrorHandler("hwnd.Get")
End Property

Public Property Get Initialized() As Boolean
On Error GoTo ErrHandler
    
  Initialized = mb_Initialized
  Exit Property
ErrHandler:
  Call ErrorHandler("Initialized.Get")
End Property

Public Property Let COF_Id(ByVal as_Value As String)
On Error GoTo ErrHandler
  
  mo_PrdConfig.COF_Id = as_Value
  Exit Property
ErrHandler:
  Call ErrorMessage("COF_Id.Let")
End Property

Public Property Get COF_Id() As String
On Error GoTo ErrHandler
  
  COF_Id = mo_PrdConfig.COF_Id
  Exit Property
ErrHandler:
  Call ErrorMessage("COF_Id.Get")
End Property

Public Property Let LEN_Id(ByVal as_Value As Long)
On Error GoTo ErrHandler
  
  mo_PrdConfig.LEN_Id = as_Value
  Exit Property
ErrHandler:
  Call ErrorMessage("LEN_Id.Let")
End Property

'Public Property Let CURR_Code(ByVal as_Value As String)
'On Error GoTo ErrHandler
'
'  mo_PrdConfig.CURR_Code = as_Value
'  Exit Property
'ErrHandler:
'  Call ErrorMessage("CURR_Code.Let")
'End Property
'
'Public Property Get CURR_Code() As String
'On Error GoTo ErrHandler
'
'  CURR_Code = mo_PrdConfig.CURR_Code
'  Exit Property
'ErrHandler:
'  Call ErrorMessage("CURR_Code.Get")
'End Property

Public Property Let CT_Code(ByVal as_Value As String)
On Error GoTo ErrHandler
  
  mo_PrdConfig.CT_Code = as_Value
  Exit Property
ErrHandler:
  Call ErrorMessage("CT_Code.Let")
End Property

Public Property Get CT_Code() As String
On Error GoTo ErrHandler
  
  CT_Code = mo_PrdConfig.CT_Code
  Exit Property
ErrHandler:
  Call ErrorMessage("CT_Code.Get")
End Property

Public Property Let OFD_Pos(ByVal al_Value As Long)
On Error GoTo ErrHandler
  
  mo_PrdConfig.OFD_Pos = al_Value
  Exit Property
ErrHandler:
  Call ErrorMessage("OFD_Pos.Let")
End Property

Public Property Get OFD_Pos() As Long
On Error GoTo ErrHandler
  
  OFD_Pos = mo_PrdConfig.OFD_Pos
  Exit Property
ErrHandler:
  Call ErrorMessage("OFD_Pos.Get")
End Property

Public Property Let ValidityDate(ByVal ad_Value As Date)
On Error GoTo ErrHandler
  
  mo_PrdConfig.ValidityDate = ad_Value
  Exit Property
ErrHandler:
  Call ErrorMessage("ValidityDate.Let")
End Property

Public Property Get ValidityDate() As Date
On Error GoTo ErrHandler
  
  ValidityDate = mo_PrdConfig.ValidityDate
  Exit Property
ErrHandler:
  Call ErrorMessage("ValidityDate.Get")
End Property

Public Property Let OFD_WshDat(ByVal ad_Value As Date)
On Error GoTo ErrHandler
  
  mo_PrdConfig.OFD_WshDat = ad_Value
  Exit Property
ErrHandler:
  Call ErrorMessage("OFD_WshDat.Let")
End Property

Public Property Get OFD_WshDat() As Date
On Error GoTo ErrHandler
  
  OFD_WshDat = mo_PrdConfig.OFD_WshDat
  Exit Property
ErrHandler:
  Call ErrorMessage("OFD_WshDat.Get")
End Property

Public Property Let OFD_ShpDat(ByVal ad_Value As Date)
On Error GoTo ErrHandler
  
  mo_PrdConfig.OFD_ShpDat = ad_Value
  Exit Property
ErrHandler:
  Call ErrorMessage("OFD_ShpDat.Let")
End Property

Public Property Get OFD_ShpDat() As Date
On Error GoTo ErrHandler
  
  OFD_ShpDat = mo_PrdConfig.OFD_ShpDat
  Exit Property
ErrHandler:
  Call ErrorMessage("OFD_ShpDat.Get")
End Property

Public Property Let OFD_DelDat(ByVal ad_Value As Date)
On Error GoTo ErrHandler
  
  mo_PrdConfig.OFD_DelDat = ad_Value
  Exit Property
ErrHandler:
  Call ErrorMessage("OFD_DelDat.Let")
End Property

Public Property Get OFD_DelDat() As Date
On Error GoTo ErrHandler
  
  OFD_DelDat = mo_PrdConfig.OFD_DelDat
  Exit Property
ErrHandler:
  Call ErrorMessage("OFD_DelDat.Get")
End Property

'Public Property Let SAE_Id(ByVal al_Value As Long)
'On Error GoTo ErrHandler
'
'  mo_PrdConfig.SAE_Id = al_Value
'  Exit Property
'ErrHandler:
'  Call ErrorMessage("SAE_Id.Let")
'End Property
'
'Public Property Get SAE_Id() As Long
'On Error GoTo ErrHandler
'
'  SAE_Id = mo_PrdConfig.SAE_Id
'  Exit Property
'ErrHandler:
'  Call ErrorMessage("SAE_Id.Get")
'End Property
'
'Public Property Let SHP_Id(ByVal al_Value As Long)
'On Error GoTo ErrHandler
'
'  mo_PrdConfig.SHP_Id = al_Value
'  Exit Property
'ErrHandler:
'  Call ErrorMessage("SHP_Id.Let")
'End Property
'
'Public Property Get SHP_Id() As Long
'On Error GoTo ErrHandler
'
'  SHP_Id = mo_PrdConfig.SHP_Id
'  Exit Property
'ErrHandler:
'  Call ErrorMessage("SHP_Id.Get")
'End Property

Public Property Let IsProduction(ByVal ab_Value As Boolean)
On Error GoTo ErrHandler

  mb_IsProduction = ab_Value
  Exit Property
ErrHandler:
  Call ErrorHandler("IsProduction.Let")
End Property

Public Property Get IsProduction() As Boolean
On Error GoTo ErrHandler

  IsProduction = mb_IsProduction
  Exit Property
ErrHandler:
  Call ErrorHandler("IsProduction.Get")
End Property

Public Property Get IsTemplate() As Boolean
On Error GoTo ErrHandler

  IsTemplate = mo_PrdConfig.IsTemplate
  Exit Property
ErrHandler:
  Call ErrorHandler("IsTemplate.Get")
End Property

Public Property Let IsTemplate(ByVal ab_Value As Boolean)
On Error GoTo ErrHandler

  mo_PrdConfig.IsTemplate = ab_Value
  Exit Property
ErrHandler:
  Call ErrorHandler("IsTemplate.Let")
End Property

Public Property Get IsStandard() As Boolean
On Error GoTo ErrHandler

  IsStandard = mo_PrdConfig.IsStandard
  Exit Property
ErrHandler:
  Call ErrorHandler("IsStandard.Get")
End Property

Public Function Load_A_COM() As Boolean
On Error GoTo ErrHandler
    
Dim la_Columns() As Variant
Dim ll_Idx As Integer
Dim ls_Request As String
Dim ls_Connect() As String
  
  Load_A_COM = False
  
  If mb_Initialized Then
      Call Err.Raise(ArmErr.CPTAlreadyInitialized)
  End If
  If mo_Db Is Nothing Then
      Call Err.Raise(ArmErr.PropertyNotSet)
  End If
  If mo_Tools Is Nothing Then
      Call Err.Raise(ArmErr.PropertyNotSet)
  End If
  
  mb_InternalInit = True
  
  Call mo_Tools.Load_A_ComControls(UserControl.Controls, mo_Db, ms_Language_Code)
  
  ms_DecimalSeparator = Format(0, ".")
  ms_ThousandSeparator = mo_Tools.GetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_STHOUSAND)
  mc_Toolbars = 0
  
  Set mo_FSO = CreateObject("Scripting.FileSystemObject")
#If ENV = LIVE Then
  Set mo_Sys = CreateObject("ArmSYSCOM.ArmSys")
  Set mo_DbBaeurer = CreateObject("ArmSYSCOM.ArmDb")
#Else
  Set mo_Sys = New ARMSYSCOMLib.ArmSYS
  Set mo_DbBaeurer = New ARMSYSCOMLib.ArmDb
#End If
  
  Set mo_WshNetwork = CreateObject("WScript.Network")
  ms_ComputerName = mo_WshNetwork.ComputerName
  
  ms_DPCImageCachePath = prg.AppCache_Dir & DPC_IMAGE_CACHE
  btn_Validate.Picture = LoadResPicture(RES_OK, 1)
  btn_Quit.Picture = LoadResPicture(RES_QUIT, 1)
  btn_ImageQuit.Picture = LoadResPicture(RES_QUIT, 1)
  btn_PriceMatrixQuit.Picture = LoadResPicture(RES_QUIT, 1)
  btn_Next.Picture = LoadResPicture(RES_RIGHT, 1)
  btn_Default.Picture = LoadResPicture(77, 1)
  btn_Back.Picture = LoadResPicture(RES_LEFT, 1)
  btn_Image.Picture = LoadResPicture(108, 1)
  btn_Error.Picture = LoadResPicture(146, 1)
  
  ls_Connect = Split(mo_Tools.GetAConfigData("DPC_BaeurerConnection"), SEP)
  If UBound(ls_Connect) = 5 Then
    ms_BaeurerServer = ls_Connect(0)
    ms_BaeurerDatabase = ls_Connect(1)
    ms_BaeurerLoginName = ls_Connect(2)
    ms_BaeurerPassword = ls_Connect(3)
    ms_BaeurerSource = ls_Connect(4)
    ml_BaeurerFi_Nr = Val(ls_Connect(5))
  Else
      Err.Raise ArmErr.PropertyNotSet, "Split(mo_Tools.GetAConfigData(""DPC_BaeurerConnection"")", "Missing or invalid configuration"
  End If
  
'  ms_BaeurerSource = "Capture"
'  ms_BaeurerServer = "10.68.16.40\LIVE_SAGE"
'  ms_BaeurerDatabase = "test70"
'  ms_BaeurerLoginName = "test70"
'  ms_BaeurerPassword = "erp"
  
  mv_Edge = Array("C", "D", "E", "F")
  Result = False
  
  COLOR_SUBOPTION = RGB(90, 240, 110)
  COLOR_SUBREPLACE = RGB(110, 200, 180)
  
  Call iml_Icons.ListImages.Clear
  Call iml_Icons.ListImages.Add(, , LoadResPicture("ERRORTYPE1", vbResBitmap))
  Call iml_Icons.ListImages.Add(, , LoadResPicture("ERRORTYPE2", vbResBitmap))
  Call iml_Icons.ListImages.Add(, , LoadResPicture("ERRORTYPE3", vbResBitmap))
  Call iml_Icons.ListImages.Add(, , LoadResPicture("LEVEL1", vbResBitmap))
  Call iml_Icons.ListImages.Add(, , LoadResPicture("LEVEL2", vbResBitmap))
  Call iml_Icons.ListImages.Add(, , LoadResPicture("LEVEL3", vbResBitmap))
  
  Set tbs_Step.ImageList = iml_Icons
  
  Set mo_PrdConfig.Tools = mo_Tools
  Set mo_PrdConfig.ArmDb = mo_Db
  mo_PrdConfig.U_Code = ml_U_Code
  mo_PrdConfig.CT_Code = CT_Code
  'mo_PrdConfig.CURR_Code = CURR_Code
  mo_PrdConfig.ValidityDate = ValidityDate
  mo_PrdConfig.Language_Code = ms_COF_Lang
  mo_PrdConfig.COF_Id = COF_Id
  Call mo_PrdConfig.Load_A_COM
  Call mo_PrdConfig.InitOffer
  
  Set mo_PrdTemp.Tools = mo_Tools
  Set mo_PrdTemp.ArmDb = mo_Db
  mo_PrdTemp.U_Code = ml_U_Code
  mo_PrdTemp.CT_Code = CT_Code
  'mo_PrdTemp.CURR_Code = CURR_Code
  mo_PrdTemp.ValidityDate = ValidityDate
  mo_PrdTemp.Language_Code = ms_COF_Lang
  mo_PrdTemp.COF_Id = COF_Id
  Call mo_PrdTemp.Load_A_COM
  
  For ll_Idx = 0 To 2
    fra_Cutout(ll_Idx).Visible = False
  
    grd_Cutout(ll_Idx).UnBound = True
    ReDim la_Columns(21) As Variant
    la_Columns(0) = "Idx" & CH_LDELIMIT & "0" & CH_LDELIMIT & "1" & CH_LDELIMIT & "Idx" & CH_LDELIMIT & ""
    la_Columns(1) = "PCT_Id" & CH_LDELIMIT & "0" & CH_LDELIMIT & "0" & CH_LDELIMIT & "PCT_Id" & CH_LDELIMIT & ""
    la_Columns(2) = "CUT_Id" & CH_LDELIMIT & "0" & CH_LDELIMIT & "0" & CH_LDELIMIT & "CUT_Id" & CH_LDELIMIT & ""
    la_Columns(3) = "PCT_Type" & CH_LDELIMIT & "0" & CH_LDELIMIT & "0" & CH_LDELIMIT & "PCT_Type" & CH_LDELIMIT & ""
    la_Columns(4) = "CUT_Code" & CH_LDELIMIT & "1200" & CH_LDELIMIT & "0" & CH_LDELIMIT & "CUT_Code" & CH_LDELIMIT & "#Code"
    la_Columns(5) = "CUT_Name" & CH_LDELIMIT & "1000" & CH_LDELIMIT & "0" & CH_LDELIMIT & "CUT_Name" & CH_LDELIMIT & "#Name"
    la_Columns(6) = "CUT_Desc" & CH_LDELIMIT & "1200" & CH_LDELIMIT & "0" & CH_LDELIMIT & "CUT_Desc" & CH_LDELIMIT & "#Description"
    la_Columns(7) = "CUT_Shape" & CH_LDELIMIT & "0" & CH_LDELIMIT & "0" & CH_LDELIMIT & "CUT_Shape" & CH_LDELIMIT & ""
    la_Columns(8) = "PCT_Std" & CH_LDELIMIT & "0" & CH_LDELIMIT & "0" & CH_LDELIMIT & "PCT_Std" & CH_LDELIMIT & ""
    la_Columns(9) = "PRF_Id" & CH_LDELIMIT & "0" & CH_LDELIMIT & "0" & CH_LDELIMIT & "PRF_Id" & CH_LDELIMIT & ""
    la_Columns(10) = "PRF_Name" & CH_LDELIMIT & "800" & CH_LDELIMIT & "0" & CH_LDELIMIT & "PRF_Name" & CH_LDELIMIT & "#Perforation"
    la_Columns(11) = "PCT_SizeD" & CH_LDELIMIT & "1200" & CH_LDELIMIT & "0" & CH_LDELIMIT & "PCT_SizeD" & CH_LDELIMIT & "#Diameter (d)"
    la_Columns(12) = "PCT_SizeJ" & CH_LDELIMIT & "1200" & CH_LDELIMIT & "0" & CH_LDELIMIT & "PCT_SizeJ" & CH_LDELIMIT & "#Length (J)"
    la_Columns(13) = "PCT_SizeK" & CH_LDELIMIT & "1200" & CH_LDELIMIT & "0" & CH_LDELIMIT & "PCT_SizeK" & CH_LDELIMIT & "#Width (K)"
    la_Columns(14) = "PCT_SizeL" & CH_LDELIMIT & "1200" & CH_LDELIMIT & "0" & CH_LDELIMIT & "PCT_SizeL" & CH_LDELIMIT & "#Longside border (L)"
    la_Columns(15) = "PCT_SizeM" & CH_LDELIMIT & "1200" & CH_LDELIMIT & "0" & CH_LDELIMIT & "PCT_SizeM" & CH_LDELIMIT & "#Shortside border (M)"
    la_Columns(16) = "IMG_Id" & CH_LDELIMIT & "0" & CH_LDELIMIT & "0" & CH_LDELIMIT & "IMG_Id" & CH_LDELIMIT & ""
    la_Columns(17) = "IMG_IdShp" & CH_LDELIMIT & "0" & CH_LDELIMIT & "0" & CH_LDELIMIT & "IMG_IdShp" & CH_LDELIMIT & ""
    la_Columns(18) = "PRC_Cost" & CH_LDELIMIT & "1200" & CH_LDELIMIT & "0" & CH_LDELIMIT & "PRC_Cost" & CH_LDELIMIT & "#Cost"
    la_Columns(19) = "PRC_ACost" & CH_LDELIMIT & "1200" & CH_LDELIMIT & "0" & CH_LDELIMIT & "PRC_ACost" & CH_LDELIMIT & "#Additionl change"
    la_Columns(20) = "PRC_SCost" & CH_LDELIMIT & "1200" & CH_LDELIMIT & "0" & CH_LDELIMIT & "PRC_SCost" & CH_LDELIMIT & "#Setup cost"
    la_Columns(21) = "PRC_UCost" & CH_LDELIMIT & "1200" & CH_LDELIMIT & "0" & CH_LDELIMIT & "PRC_UCost" & CH_LDELIMIT & "#Surcharge"
    grd_Cutout(ll_Idx).SetColumns la_Columns
  Next
  
  Set lvw_Shape.Icons = iml_Shapes
  Call lvw_Shape.ListItems.Clear
  Call lvw_Shape.ListItems.Add(, , "Square", 3)
  Call lvw_Shape.ListItems.Add(, , "Rectangular", 1)
  Call lvw_Shape.ListItems.Add(, , "Trapezoidal", 5)
  Call lvw_Shape.ListItems.Add(, , "Rect triangle", 2)
  Call lvw_Shape.ListItems.Add(, , "Isolele triangle", 6)
  Call lvw_Shape.ListItems.Add(, , "Trapezoidal rotated", 4)
  Set lvw_Shape.SelectedItem = Nothing
  
  Call mo_Tools.PrintMessage(pct_Perforation, DPC_IMAGE_CLICK_MSG)
  Call mo_Tools.PrintMessage(pct_Bending(0), DPC_IMAGE_CLICK_MSG)
  Call mo_Tools.PrintMessage(pct_Bending(1), DPC_IMAGE_CLICK_MSG)
  Call mo_Tools.PrintMessage(pct_Bending(2), DPC_IMAGE_CLICK_MSG)
  Call mo_Tools.PrintMessage(pct_Bending(3), DPC_IMAGE_CLICK_MSG)
  Call mo_Tools.PrintMessage(pct_Vent, DPC_IMAGE_CLICK_MSG)
  Call mo_Tools.PrintMessage(pct_Loud, DPC_IMAGE_CLICK_MSG)
  Call mo_Tools.PrintMessage(pct_Cutout, DPC_IMAGE_CLICK_MSG)
  
  grd_Summary.UnBound = True
  grd_Summary.WordWrap = True
  ReDim la_Columns(9) As Variant
  la_Columns(0) = "CAT_Id" & CH_LDELIMIT & "0" & CH_LDELIMIT & "1" & CH_LDELIMIT & "CAT_Id" & CH_LDELIMIT & ""
  la_Columns(1) = "PRD_Id" & CH_LDELIMIT & "0" & CH_LDELIMIT & "1" & CH_LDELIMIT & "PRD_Id" & CH_LDELIMIT & ""
  la_Columns(2) = "LEV_Id" & CH_LDELIMIT & "600" & CH_LDELIMIT & "0" & CH_LDELIMIT & "LEV_Id" & CH_LDELIMIT & "#Level" & CH_LDELIMIT & "BITMAP"
  la_Columns(3) = "PRD_Code" & CH_LDELIMIT & "1200" & CH_LDELIMIT & "0" & CH_LDELIMIT & "PRD_Code" & CH_LDELIMIT & "#Code"
  la_Columns(4) = "PRD_Name" & CH_LDELIMIT & "7000" & CH_LDELIMIT & "0" & CH_LDELIMIT & "PRD_Name" & CH_LDELIMIT & "#Name"
  la_Columns(5) = "OFD_Qty" & CH_LDELIMIT & "800" & CH_LDELIMIT & "0" & CH_LDELIMIT & "OFD_Qty" & CH_LDELIMIT & "#Qty"
  la_Columns(6) = "UM_Code" & CH_LDELIMIT & "0" & CH_LDELIMIT & "0" & CH_LDELIMIT & "UM_Code" & CH_LDELIMIT & "#UoM"
  la_Columns(7) = "UM_Name" & CH_LDELIMIT & "800" & CH_LDELIMIT & "0" & CH_LDELIMIT & "UM_Name" & CH_LDELIMIT & "#UoM"
  la_Columns(8) = "OFD_Price" & CH_LDELIMIT & "1000" & CH_LDELIMIT & "0" & CH_LDELIMIT & "OFD_Price" & CH_LDELIMIT & "#Price"
  la_Columns(9) = "OFD_TotalP" & CH_LDELIMIT & "1000" & CH_LDELIMIT & "0" & CH_LDELIMIT & "OFD_TotalP" & CH_LDELIMIT & "#Total price"
  Call grd_Summary.SetColumns(la_Columns)
      
      
  grd_Option.FreeSelect = True
  ReDim la_Columns(11) As Variant
  la_Columns(0) = "OPT_Id" & CH_LDELIMIT & "0" & CH_LDELIMIT & "1" & CH_LDELIMIT & "OPT_Id" & CH_LDELIMIT & ""
  la_Columns(1) = "Idx" & CH_LDELIMIT & "0" & CH_LDELIMIT & "0" & CH_LDELIMIT & "Idx" & CH_LDELIMIT & ""
  la_Columns(2) = "Selected" & CH_LDELIMIT & "800" & CH_LDELIMIT & "0" & CH_LDELIMIT & "Selected" & CH_LDELIMIT & "#Selected" & CH_LDELIMIT & "BITMAP"
  la_Columns(3) = "OPT_Code" & CH_LDELIMIT & "800" & CH_LDELIMIT & "0" & CH_LDELIMIT & "OPT_Code" & CH_LDELIMIT & "#Code"
  la_Columns(4) = "OPT_Name" & CH_LDELIMIT & "5000" & CH_LDELIMIT & "0" & CH_LDELIMIT & "OPT_Name" & CH_LDELIMIT & "#Description"
  la_Columns(5) = "PRC_QMin" & CH_LDELIMIT & "800" & CH_LDELIMIT & "0" & CH_LDELIMIT & "PRC_QMin" & CH_LDELIMIT & "#Valid min. qty"
  la_Columns(6) = "PRC_QMax" & CH_LDELIMIT & "800" & CH_LDELIMIT & "0" & CH_LDELIMIT & "PRC_QMax" & CH_LDELIMIT & "#Valid max. qty"
  la_Columns(7) = "PRC_Cost" & CH_LDELIMIT & "1000" & CH_LDELIMIT & "0" & CH_LDELIMIT & "PRC_Cost" & CH_LDELIMIT & "#Cost"
  la_Columns(8) = "CURR_Code" & CH_LDELIMIT & "800" & CH_LDELIMIT & "0" & CH_LDELIMIT & "CURR_Code" & CH_LDELIMIT & "#Currency"
  la_Columns(9) = "Qty" & CH_LDELIMIT & "800" & CH_LDELIMIT & "0" & CH_LDELIMIT & "Qty" & CH_LDELIMIT & "#Qty"
  la_Columns(10) = "UM_CodeC" & CH_LDELIMIT & "0" & CH_LDELIMIT & "0" & CH_LDELIMIT & "UM_CodeC" & CH_LDELIMIT & "#UoM"
  la_Columns(11) = "UM_Name" & CH_LDELIMIT & "800" & CH_LDELIMIT & "0" & CH_LDELIMIT & "UM_Name" & CH_LDELIMIT & "#UoM"
  grd_Option.SetColumns la_Columns
  
  
  ReDim la_Columns(8) As Variant
  la_Columns(0) = "COA_Id" & CH_LDELIMIT & "0" & CH_LDELIMIT & "1" & CH_LDELIMIT & "COA_Id" & CH_LDELIMIT & ""
  la_Columns(1) = "COA_Code" & CH_LDELIMIT & "700" & CH_LDELIMIT & "1" & CH_LDELIMIT & "COA_Code" & CH_LDELIMIT & "#Code"
  la_Columns(2) = "COA_Name" & CH_LDELIMIT & "3000" & CH_LDELIMIT & "1" & CH_LDELIMIT & "COA_Name" & CH_LDELIMIT & "#Name"
  la_Columns(3) = "COA_Desc" & CH_LDELIMIT & "3000" & CH_LDELIMIT & "0" & CH_LDELIMIT & "COA_Desc" & CH_LDELIMIT & "#Desc"
  la_Columns(4) = "COA_IsCus" & CH_LDELIMIT & "500" & CH_LDELIMIT & "0" & CH_LDELIMIT & "COA_IsCus" & CH_LDELIMIT & "#Custom"
  la_Columns(5) = "UM_CodeC" & CH_LDELIMIT & "0" & CH_LDELIMIT & "0" & CH_LDELIMIT & "UM_CodeC" & CH_LDELIMIT & "#UoM"
  la_Columns(6) = "UM_Name" & CH_LDELIMIT & "600" & CH_LDELIMIT & "0" & CH_LDELIMIT & "UM_Name" & CH_LDELIMIT & "#UoM"
  la_Columns(7) = "PRC_Cost" & CH_LDELIMIT & "1000" & CH_LDELIMIT & "0" & CH_LDELIMIT & "PRC_Cost" & CH_LDELIMIT & "#Cost"
  la_Columns(8) = "PRC_SCost" & CH_LDELIMIT & "1000" & CH_LDELIMIT & "0" & CH_LDELIMIT & "PRC_SCost" & CH_LDELIMIT & "#Setup charge"
  Call grd_Coating.SetColumns(la_Columns)
  
  For ll_Idx = eDPCSide.esSideC To eDPCSide.esSideF
    Call InitBendingCombo(cbo_Bending(ll_Idx), ll_Idx)
  Next
  Set cbo_Perforation.ImageList = iml_Icons
  Call InitPerforationCombo(cbo_Perforation, eDPCCutoutType.eNone)
  
  grd_Inlay.UnBound = True
  ReDim la_Columns(17) As Variant
  la_Columns(0) = "Idx" & CH_LDELIMIT & "0" & CH_LDELIMIT & "1" & CH_LDELIMIT & "Idx" & CH_LDELIMIT & ""
  la_Columns(1) = "PIN_Id" & CH_LDELIMIT & "0" & CH_LDELIMIT & "0" & CH_LDELIMIT & "PIN_Id" & CH_LDELIMIT & ""
  la_Columns(2) = "INL_Id" & CH_LDELIMIT & "0" & CH_LDELIMIT & "0" & CH_LDELIMIT & "INL_Id" & CH_LDELIMIT & ""
  la_Columns(3) = "INL_Code" & CH_LDELIMIT & "800" & CH_LDELIMIT & "0" & CH_LDELIMIT & "INL_Code" & CH_LDELIMIT & "#Code"
  la_Columns(4) = "INL_Name" & CH_LDELIMIT & "1000" & CH_LDELIMIT & "0" & CH_LDELIMIT & "INL_Name" & CH_LDELIMIT & "#Name"
  la_Columns(5) = "INL_Desc" & CH_LDELIMIT & "1000" & CH_LDELIMIT & "0" & CH_LDELIMIT & "INL_Desc" & CH_LDELIMIT & "#Desc"
  la_Columns(6) = "PIN_Order" & CH_LDELIMIT & "400" & CH_LDELIMIT & "0" & CH_LDELIMIT & "PIN_Order" & CH_LDELIMIT & "#Order"
  la_Columns(7) = "INL_Type" & CH_LDELIMIT & "0" & CH_LDELIMIT & "0" & CH_LDELIMIT & "INL_Type" & CH_LDELIMIT & ""
  la_Columns(8) = "INL_TypeDesc" & CH_LDELIMIT & "800" & CH_LDELIMIT & "0" & CH_LDELIMIT & "INL_TypeDesc" & CH_LDELIMIT & "#Type"
  la_Columns(9) = "INL_Vend" & CH_LDELIMIT & "800" & CH_LDELIMIT & "0" & CH_LDELIMIT & "INL_Vend" & CH_LDELIMIT & "#Vendor"
  la_Columns(10) = "INL_IsCus" & CH_LDELIMIT & "200" & CH_LDELIMIT & "0" & CH_LDELIMIT & "INL_IsCus" & CH_LDELIMIT & "#Custom"
  la_Columns(11) = "INL_Text" & CH_LDELIMIT & "800" & CH_LDELIMIT & "0" & CH_LDELIMIT & "INL_Text" & CH_LDELIMIT & "#Text"
  la_Columns(12) = "UM_CodeC" & CH_LDELIMIT & "0" & CH_LDELIMIT & "0" & CH_LDELIMIT & "UM_CodeC" & CH_LDELIMIT & "#UoM"
  la_Columns(13) = "UM_Name" & CH_LDELIMIT & "500" & CH_LDELIMIT & "0" & CH_LDELIMIT & "UM_Name" & CH_LDELIMIT & "#UoM"
  la_Columns(14) = "PRC_Cost" & CH_LDELIMIT & "800" & CH_LDELIMIT & "0" & CH_LDELIMIT & "PRC_Cost" & CH_LDELIMIT & "#Cost"
  la_Columns(15) = "PRC_SCost" & CH_LDELIMIT & "800" & CH_LDELIMIT & "0" & CH_LDELIMIT & "PRC_SCost" & CH_LDELIMIT & "#Setup charge"
  la_Columns(16) = "PIN_SizeA" & CH_LDELIMIT & "800" & CH_LDELIMIT & "0" & CH_LDELIMIT & "PIN_SizeA" & CH_LDELIMIT & "#Size A"
  la_Columns(17) = "PIN_SizeB" & CH_LDELIMIT & "800" & CH_LDELIMIT & "0" & CH_LDELIMIT & "PIN_SizeB" & CH_LDELIMIT & "#Size B"
  Call grd_Inlay.SetColumns(la_Columns)
  Call InitReferencesCombo(cbo_InlayDelivery, eDPCReferenceML.rfInlayDeliveryKind)
  Call InitReferencesCombo(cbo_InlayPurchase, eDPCReferenceML.rfInlayPurchaseType)
  
  ReDim la_Columns(11) As Variant
  la_Columns(0) = "INL_Id" & CH_LDELIMIT & "0" & CH_LDELIMIT & "1" & CH_LDELIMIT & "INL_Id" & CH_LDELIMIT & ""
  la_Columns(1) = "INL_Code" & CH_LDELIMIT & "800" & CH_LDELIMIT & "0" & CH_LDELIMIT & "INL_Code" & CH_LDELIMIT & "#Code"
  la_Columns(2) = "INL_Name" & CH_LDELIMIT & "800" & CH_LDELIMIT & "0" & CH_LDELIMIT & "INL_Name" & CH_LDELIMIT & "#Name"
  la_Columns(3) = "INL_Desc" & CH_LDELIMIT & "4000" & CH_LDELIMIT & "0" & CH_LDELIMIT & "INL_Desc" & CH_LDELIMIT & "#Desc"
  la_Columns(4) = "INL_Type" & CH_LDELIMIT & "0" & CH_LDELIMIT & "0" & CH_LDELIMIT & "INL_Type" & CH_LDELIMIT & ""
  la_Columns(5) = "INL_TypeDesc" & CH_LDELIMIT & "800" & CH_LDELIMIT & "0" & CH_LDELIMIT & "INL_TypeDesc" & CH_LDELIMIT & "#Type"
  la_Columns(6) = "INL_Vend" & CH_LDELIMIT & "1500" & CH_LDELIMIT & "0" & CH_LDELIMIT & "INL_Vend" & CH_LDELIMIT & "#Vendor"
  la_Columns(7) = "INL_IsCus" & CH_LDELIMIT & "1000" & CH_LDELIMIT & "0" & CH_LDELIMIT & "INL_IsCus" & CH_LDELIMIT & "#Custom"
  la_Columns(8) = "UM_CodeC" & CH_LDELIMIT & "0" & CH_LDELIMIT & "0" & CH_LDELIMIT & "UM_CodeC" & CH_LDELIMIT & "#UoM"
  la_Columns(9) = "UM_Name" & CH_LDELIMIT & "600" & CH_LDELIMIT & "0" & CH_LDELIMIT & "UM_Name" & CH_LDELIMIT & "#UoM"
  la_Columns(10) = "PRC_Cost" & CH_LDELIMIT & "700" & CH_LDELIMIT & "0" & CH_LDELIMIT & "PRC_Cost" & CH_LDELIMIT & "#Cost"
  la_Columns(11) = "PRC_SCost" & CH_LDELIMIT & "700" & CH_LDELIMIT & "0" & CH_LDELIMIT & "PRC_SCost" & CH_LDELIMIT & "#Setup charge"
  Call grd_InlayDetail.SetColumns(la_Columns)
  grd_InlayDetail.AllowSort = False
  
  fra_Inlay.Visible = False
  
  tvw_Coating.UseImages = True
  
  Call InitVendorCombo(cbo_Vendor)
  Call InitShipPointCombo(cbo_ShipPoint)
  Call InitMaterialCombo
  Call InitToolSetupCombo
  cbo_Thickness.Request = ""
  
  Call InitCutoutCombo(cbo_Vent, eDPCCutoutType.eVentilation)
  Call InitPerforationCombo(cbo_VentPerf, eDPCCutoutType.eVentilation)
  Call InitCutoutCombo(cbo_Loud, eDPCCutoutType.eLoudspeaker)
  Call InitCutAreaCombo(cbo_LoudArea, "")
  Call InitPerforationCombo(cbo_LoudPerf, eDPCCutoutType.eLoudspeaker)
  Call InitCutoutCombo(cbo_Cutout, eDPCCutoutType.eCutout)
  
  Call InitLabelLanguageCombo
  tbs_Gasket.Width = UserControl.Width
  Call fra_Gasket.Move(0, tbs_Gasket.Top + tbs_Gasket.Height, tbs_Gasket.Width, 7500)
  Call fra_Spacer.Move(0, tbs_Gasket.Top + tbs_Gasket.Height, tbs_Gasket.Width, 7500)
  Call tbs_Gasket_Click
       
  Set cbo_Level.ImageList = iml_Icons
  cbo_Level.Request = "SELECT LEV_Id, '' as LEV_Name,(LEV_Id + 3) as bitmap FROM DPC_Level WHERE Drop_Flag='' ORDER BY LEV_Order"
  
'  Call InitCEClassCombo(cbo_FireClass, eDPCCEClass.esFireClass)
    
  ml_fra_Image(0) = fra_Image.Left
  ml_fra_Image(1) = fra_Image.Top
  ml_fra_Image(2) = fra_Image.Width
  ml_fra_Image(3) = fra_Image.Height
  btn_ImageQuit.Visible = False
  ms_Caption = "#Product configuration"
  Call Resize
  
  Call mo_Tools.LoadToolbars(mo_Db, UserControl.Controls, "DPC", SCREEN_NAME)
  
  'Screen csts
  mc_ScreenLabels = mo_Tools.LoadLabels(mo_Db, UserControl.Controls, Me, SCREEN_NAME, ms_Language_Code)
  Call mo_Tools.ChangeCharset(UserControl.Controls, gl_CodePage, mo_Tools.GetCodePageFromLanguage(mo_Db, ms_COF_Lang))
  
  mo_PrdConfig.lbl_ShipPoint = mo_Tools.GetControl(lbl_Label, "lbl_ShipPoint").Caption
  mo_PrdConfig.lbl_PlantVendor = mo_Tools.GetControl(lbl_Label, "lbl_PlantVendor").Caption
  
  mb_InternalInit = False
  mb_Initialized = True
  Load_A_COM = mb_Initialized
  Exit Function
ErrHandler:
  mb_InternalInit = False
  Load_A_COM = False
  Call ErrorMessage("Load_A_COM")
End Function

Public Sub Unload_A_COM()
On Error GoTo ErrHandler

  Call mo_PrdConfig.Unload_A_COM
  Call mo_PrdTemp.Unload_A_COM
  Call mo_Tools.Unload_A_ComControls(UserControl.Controls)
  Call mo_Db.Close(mc_ScreenLabels)
  Set mo_Sys = Nothing
  Set mo_FSO = Nothing
  Set mo_Db = Nothing
  Exit Sub
ErrHandler:
  Call ErrorMessage("Unload_A_COM")
End Sub

Private Sub btn_CenterCutout_Click(Index As Integer)
On Error GoTo ErrHandler
  
  mb_InternalInit = True
  Call mo_Tools.LockScreen(Me, True)
  Call FrameToCutout(mo_CurrentCutout, Index)
  Call mo_CurrentCutout.Center(mo_PrdConfig)
  Call DisplayGenericCutoutFrame(mo_CurrentCutout, Index)
  Call mo_Tools.LockScreen(Me, False)
  mb_InternalInit = False
  Exit Sub
ErrHandler:
  Call ErrorMessage("btn_CenterCutout_Click")
End Sub

Private Sub btn_Image_Click()
On Error GoTo ErrHandler

Dim ll_Idx As Long

  Call mo_Tools.LockScreen(Me, True)
  fra_Image.Visible = False
  Set fra_Image.Container = Me
  Call fra_Image.Move(0, tbs_Step.Height, Width, Height - tbs_Step.Height - btn_Quit.Height - 100)
  btn_ImageQuit.Visible = True
  Call btn_ImageQuit.Zorder
  
  Call DisplayPanelImage
  
  Call fra_Image.Zorder
  Call mo_Tools.EnableFrame(Controls, fra_Image, True)
  fra_Image.Visible = True
  Call EnableNavigation(False)
  Call mo_Tools.LockScreen(Me, False)
  Exit Sub
ErrHandler:
  Call ErrorMessage("btn_Image_Click")
End Sub

Private Sub btn_ImageQuit_Click()
On Error GoTo ErrHandler
  
  Call mo_Tools.LockScreen(Me, True)
  fra_Image.Visible = False
  Set fra_Image.Container = mo_Tools.GetControl(fra_Step, "fra_Panel")
  Call fra_Image.Move(ml_fra_Image(0), ml_fra_Image(1), ml_fra_Image(2), ml_fra_Image(3))
  btn_ImageQuit.Visible = False
 
  Call DisplayPanelImage
  
  Call fra_Image.Zorder
  fra_Image.Visible = True
  Call EnableNavigation(True)
  Call mo_Tools.LockScreen(Me, False)
  Exit Sub
ErrHandler:
  Call ErrorMessage("btn_ImageQuit_Click")
End Sub

Private Sub btn_PriceMatrix_Click()
On Error GoTo ErrHandler

Dim ll_Cursor As Long

  Call mo_Tools.LockScreen(Me, True)
  ll_Cursor = mo_PrdConfig.GetPriceMatrix
  If ll_Cursor = 0 Then
    Call mo_Tools.ShowMsg(mo_Db, ms_Language_Code, 9726, "#Not enough parameters to show price matrix, please select material and quantity")
    Call mo_Tools.LockScreen(Me, False)
    Exit Sub
  End If
  If mo_Db.RowCount(ll_Cursor) > 0 Then
    Call LoadPriceMatrix(ll_Cursor)
    Call ShowPriceMatrix
  Else
    Call mo_Tools.ShowMsg(mo_Db, ms_Language_Code, 9727, "#No price matrix data found")
  End If
  Call mo_Db.Close(ll_Cursor)
  Call mo_Tools.LockScreen(Me, False)
  Exit Sub
ErrHandler:
  Call ErrorMessage("btn_PriceMatrix_Click")
End Sub

Private Sub ShowPriceMatrix()
On Error GoTo ErrHandler

  'lbl_PriceMatrixMat.Caption = "Material: " & mo_PrdConfig.MAT_Name
  'lbl_PriceMatrixCTCurr.Caption = "Country: " & CT_Desc & "  Currency: " & CURR_Code
  fra_PriceMatrix.Height = 6000
  Call fra_PriceMatrix.Move(0, (fra_Step(0).Height - fra_PriceMatrix.Height) / 2, fra_Step(0).Width)
  Call grd_PriceMatrix.Move(50, 100, fra_PriceMatrix.Width - 200, fra_PriceMatrix.Height - btn_PriceMatrixQuit.Height - 200)
  'Call lbl_PriceMatrixMat.Move(50, grd_PriceMatrix.Height + 150)
  'Call lbl_PriceMatrixCTCurr.Move(50, lbl_PriceMatrixMat.Top + lbl_PriceMatrixMat.Height)
  Call btn_PriceMatrixQuit.Move(fra_PriceMatrix.Width - 100 - btn_PriceMatrixQuit.Width, grd_PriceMatrix.Height + 150)
  fra_PriceMatrix.Visible = True
  Call fra_PriceMatrix.Zorder
  Call EnableNavigation(False)
  Exit Sub
ErrHandler:
  Call ErrorHandler("ShowPriceMatrix")
End Sub

Private Sub LoadPriceMatrix(ByVal al_Cursor As Long)
On Error GoTo ErrHandler

Dim ls_ColName As String
Dim ls_RowName As String
Dim lo_Collection As New Collection
Dim ll_Idx As Long
Dim lv_Columns As Variant
Dim lb_Found As Boolean
Dim ll_RowIdx As Long, ll_ColIdx As Long

  grd_PriceMatrix.Cols = 2
  grd_PriceMatrix.Rows = 2
  grd_PriceMatrix.RowHeight(0) = 2 * grd_PriceMatrix.RowHeight(1)
  Call grd_PriceMatrix.Clear
  grd_PriceMatrix.WordWrap = True
  ReDim lv_Columns(0)
  lv_Columns(0) = "B \ A"
  mo_Db.SortFields(al_Cursor) = "PCR_AMin"
  Call mo_Db.First(al_Cursor)
  While Not mo_Db.EOF(al_Cursor)
    ls_ColName = mo_Tools.DblToScreen(mo_Db.GetFields(al_Cursor, "PCR_AMin")) & vbCrLf & mo_Tools.DblToScreen(mo_Db.GetFields(al_Cursor, "PCR_AMax"))
    lb_Found = False
    For ll_Idx = 1 To UBound(lv_Columns)
      If lv_Columns(ll_Idx) = ls_ColName Then
        lb_Found = True
        Exit For
      End If
    Next
    If Not lb_Found Then
      ReDim Preserve lv_Columns(UBound(lv_Columns) + 1)
      lv_Columns(UBound(lv_Columns)) = ls_ColName
    End If
    Call mo_Db.Next(al_Cursor)
  Wend
  
  grd_PriceMatrix.Cols = UBound(lv_Columns) + 1
  For ll_Idx = 0 To UBound(lv_Columns)
    grd_PriceMatrix.TextMatrix(0, ll_Idx) = lv_Columns(ll_Idx)
    If ll_Idx = 0 Then
      grd_PriceMatrix.ColWidth(ll_Idx) = 1400
    Else
      grd_PriceMatrix.ColWidth(ll_Idx) = 1000
    End If
    grd_PriceMatrix.ColAlignment(ll_Idx) = MSFlexGridLib.flexAlignCenterCenter
  Next
  
  mo_Db.SortFields(al_Cursor) = "PCR_BMin"
  Call mo_Db.First(al_Cursor)
  While Not mo_Db.EOF(al_Cursor)
    ls_RowName = mo_Tools.DblToScreen(mo_Db.GetFields(al_Cursor, "PCR_BMin")) & " - " & mo_Tools.DblToScreen(mo_Db.GetFields(al_Cursor, "PCR_BMax"))
    ls_ColName = mo_Tools.DblToScreen(mo_Db.GetFields(al_Cursor, "PCR_AMin")) & vbCrLf & mo_Tools.DblToScreen(mo_Db.GetFields(al_Cursor, "PCR_AMax"))
    ll_RowIdx = SearchPriceMatrixRow(ls_RowName)
    ll_ColIdx = SearchPriceMatrixCol(ls_ColName)
    If ll_RowIdx < 0 Then
      If grd_PriceMatrix.TextMatrix(1, 0) <> "" Then
        Call grd_PriceMatrix.AddItem("")
      End If
      ll_RowIdx = grd_PriceMatrix.Rows - 1
      grd_PriceMatrix.TextMatrix(ll_RowIdx, 0) = ls_RowName
    Else
    End If
    grd_PriceMatrix.TextMatrix(ll_RowIdx, ll_ColIdx) = mo_Tools.DblToScreen(mo_Db.GetFields(al_Cursor, "PRC_Cost")) & " (" & mo_Tools.DblToScreen(mo_Db.GetFields(al_Cursor, "PCR_Thick")) & ")"
    If (mo_PrdConfig.RPL_PanA > Round(mo_Db.GetFields(al_Cursor, "PCR_AMin"), 2)) And _
       (mo_PrdConfig.RPL_PanA <= Round(mo_Db.GetFields(al_Cursor, "PCR_AMax"), 2)) And _
       (mo_PrdConfig.RPL_PanB > Round(mo_Db.GetFields(al_Cursor, "PCR_BMin"), 2)) And _
       (mo_PrdConfig.RPL_PanB <= Round(mo_Db.GetFields(al_Cursor, "PCR_BMax"), 2)) Then
       grd_PriceMatrix.Row = ll_RowIdx
       grd_PriceMatrix.Col = ll_ColIdx
       grd_PriceMatrix.CellBackColor = vbGreen
    End If
    Call mo_Db.Next(al_Cursor)
  Wend
  Exit Sub
ErrHandler:
  Call ErrorHandler("LoadPriceMatrix")
End Sub

Private Function SearchPriceMatrixCol(ByVal as_colName As String) As Long
On Error GoTo ErrHandler

Dim ll_Idx As Long

  For ll_Idx = 1 To grd_PriceMatrix.Cols - 1
    If StrComp(grd_PriceMatrix.TextMatrix(0, ll_Idx), as_colName, vbTextCompare) = 0 Then
      SearchPriceMatrixCol = ll_Idx
      Exit Function
    End If
  Next
  SearchPriceMatrixCol = -1
  Exit Function
ErrHandler:
  Call ErrorHandler("SearchPriceMatrixCol")
End Function

Private Function SearchPriceMatrixRow(ByVal as_RowName As String) As Long
On Error GoTo ErrHandler

Dim ll_Idx As Long

  For ll_Idx = 1 To grd_PriceMatrix.Rows - 1
    If StrComp(grd_PriceMatrix.TextMatrix(ll_Idx, 0), as_RowName, vbTextCompare) = 0 Then
      SearchPriceMatrixRow = ll_Idx
      Exit Function
    End If
  Next
  SearchPriceMatrixRow = -1
  Exit Function
ErrHandler:
  Call ErrorHandler("SearchPriceMatrixRow")
End Function

Private Sub btn_PriceMatrixQuit_Click()
On Error GoTo ErrHandler
  
  fra_PriceMatrix.Visible = False
  Call EnableNavigation(True)
  Exit Sub
ErrHandler:
  Call ErrorMessage("btn_PriceMatrixQuit_Click")
End Sub

Private Sub cbo_GSK_ComboItemSelected(Index As Integer)
On Error GoTo ErrHandler

  If mb_InternalInit Then Exit Sub
  mb_InternalInit = True
  Call mo_Tools.LockScreen(Me, True)
  Call mo_PrdConfig.LoadGasket(eDPCGasketType.gtGasket, Index, mo_Tools.GetComboKey(cbo_GSK(Index)))
  Call LoadGasketPrice
  Call DisplayGasket
  Call mo_Tools.LockScreen(Me, False)
  mb_InternalInit = False
  Exit Sub
ErrHandler:
  Call ErrorMessage("cbo_GSK_ComboItemSelected")
End Sub

Private Sub cbo_GSK2_ComboItemSelected(Index As Integer)
On Error GoTo ErrHandler

  If mb_InternalInit Then Exit Sub
  mb_InternalInit = True
  Call mo_Tools.LockScreen(Me, True)
  Call mo_PrdConfig.LoadGasket(eDPCGasketType.gtSpacer, Index, mo_Tools.GetComboKey(cbo_GSK2(Index)))
  Call LoadSpacerPrice
  Call DisplaySpacer
  Call mo_Tools.LockScreen(Me, False)
  mb_InternalInit = False
  Exit Sub
ErrHandler:
  Call ErrorMessage("cbo_GSK2_ComboItemSelected")
End Sub

'Private Sub cbo_FireClass_ComboItemSelected()
'On Error GoTo ErrHandler
'
'  If mb_InternalInit Then Exit Sub
'  mb_InternalInit = True
'  Call mo_Tools.LockScreen(Me, True)
'  mo_PrdConfig.CLS_Id1 = mo_Tools.GetComboKey(cbo_FireClass)
'  mo_PrdConfig.CLS_Name1 = cbo_FireClass.Text
'  Call mo_Tools.LockScreen(Me, False)
'  mb_InternalInit = False
'  Exit Sub
'ErrHandler:
'  Call ErrorMessage("cbo_FireClass_ComboItemSelected")
'End Sub

Private Sub cbo_Level_ComboItemSelected()
On Error GoTo ErrHandler

  If mb_InternalInit Then Exit Sub
  mb_InternalInit = True
  Call mo_Tools.LockScreen(Me, True)
  mo_PrdConfig.LEV_Id = mo_Tools.GetComboKey(cbo_Level)
  Call mo_PrdConfig.InitCostParameters
  Call mo_Tools.LockScreen(Me, False)
  mb_InternalInit = False
  Exit Sub
ErrHandler:
  Call ErrorMessage("cbo_Level_ComboItemSelected")
End Sub

Private Sub cal_DeliveryDate_GotFocus()
On Error GoTo ErrHandler
  
  Call cal_DeliveryDate.Zorder
  Exit Sub
ErrHandler:
  Call ErrorMessage("cal_DeliveryDate_GotFocus")
End Sub

Private Sub cal_WishDate_GotFocus()
On Error GoTo ErrHandler
  
  Call cal_WishDate.Zorder
  Exit Sub
ErrHandler:
  Call ErrorMessage("cal_WishDate_GotFocus")
End Sub

Private Sub cal_ShipDate_GotFocus()
On Error GoTo ErrHandler
  
  Call cal_ShipDate.Zorder
  Exit Sub
ErrHandler:
  Call ErrorMessage("cal_ShipDate_GotFocus")
End Sub

Private Sub cal_DeliveryDate_datechangee()
On Error GoTo ErrHandler

  If mb_InternalInit Then Exit Sub
  mo_PrdConfig.OFD_DelDat = cal_DeliveryDate.date_dt
  Exit Sub
ErrHandler:
  Call ErrorMessage("cal_DeliveryDate_datechangee")
End Sub

Private Sub cal_ShipDate_datechangee()
On Error GoTo ErrHandler

  If mb_InternalInit Then Exit Sub
  mo_PrdConfig.OFD_ShpDat = cal_ShipDate.date_dt
  Exit Sub
ErrHandler:
  Call ErrorMessage("cal_ShipDate_datechangee")
End Sub

Private Sub cal_WishDate_datechangee()
On Error GoTo ErrHandler

  If mb_InternalInit Then Exit Sub
  mo_PrdConfig.OFD_WshDat = cal_WishDate.date_dt
  Exit Sub
ErrHandler:
  Call ErrorMessage("cal_WishDate_datechangee")
End Sub

Private Sub SetTechBackground()
On Error GoTo ErrHandler

Dim lo_TextBox As TextBox
  
  For Each lo_TextBox In txt_Tech
    lo_TextBox.BackColor = COLOR_SUBREPLACE
  Next
  
  txt_Textbox(13).BackColor = COLOR_SUBREPLACE
  txt_Textbox(14).BackColor = COLOR_SUBREPLACE
  txt_Textbox(15).BackColor = COLOR_SUBREPLACE
  txt_Textbox(16).BackColor = COLOR_SUBREPLACE
  txt_Textbox(17).BackColor = COLOR_SUBREPLACE
  txt_Textbox(8).BackColor = COLOR_SUBREPLACE
  
  Exit Sub
ErrHandler:
  Call ErrorHandler("SetTechBackground")
End Sub

Private Function IsPerfValid(ByVal ad_PRF_MaxPW As Double, ByVal ad_PRF_MaxTW As Double, _
ByVal ad_PRF_MaxST As Double, ByVal ad_PRF_MaxAT As Double)
On Error GoTo ErrHandler

Dim lb_PerfValid As Boolean

    lb_PerfValid = True
    
    If ad_PRF_MaxPW < mo_PrdConfig.PRF_ToolWidth Then
      lb_PerfValid = False
    End If
    
    If ad_PRF_MaxTW < mo_PrdConfig.RPL_CoWMin Then
      lb_PerfValid = False
    End If
  
    If mo_PrdConfig.MAT_Id = Val(mo_Tools.GetAConfigData("DPC_Default_MAT1")) Then
      If (ad_PRF_MaxST < mo_PrdConfig.RPL_Thick) Then
        lb_PerfValid = False
      End If
    ElseIf mo_PrdConfig.MAT_Id = Val(mo_Tools.GetAConfigData("DPC_Default_MAT2")) Then
      If (ad_PRF_MaxAT < mo_PrdConfig.RPL_Thick) Then
        lb_PerfValid = False
      End If
    End If
    
    IsPerfValid = lb_PerfValid
  Exit Function
ErrHandler:
  Call ErrorHandler("IsPerfValid")
End Function

Public Sub ItemNew(ByVal ae_CAT_Id As eDPCCategory, ByVal al_SYS_Id As Long)
On Error GoTo ErrHandler

  mb_InternalInit = True
  me_PrdScreen = eDPCScreenMode.smAdd
  
  If (ae_CAT_Id = eDPCCategory.cgMetalPanelSKU) Then
    mo_PrdConfig.CAT_Id = ae_CAT_Id
    mo_PrdConfig.LEV_Id = eDPCLevel.lvStandard
  ElseIf (ae_CAT_Id = eDPCCategory.cgMetalCustomPanelTemplate) Then
    mo_PrdConfig.CAT_Id = ae_CAT_Id
    mo_PrdConfig.LEV_Id = eDPCLevel.lvCustom
  Else
    Err.Raise ArmErr.InvalidArgument, "ae_CAT_Id", "Invalid ae_CAT_Id value: " & ae_CAT_Id
  End If
  mo_PrdConfig.SYS_Id = al_SYS_Id
  mo_PrdConfig.PRD_Id = ""
  mo_PrdConfig.PRD_IdPar = ""
  mo_PrdConfig.PRD_Code = ""
  Call mo_PrdConfig.Init
  
  mo_PrdConfig.NoPerforation = True
  mo_PrdConfig.NoInlay = True
  mo_PrdConfig.NoCutout = True
  mo_PrdConfig.NoLoudspeaker = True
  mo_PrdConfig.NoVentilation = True
  
  'mo_PrdConfig.RPL_SpcDe = eDPCSpacerDelivery.sdUndef
  'mo_PrdConfig.RPL_GskDe = eDPCGasketDelivery.gdUndef
  Call mo_PrdConfig.LoadGasketDelivery(eDPCSpacerDelivery.sdUndef)
  Call mo_PrdConfig.LoadSpacerDelivery(eDPCSpacerDelivery.sdUndef)
  mo_PrdConfig.RPL_PerDe = eDPCPerimeterDelivery.pdNoPerimeter
  mo_PrdConfig.RPL_PBord = eDPCPerforationBorderType.pbUndef
  
  mo_PrdConfig.RPL_StdGa = True
  mo_PrdConfig.RPL_StdMa = True
  mo_PrdConfig.RPL_SBndA = True
  mo_PrdConfig.RPL_SBndB = True
  
  
  Call SetPriceLabel(mo_PrdConfig.CURR_Code)
  Call DisplayPrice
  Call UpdateStepTab
  Call InitStep
  mb_InternalInit = False
  Exit Sub
ErrHandler:
  Call ErrorHandler("ItemNew")
End Sub

Public Sub ItemAdd(ByVal as_PRD_Id As String)
On Error GoTo ErrHandler

  mb_InternalInit = True
  me_PrdScreen = eDPCScreenMode.smAdd
  
  Call mo_PrdTemp.Load(as_PRD_Id)
  Call mo_PrdConfig.CopyFrom(mo_PrdTemp)
  
  If IsStandard Then
    mo_PrdConfig.NoPerforation = Not mo_PrdConfig.HasPerforation
    mo_PrdConfig.NoInlay = Not mo_PrdConfig.HasInlay
    mo_PrdConfig.NoCutout = Not mo_PrdConfig.HasCutout
    mo_PrdConfig.NoLoudspeaker = Not mo_PrdConfig.HasLoudspeaker
    mo_PrdConfig.NoVentilation = Not mo_PrdConfig.HasVentilation
  Else
    Set mo_PrdConfig.ProductTemplate = mo_PrdTemp
    mo_PrdConfig.PRD_IdPar = mo_PrdTemp.PRD_Id
    mo_PrdConfig.CAT_Id = eDPCCategory.cgMetalCustomRectPanel
    Call mo_PrdConfig.Init
    Call mo_PrdConfig.ResetCoating
    Call mo_PrdConfig.InitGasketSpacer
  End If
  
  'Call mo_PrdConfig.LoadVendorShipPoint(CT_Code)
  Call mo_PrdConfig.LoadSystemMargin
  Call mo_PrdConfig.LoadOfferOptions(COF_Id)
  Call SetPriceLabel(mo_PrdConfig.CURR_Code)
  Call DisplayPrice
  Call UpdateStepTab
  Call InitStep
  mb_InternalInit = False
  Exit Sub
ErrHandler:
  Call ErrorHandler("ItemAdd")
End Sub

Public Sub ItemUpdate(ByVal as_PRD_Id As String)
On Error GoTo ErrHandler

Dim lo_Offer As DPC_OfferPos

  mb_InternalInit = True
  me_PrdScreen = eDPCScreenMode.smUpdate
  
  Call mo_PrdConfig.Load(as_PRD_Id)
  If (Not IsStandard) And (mo_PrdConfig.PRD_IdPar <> "") Then
    Call mo_PrdTemp.Load(mo_PrdConfig.PRD_IdPar)
    Set mo_PrdConfig.ProductTemplate = mo_PrdTemp
  End If
  
  mo_PrdConfig.NoPerforation = Not mo_PrdConfig.HasPerforation
  mo_PrdConfig.NoInlay = Not mo_PrdConfig.HasInlay
  mo_PrdConfig.NoCutout = Not mo_PrdConfig.HasCutout
  mo_PrdConfig.NoLoudspeaker = Not mo_PrdConfig.HasLoudspeaker
  mo_PrdConfig.NoVentilation = Not mo_PrdConfig.HasVentilation
 
  Call SetPriceLabel(mo_PrdConfig.CURR_Code)
  Call DisplayPrice
  Call UpdateStepTab
  Call InitStep
    
  mb_InternalInit = False
  Exit Sub
ErrHandler:
  Call ErrorHandler("ItemUpdate")
End Sub

Public Sub LoadOffer(ByVal as_COF_Id As String, ByVal as_OFD_IdPar As String)
On Error GoTo ErrHandler

Dim lo_ErrCol As Collection

  mb_InternalInit = True
  Call mo_PrdConfig.LoadOffer(as_COF_Id, as_OFD_IdPar)
  Call mo_PrdConfig.LoadOfferOptions(as_COF_Id)
  Call DisplayPanelQtySize
  Call DisplayPanelData
  Call DisplayPrice
  ' do not check anything when production user editing template
  If (Not IsTemplate) And (Not IsProduction) Then
    Call ClearAllScreenErrorType
    Set lo_ErrCol = mo_PrdConfig.CheckAllScreen
    Call ApplyScreenError(lo_ErrCol)
  End If
  mb_InternalInit = False
  Exit Sub
ErrHandler:
  Call ErrorHandler("LoadOffer")
End Sub

'Public Sub ApplyOffer(ByVal ao_OfferCollection As Collection)
'On Error GoTo ErrHandler
'
'Dim lo_ErrCol As Collection
'
'  mb_InternalInit = True
'  Call mo_PrdConfig.ApplyOffer(ao_OfferCollection)
'  Call DisplayPanelQtySize
'  Call DisplayPrice
'  ' do not check anything when production user editing template
'  If (Not IsTemplate) And (Not IsProduction) Then
'    Call ClearAllScreenErrorType
'    Set lo_ErrCol = mo_PrdConfig.CheckAllScreen
'    Call ApplyScreenError(lo_ErrCol)
'  End If
'  mb_InternalInit = False
'  Exit Sub
'ErrHandler:
'  Call ErrorHandler("LoadOffer")
'End Sub

Public Sub ItemSave()
On Error GoTo ErrHandler

  If (me_PrdScreen = eDPCScreenMode.smAdd) Then
    Call mo_PrdConfig.Insert
  ElseIf me_PrdScreen = eDPCScreenMode.smUpdate Then
    Call mo_PrdConfig.Update
  End If
  Exit Sub
ErrHandler:
  Call ErrorHandler("ItemSave")
End Sub

Public Function GenerateOfferDetail() As Collection
On Error GoTo ErrHandler

'Dim lo_Collection As New Collection
'Dim lo_Offer As DPC_OfferPos

  Set GenerateOfferDetail = mo_PrdConfig.GenerateOfferDetail
'  For Each lo_Offer In lo_Collection
'    lo_Offer.LEV_Id = mo_PrdConfig.LEV_Id
'    If lo_Offer.DOF_Id = eDPCOfferDetail.odPosition Then
'      lo_Offer.ERR_Type = GetMaxErrorType
'    Else
'      lo_Offer.ERR_Type = GetTabErrorType(GetStepFrameName(lo_Offer.CAT_Id))
'    End If
'  Next
'  Set GenerateOfferDetail = lo_Collection
  Exit Function
ErrHandler:
  Call ErrorHandler("GenerateOfferDetail")
End Function

Public Function GetMaxErrorType() As eDPCErrorType
On Error GoTo ErrHandler

Dim lo_Tab As MSComctlLib.Tab
Dim le_ErrType As eDPCErrorType
  
  le_ErrType = eDPCErrorType.etNone
  For Each lo_Tab In tbs_Step.Tabs
    If lo_Tab.Image > le_ErrType Then
      le_ErrType = lo_Tab.Image
    End If
  Next
  GetMaxErrorType = le_ErrType
  Exit Function
ErrHandler:
  Call ErrorHandler("GetMaxErrorType")
End Function

Private Sub InitProductSKU()
On Error GoTo ErrHandler

Dim ll_Idx As Long

  Call mo_Tools.SetLabelVisible(lbl_Label, "lbl_BI_SAP_Code", False)
  Call mo_Tools.SetTextVisible(txt_Textbox, "BI_SAP_Code", False)
  
  For ll_Idx = 0 To fra_Step.Count - 1
    Call mo_Tools.EnableFrame(Controls, fra_Step(ll_Idx), False)
  Next
  
  Call mo_Tools.EnableControl(opt_QtyType(0), True)
  Call mo_Tools.EnableControl(opt_QtyType(1), True)
  
  Call mo_Tools.SetTextEnabled(txt_Textbox, "PanelQtyM2", Not (mo_PrdConfig.QtyType = eDPCQtyType.qtPCS))
  Call mo_Tools.SetTextEnabled(txt_Textbox, "PanelQtyPCS", Not (mo_PrdConfig.QtyType = eDPCQtyType.qtM2))
  Call mo_Tools.SetTextEnabled(txt_Textbox, "OFD_PosCus", True)
  Call mo_Tools.EnableControl(cal_DeliveryDate, True)
  Call mo_Tools.EnableControl(cal_ShipDate, True)
  Call mo_Tools.EnableControl(cal_WishDate, True)
  
  Call mo_Tools.EnableControl(cbo_Vendor, True)
  Call mo_Tools.EnableControl(cbo_ShipPoint, True)
  Exit Sub
ErrHandler:
  Call ErrorHandler("InitProductSKU")
End Sub

Private Sub InitProductCustom()
On Error GoTo ErrHandler
  
  Call mo_Tools.SetLabelVisible(lbl_Label, "lbl_BI_SAP_Code", False)
  Call mo_Tools.SetTextVisible(txt_Textbox, "BI_SAP_Code", False)
  Exit Sub
ErrHandler:
  Call ErrorHandler("InitProductCustom")
End Sub

Private Sub InitProductTemplate()
On Error GoTo ErrHandler

Dim lo_Frame As VB.Frame

  Call mo_Tools.SetLabelVisible(lbl_Label, "lbl_BI_SAP_Code", True)
  Call mo_Tools.SetTextVisible(txt_Textbox, "BI_SAP_Code", True)
  
  Call mo_Tools.SetLabelVisible(lbl_Label, "lbl_PanelCodeC", False)
  Call mo_Tools.SetTextVisible(txt_Textbox, "OFD_PosCus", False)
  
  Call mo_Tools.SetLabelVisible(lbl_Label, "lbl_RPL_ToolSetup", True)
  cbo_ToolSetup.Visible = True
  
  Call mo_Tools.SetLabelVisible(lbl_Label, "lbl_RPL_BaeType", True)
  Call mo_Tools.SetTextVisible(txt_Textbox, "RPL_BaeType", True)
  
  Call mo_Tools.SetLabelVisible(lbl_Label, "lbl_ShipPoint", False)
  cbo_ShipPoint.Visible = False
  chk_ASFlag.Visible = False
  
  opt_QtyType(0).Visible = False
  Call mo_Tools.SetTextVisible(txt_Textbox, "PanelQtyM2", False)
  opt_QtyType(1).Visible = False
  Call mo_Tools.SetTextVisible(txt_Textbox, "PanelQtyPCS", False)
  Call mo_Tools.SetLabelVisible(lbl_Label, "lbl_QuantityPU", False)
  Call mo_Tools.SetTextVisible(txt_Textbox, "PanelQtyPU", False)
  
  
  Call mo_Tools.SetLabelVisible(lbl_Label, "lbl_OFD_Pos", False)
  Call mo_Tools.SetTextVisible(txt_Textbox, "OFD_Pos", False)
  
  Call mo_Tools.SetLabelVisible(lbl_Label, "lbl_OFD_DeliveryDate", False)
  cal_DeliveryDate.Visible = False
  Call mo_Tools.SetLabelVisible(lbl_Label, "lbl_OFD_ShipDate", False)
  cal_ShipDate.Visible = False
  Call mo_Tools.SetLabelVisible(lbl_Label, "lbl_OFD_WshDat", False)
  cal_WishDate.Visible = False
  
  For Each lo_Frame In fra_Price
    lo_Frame.Visible = False
  Next
  fra_PriceSummary.Visible = False
  Exit Sub
ErrHandler:
  Call ErrorHandler("InitProductTemplate")
End Sub

Private Sub DisplayOptionalBending()
On Error GoTo ErrHandler

Dim ll_Idx As Long
Dim le_SideIdx As eDPCSide
Dim lo_item As MSComctlLib.ListItem
Dim ls_Bending As String
Dim ll_SelIdx As Long
Dim lb_SelFound As Boolean

  Call lvw_BendOption.ListItems.Clear
  
  ll_SelIdx = -1
  For ll_Idx = 0 To mo_PrdConfig.OptionalBNDCount - 1
    ls_Bending = ""
    lb_SelFound = True
    For le_SideIdx = eDPCSide.esSideC To eDPCSide.esSideF
      If ls_Bending <> "" Then ls_Bending = ls_Bending & " "
      ls_Bending = ls_Bending & mv_Edge(le_SideIdx) & mo_PrdConfig.OptionalBND_Name(ll_Idx)(le_SideIdx)
      If StrComp(mo_PrdConfig.BND_Name(le_SideIdx), mo_PrdConfig.OptionalBND_Name(ll_Idx)(le_SideIdx), vbTextCompare) <> 0 Then
        lb_SelFound = False
      End If
    Next
    
    Set lo_item = lvw_BendOption.ListItems.Add
    lo_item.Text = ls_Bending
    lo_item.Tag = ll_Idx
    
    If lb_SelFound Then
      ll_SelIdx = ll_Idx
      Set lvw_BendOption.SelectedItem = lo_item
    End If
  Next
  
  If (ll_SelIdx < 0) And (Not lvw_BendOption.SelectedItem Is Nothing) Then
    lvw_BendOption.SelectedItem.Selected = False
  Else
    lvw_BendOption.HideSelection = True
    lvw_BendOption.HideSelection = False
  End If
  Exit Sub
ErrHandler:
  Call ErrorHandler("DisplayOptionalBending")
End Sub

Public Property Get StepName() As String
On Error GoTo ErrHandler
  
  StepName = tbs_Step.SelectedItem.Key
  Exit Property
ErrHandler:
  Call ErrorHandler("StepName")
End Property

Private Function SelectRawMaterial(ByVal ae_Categ As eDPCBOMMaterial, ByVal ab_EnableFilter As Boolean) As DPC_BOM
On Error GoTo ErrHandler

Dim lo_frmDPC_BOM As frmDPC_BOM
Dim lo_BOM As DPC_BOM
  
  Set SelectRawMaterial = Nothing
  Set lo_frmDPC_BOM = New frmDPC_BOM
  Load lo_frmDPC_BOM
  Set lo_frmDPC_BOM.Tools = mo_Tools
  Set lo_frmDPC_BOM.ArmDb = mo_Db
  Set lo_frmDPC_BOM.ArmDbBaeurer = mo_DbBaeurer
  lo_frmDPC_BOM.Language_Code = ms_Language_Code
  lo_frmDPC_BOM.Categ = ae_Categ
  lo_frmDPC_BOM.FilterEnabled = ab_EnableFilter
  Call lo_frmDPC_BOM.Load_A_COM
  
  Call mo_Tools.LockScreen(Me, False)
  Call mo_Tools.ShowModalForm(lo_frmDPC_BOM)
  Call mo_Tools.LockScreen(Me, True)
  If lo_frmDPC_BOM.Result Then
    Set lo_BOM = New DPC_BOM
    Call mo_PrdConfig.InitBOM(lo_BOM, eDPCRowStatus.rsNone)
    Call lo_BOM.LoadBOMFromBaeurer(mo_Db, mo_DbBaeurer, ms_Language_Code, lo_frmDPC_BOM.IdentNr)
    Set SelectRawMaterial = lo_BOM
  End If
  Call lo_frmDPC_BOM.Unload_A_COM
  Unload lo_frmDPC_BOM
  Set lo_frmDPC_BOM = Nothing
  Exit Function
ErrHandler:
  Call ErrorHandler("SelectRawMaterial")
End Function

'Private Sub cmd_Coating_Click()
'On Error GoTo ErrHandler
'
'  Dim lo_BOM As DPC_BOM
'
'  If mb_InternalInit Then Exit Sub
'  mb_InternalInit = True
'  Call mo_Tools.LockScreen(Me, True)
'  If mo_Tools.ReconnectSafe(mo_DbBaeurer, ms_BaeurerServer, ms_BaeurerDatabase, ms_BaeurerLoginName, ms_BaeurerPassword, ms_BaeurerSource) Then
'    Set lo_BOM = SelectRawMaterial(eDPCBOMMaterial.bcCoating)
'    If Not lo_BOM Is Nothing Then
'      Set lo_BOM.ArmDb = mo_Db
'      mo_PrdConfig.COA_Code = lo_BOM.BOM_IdentNr
'      Call mo_PrdConfig.SetErrorText(eDPCError.erCoatingName, lo_BOM.BOM_Name)
'      mo_PrdConfig.COA_Name = lo_BOM.BOM_Name
'      Call DisplayCoating
'    End If
'  End If
'  Call mo_Tools.LockScreen(Me, False)
'  mb_InternalInit = False
'  Exit Sub
'ErrHandler:
'  Call ErrorMessage("cmd_Coating_Click")
'End Sub


Private Sub grd_Option_Click()
On Error GoTo ErrHandler

Dim lo_Offer As DPC_OfferPos
Dim ll_Row As Long

  If mb_InternalInit Then Exit Sub
  mb_InternalInit = True
  Call mo_Tools.LockScreen(Me, True)
  ll_Row = grd_Option.Row
  If ll_Row >= 0 And grd_Option.Col = grd_Option.Columns("Selected").ColumnIndex Then
    Set lo_Offer = mo_PrdConfig.GetOfferOption(grd_Option.Data(ll_Row, "OPT_Id"))
    If grd_Option.Data(ll_Row, "Selected") = "UNCHECK" Then
      grd_Option.Data(ll_Row, "Selected") = "CHECK"
      If lo_Offer Is Nothing Then
        Set lo_Offer = New DPC_OfferPos
        Set lo_Offer.Tools = mo_Tools
        Call lo_Offer.Init(0, 0, eDPCQtyType.qtUnknown, 1, mo_PrdConfig.ModuleSurface, mo_PrdConfig.PanelSurface)
        Call mo_PrdConfig.OfferOptionAdd(lo_Offer)
      Else
        Call mo_PrdConfig.OfferOptionUpdate(lo_Offer)
      End If
      lo_Offer.PRD_Id = grd_Option.Data(ll_Row, "OPT_Id")
      'lo_Offer.SYS_Id = mo_PrdConfig.SYS_Id
      lo_Offer.PRD_Code = grd_Option.Data(ll_Row, "OPT_Code")
      lo_Offer.PRD_Name = grd_Option.Data(ll_Row, "OPT_Name")
      lo_Offer.PRD_Desc = grd_Option.Data(ll_Row, "OPT_Desc")
      lo_Offer.CURR_Code = grd_Option.Data(ll_Row, "CURR_Code")
      lo_Offer.UM_Code = grd_Option.Data(ll_Row, "UM_CodeC")
      lo_Offer.UM_Name = grd_Option.Data(ll_Row, "UM_Name")
      lo_Offer.OFD_Qty = Val(grd_Option.Data(ll_Row, "Qty"))
      'lo_Offer.POP_QMin = grd_Option.Data(ll_Row, "PRC_QMin")
      'lo_Offer.POP_QMax = grd_Option.Data(ll_Row, "PRC_QMax")
      lo_Offer.OFD_Cost = grd_Option.Data(ll_Row, "PRC_Cost")
      lo_Offer.OFD_CostA = grd_Option.Data(ll_Row, "PRC_Cost")
      lo_Offer.OFD_Price = grd_Option.Data(ll_Row, "PRC_Cost")
      lo_Offer.OFD_Price = grd_Option.Data(ll_Row, "PRC_Cost")
    Else
      grd_Option.Data(ll_Row, "Selected") = "UNCHECK"
      If Not lo_Offer Is Nothing Then
        Call mo_PrdConfig.OfferOptionDrop(lo_Offer)
      End If
    End If
  End If
  Set lo_Offer = Nothing
  Call mo_Tools.LockScreen(Me, False)
  mb_InternalInit = False
  Exit Sub
ErrHandler:
  Call ErrorMessage("grd_Option_ItemSelected")
End Sub

Private Sub chk_RPL_BVis_Click(Index As Integer)
On Error GoTo ErrHandler

Dim ll_Idx As Long

  If mb_InternalInit Then Exit Sub
  mb_InternalInit = True
  Call mo_Tools.LockScreen(Me, True)
  If mo_PrdConfig.BND_CanVi(Index) Then
    mo_PrdConfig.RPL_BVis(Index) = (chk_RPL_BVis(Index).Value = vbChecked)
    If mo_PrdConfig.RPL_BVis(Index) Then mo_PrdConfig.RPL_NClo(Index) = True
    For ll_Idx = eDPCSide.esSideC To eDPCSide.esSideF
      Call DisplayBendingSide(ll_Idx)
    Next
  End If
  Call mo_Tools.LockScreen(Me, False)
  mb_InternalInit = False
  Exit Sub
ErrHandler:
  Call ErrorMessage("chk_RPL_BVis_Click")
End Sub

Private Sub chk_RPL_NClo_Click(Index As Integer)
On Error GoTo ErrHandler
  
Dim ll_Idx As Long

  If mb_InternalInit Then Exit Sub
  mb_InternalInit = True
  Call mo_Tools.LockScreen(Me, True)
  If mo_PrdConfig.BND_CanVi(Index) Then
    mo_PrdConfig.RPL_NClo(Index) = (chk_RPL_NClo(Index).Value = vbChecked)
    If Not mo_PrdConfig.RPL_NClo(Index) Then mo_PrdConfig.RPL_BVis(Index) = False
    For ll_Idx = eDPCSide.esSideC To eDPCSide.esSideF
      Call DisplayBendingSide(ll_Idx)
    Next
  End If
  Call mo_Tools.LockScreen(Me, False)
  mb_InternalInit = False
  Exit Sub
ErrHandler:
  Call ErrorMessage("chk_RPL_NClo_Click")
End Sub

Private Sub chk_Gasket_Click(Index As Integer)
On Error GoTo ErrHandler

Dim ls_Request As String
Dim ll_Idx As Long

  If mb_InternalInit Then Exit Sub
  mb_InternalInit = True
  Call mo_Tools.LockScreen(Me, True)
  mo_PrdConfig.GTT_Selected(Index) = (chk_Gasket(Index).Value = vbChecked)
  Call cbo_GSK(Index).Clear
  
  If mo_PrdConfig.GTT_Selected(Index) Then
    'mo_PrdConfig.RPL_GskDe = eDPCGasketDelivery.gdInstalled
    Call mo_PrdConfig.LoadGasketDelivery(eDPCGasketDelivery.gdInstalled)
    
    Call InitGasketCombo(cbo_GSK(Index), eDPCGasketType.gtGasket, mo_PrdConfig.RPL_Gap(Index))
    Call cbo_GSK(Index).Load
    
    If cbo_GSK(Index).Count = 1 Then
      Call mo_PrdConfig.LoadGasket(eDPCGasketType.gtGasket, Index, cbo_GSK(Index).ComboItems(1).Key)
    Else
      For ll_Idx = eDPCSide.esSideC To eDPCSide.esSideF
        If (ll_Idx <> Index) And (mo_PrdConfig.GTT_Selected(ll_Idx)) Then
          If cbo_GSK(Index).SearchItem(mo_PrdConfig.GSK_Id(ll_Idx)) Then
            Call mo_PrdConfig.LoadGasket(eDPCGasketType.gtGasket, Index, cbo_GSK(Index).SelectedItem.Key)
            Exit For
          End If
        End If
      Next
    End If
  Else
    Call mo_PrdConfig.ResetGasket(eDPCGasketType.gtGasket, Index)
  End If
  
  Call LoadGasketPrice
  Call DisplayGasket
  Call mo_Tools.LockScreen(Me, False)
  mb_InternalInit = False
  Exit Sub
ErrHandler:
  Call ErrorMessage("chk_Gasket_Click")
End Sub

Private Sub chk_Gasket2_Click(Index As Integer)
On Error GoTo ErrHandler

Dim ls_Request As String
Dim ll_Idx As Long

  If mb_InternalInit Then Exit Sub
  mb_InternalInit = True
  Call mo_Tools.LockScreen(Me, True)
  mo_PrdConfig.GTT_Selected2(Index) = (chk_Gasket2(Index).Value = vbChecked)
  Call cbo_GSK2(Index).Clear
  
  If mo_PrdConfig.GTT_Selected2(Index) Then
    'mo_PrdConfig.RPL_SpcDe = eDPCSpacerDelivery.sdInstalled
    Call mo_PrdConfig.LoadSpacerDelivery(eDPCSpacerDelivery.sdInstalled)
    
    Call InitGasketCombo(cbo_GSK2(Index), eDPCGasketType.gtSpacer, mo_Tools.SqlDbl(mo_PrdConfig.RPL_Gap(Index)))
    Call cbo_GSK2(Index).Load
    
    If cbo_GSK2(Index).Count = 1 Then
      Call mo_PrdConfig.LoadGasket(eDPCGasketType.gtSpacer, Index, cbo_GSK2(Index).ComboItems(1).Key)
    Else
      For ll_Idx = eDPCSide.esSideC To eDPCSide.esSideF
        If (ll_Idx <> Index) And (mo_PrdConfig.GTT_Selected2(ll_Idx)) Then
          If cbo_GSK2(Index).SearchItem(mo_PrdConfig.GSK_Id2(ll_Idx)) Then
            Call mo_PrdConfig.LoadGasket(eDPCGasketType.gtSpacer, Index, cbo_GSK2(Index).SelectedItem.Key)
            Exit For
          End If
        End If
      Next
    End If
  Else
    Call mo_PrdConfig.ResetGasket(eDPCGasketType.gtSpacer, Index)
  End If
  
  Call LoadSpacerPrice
  Call DisplaySpacer
  Call mo_Tools.LockScreen(Me, False)
  mb_InternalInit = False
  Exit Sub
ErrHandler:
  Call ErrorMessage("chk_Gasket2_Click")
End Sub

Private Sub chk_NoInlay_Click()
On Error GoTo ErrHandler

Dim lo_Inlay As DPC_Inlay

  If mb_InternalInit Then Exit Sub
  mb_InternalInit = True
  Call mo_Tools.LockScreen(Me, True)
  mo_PrdConfig.NoInlay = chk_NoInlay.Value = vbChecked
  If chk_NoInlay.Value = vbChecked Then
    If mo_PrdConfig.Inlays.Count > 0 Then
      If mo_Tools.ShowMsg(mo_Db, ms_Language_Code, 9728, "#Are you sure to remove all inlays ?", , vbYesNo) = vbYes Then
        For Each lo_Inlay In mo_PrdConfig.Inlays
          Call mo_PrdConfig.InlayDrop(lo_Inlay)
        Next
        Call grd_Inlay.ClearGrid
      Else
        chk_NoInlay.Value = vbUnchecked
      End If
    End If
  End If
  Call mo_Tools.LockScreen(Me, False)
  mb_InternalInit = False
  Exit Sub
ErrHandler:
  Call ErrorMessage("chk_NoInlay_Click")
End Sub

Private Sub chk_NoVentilation_Click()
On Error GoTo ErrHandler

Dim lo_Cutout As DPC_Cutout

  If mb_InternalInit Then Exit Sub
  mb_InternalInit = True
  Call mo_Tools.LockScreen(Me, True)
  mo_PrdConfig.NoVentilation = chk_NoVentilation.Value = vbChecked
  If mo_PrdConfig.NoVentilation Then
    If mo_PrdConfig.GetVentilationCount > 0 Then
      If mo_Tools.ShowMsg(mo_Db, ms_Language_Code, 9729, "#Are you sure to remove all ventilations ?", , vbYesNo) = vbYes Then
        For Each lo_Cutout In mo_PrdConfig.Cutouts
          If lo_Cutout.PCT_Type = eDPCCutoutType.eVentilation Then
            Call mo_PrdConfig.CutoutDrop(lo_Cutout)
          End If
        Next
      Else
        mo_PrdConfig.NoVentilation = False
      End If
      Call DisplayVentilation
    End If
  End If
  Call mo_Tools.LockScreen(Me, False)
  mb_InternalInit = False
  Exit Sub
ErrHandler:
  Call ErrorMessage("chk_NoVentilation_Click")
End Sub

Private Sub chk_NoLoudspeaker_Click()
On Error GoTo ErrHandler

Dim lo_Cutout As DPC_Cutout

  If mb_InternalInit Then Exit Sub
  mb_InternalInit = True
  Call mo_Tools.LockScreen(Me, True)
  mo_PrdConfig.NoLoudspeaker = chk_NoLoudspeaker.Value = vbChecked
  If mo_PrdConfig.NoLoudspeaker Then
    If mo_PrdConfig.GetLoudspeakerCount > 0 Then
      If mo_Tools.ShowMsg(mo_Db, ms_Language_Code, 9730, "#Are you sure to remove all loudspeakers ?", , vbYesNo) = vbYes Then
        For Each lo_Cutout In mo_PrdConfig.Cutouts
          If lo_Cutout.PCT_Type = eDPCCutoutType.eLoudspeaker Then
            Call mo_PrdConfig.CutoutDrop(lo_Cutout)
          End If
        Next
      Else
        mo_PrdConfig.NoLoudspeaker = False
      End If
      Call DisplayLoudspeaker
    End If
  End If
  Call mo_Tools.LockScreen(Me, False)
  mb_InternalInit = False
  Exit Sub
ErrHandler:
  Call ErrorMessage("chk_NoLoudspeaker_Click")
End Sub

Private Sub chk_NoCutout_Click()
On Error GoTo ErrHandler

Dim lo_Cutout As DPC_Cutout

  If mb_InternalInit Then Exit Sub
  mb_InternalInit = True
  Call mo_Tools.LockScreen(Me, True)
  mo_PrdConfig.NoCutout = chk_NoCutout.Value = vbChecked
  If mo_PrdConfig.NoCutout Then
    If mo_PrdConfig.GetCutoutCount > 0 Then
      If mo_Tools.ShowMsg(mo_Db, ms_Language_Code, 9731, "#Are you sure to remove all cutouts ?", , vbYesNo) = vbYes Then
        For Each lo_Cutout In mo_PrdConfig.Cutouts
          If lo_Cutout.PCT_Type = eDPCCutoutType.eCutout Then
            Call mo_PrdConfig.CutoutDrop(lo_Cutout)
          End If
        Next
      Else
        mo_PrdConfig.NoCutout = False
      End If
      Call DisplayCutout
    End If
  End If
  Call mo_Tools.LockScreen(Me, False)
  mb_InternalInit = False
  Exit Sub
ErrHandler:
  Call ErrorMessage("chk_NoCutout_Click")
End Sub

Private Function GetOfferPosByTag(ByVal as_Tag As String) As DPC_OfferPos
On Error GoTo ErrHandler

Dim lo_Offer As DPC_OfferPos

  Set lo_Offer = mo_PrdConfig.GetOfferPosByTag(as_Tag)
  If lo_Offer Is Nothing Then
    If Not (mo_CurrentInlay Is Nothing) Then
      Set lo_Offer = mo_CurrentInlay.GetOfferPosByTag(as_Tag)
    End If
  End If
  If lo_Offer Is Nothing Then
    If Not (mo_CurrentCutout Is Nothing) Then
      Set lo_Offer = mo_CurrentCutout.GetOfferPosByTag(as_Tag)
    End If
  End If
  Set GetOfferPosByTag = lo_Offer
  Exit Function
ErrHandler:
  Call ErrorHandler("GetOfferPosByTag")
End Function

Private Sub chk_Price_Click(Index As Integer)
On Error GoTo ErrHandler

Dim lo_Offer As DPC_OfferPos
Dim lo_Offer2 As DPC_OfferPos
Dim ls_Tag As String

  If mb_InternalInit Then Exit Sub
  mb_InternalInit = True
  Call mo_Tools.LockScreen(Me, True)
  ls_Tag = right(chk_Price(Index).Tag, Len(chk_Price(Index).Tag) - 4)
  Set lo_Offer = GetOfferPosByTag(ls_Tag)
  Set lo_Offer2 = Nothing
  
  If lo_Offer Is Nothing Then
    Err.Raise ArmErr.InvalidArgument, "chk_Price(Index).Tag", "Unknown price checkbox: " & chk_Price(Index).Tag
  Else
    If lo_Offer.DOF_Id = eDPCOfferDetail.odPanelSetupChargeUnp Then
      Set lo_Offer2 = mo_PrdConfig.GetOfferPos(eDPCOfferDetail.odPanelSetupChargePrf)
    ElseIf lo_Offer.DOF_Id = eDPCOfferDetail.odPanelSetupChargePrf Then
      Set lo_Offer2 = mo_PrdConfig.GetOfferPos(eDPCOfferDetail.odPanelSetupChargeUnp)
    ElseIf lo_Offer.DOF_Id = eDPCOfferDetail.odPanelChangeLengthCostUnp Then
      Set lo_Offer2 = mo_PrdConfig.GetOfferPos(eDPCOfferDetail.odPanelChangeLengthCostPrf)
    ElseIf lo_Offer.DOF_Id = eDPCOfferDetail.odPanelChangeLengthCostPrf Then
      Set lo_Offer2 = mo_PrdConfig.GetOfferPos(eDPCOfferDetail.odPanelChangeLengthCostUnp)
    ElseIf lo_Offer.DOF_Id = eDPCOfferDetail.odPanelChangeWidthCostUnp Then
      Set lo_Offer2 = mo_PrdConfig.GetOfferPos(eDPCOfferDetail.odPanelChangeWidthCostPrf)
    ElseIf lo_Offer.DOF_Id = eDPCOfferDetail.odPanelChangeWidthCostPrf Then
      Set lo_Offer2 = mo_PrdConfig.GetOfferPos(eDPCOfferDetail.odPanelChangeWidthCostUnp)
    End If
    
    lo_Offer.OFD_Valid = (chk_Price(Index).Value = vbChecked)
    lo_Offer.ValidManual = IIf(lo_Offer.OFD_Valid, eDPCOfferPosValidManual.vmSetValid, eDPCOfferPosValidManual.vmSetInvalid)
    If Not lo_Offer2 Is Nothing Then
      lo_Offer2.ValidManual = lo_Offer.ValidManual
    End If
    
    Call mo_PrdConfig.CalcPositionPrice
    Call DisplayPriceVisibility
    Call DisplayPrice
  End If
  Call mo_Tools.LockScreen(Me, False)
  mb_InternalInit = False
  Exit Sub
ErrHandler:
  Call ErrorMessage("chk_Price_Click")
End Sub

Private Sub opt_Gasket_Click(Index As Integer)
On Error GoTo ErrHandler
  
  If mb_InternalInit Then Exit Sub
  mb_InternalInit = True
  Call mo_Tools.LockScreen(Me, True)
  'mo_PrdConfig.RPL_GskDe = (Index + 1)
  Call mo_PrdConfig.LoadGasketDelivery((Index + 1))

  If (mo_PrdConfig.RPL_GskDe = eDPCGasketDelivery.gdNoneGasket) Or _
     (mo_PrdConfig.RPL_GskDe = eDPCGasketDelivery.gdSeparate) Then
    Call UnselectGasket
  End If
  Call LoadGasketPrice
  Call DisplayGasket
  Call mo_Tools.LockScreen(Me, False)
  mb_InternalInit = False
  Exit Sub
ErrHandler:
  Call ErrorMessage("opt_Gasket_Click")
End Sub

Private Sub opt_Spacer_Click(Index As Integer)
On Error GoTo ErrHandler

  If mb_InternalInit Then Exit Sub
  mb_InternalInit = True
  Call mo_Tools.LockScreen(Me, True)
  'mo_PrdConfig.RPL_SpcDe = (Index + 1)
  Call mo_PrdConfig.LoadSpacerDelivery((Index + 1))
  If (mo_PrdConfig.RPL_SpcDe = eDPCSpacerDelivery.sdNoneSpacer) Then
    mo_PrdConfig.RPL_SpcNt = False
    Call UnselectSpacer
  ElseIf (mo_PrdConfig.RPL_SpcDe = eDPCSpacerDelivery.sdNotchOnly) Or _
         (mo_PrdConfig.RPL_SpcDe = eDPCSpacerDelivery.sdSeparate) Then
    mo_PrdConfig.RPL_SpcNt = True
    Call UnselectSpacer
  ElseIf (mo_PrdConfig.RPL_SpcDe = eDPCSpacerDelivery.sdInstalled) Then
    mo_PrdConfig.RPL_SpcNt = True
  End If
  Call LoadSpacerPrice
  Call DisplaySpacer
  Call mo_Tools.LockScreen(Me, False)
  mb_InternalInit = False
  Exit Sub
ErrHandler:
  Call ErrorMessage("opt_Spacer_Click")
End Sub

Private Sub UnselectGasket()
On Error GoTo ErrHandler

Dim ll_SideIdx As Integer

  For ll_SideIdx = eDPCSide.esSideC To eDPCSide.esSideF
    Call mo_PrdConfig.ResetGasket(eDPCGasketType.gtGasket, ll_SideIdx)
  Next
  Exit Sub
ErrHandler:
  Call ErrorHandler("UnselectGasket")
End Sub

Private Sub UnselectSpacer()
On Error GoTo ErrHandler

Dim ll_SideIdx As Integer

  For ll_SideIdx = eDPCSide.esSideC To eDPCSide.esSideF
    Call mo_PrdConfig.ResetGasket(eDPCGasketType.gtSpacer, ll_SideIdx)
  Next
  Exit Sub
ErrHandler:
  Call ErrorHandler("UnselectSpacer")
End Sub

Private Sub chk_PerfBorderV_Click(Index As Integer)
On Error GoTo ErrHandler

  If mb_InternalInit Then Exit Sub
  mb_InternalInit = True
  Call mo_Tools.LockScreen(Me, True)
  If chk_PerfBorderV(Index).Value = vbUnchecked Then
    If mo_CurrentCutout.PCT_UBoW(Index) < 0 Then
      mo_CurrentCutout.PCT_UBoW(Index) = mo_PrdConfig.SYS_UnperfBorder(Index)
    End If
  Else
    mo_CurrentCutout.PCT_UBoW(Index) = -1
    mo_CurrentCutout.PCT_UBor(Index) = -1
  End If
  Call mo_CurrentCutout.CalcPerfBorder
  Call DisplayVentFrame(mo_CurrentCutout)
  Call mo_Tools.LockScreen(Me, False)
  mb_InternalInit = False
  Exit Sub
ErrHandler:
  Call ErrorMessage("chk_PerfBorderV_Click")
End Sub

Private Sub chk_PerfBorderC_Click(Index As Integer)
On Error GoTo ErrHandler
  
  If mb_InternalInit Then Exit Sub
  mb_InternalInit = True
  Call mo_Tools.LockScreen(Me, True)
  If chk_PerfBorderC(Index).Value = vbUnchecked Then
    If mo_CurrentCutout.PCT_UBoW(Index) < 0 Then
      mo_CurrentCutout.PCT_UBoW(Index) = mo_PrdConfig.SYS_UnperfBorder(Index)
    End If
  Else
    mo_CurrentCutout.PCT_UBoW(Index) = -1
    mo_CurrentCutout.PCT_UBor(Index) = -1
  End If
  Call mo_CurrentCutout.CalcPerfBorder
  Call DisplayCutoutFrame(mo_CurrentCutout)
  Call mo_Tools.LockScreen(Me, False)
  mb_InternalInit = False
  Exit Sub
ErrHandler:
  Call ErrorMessage("chk_PerfBorderC_Click")
End Sub

Private Sub chk_PerfBorderL_Click(Index As Integer)
On Error GoTo ErrHandler

  If mb_InternalInit Then Exit Sub
  mb_InternalInit = True
  Call mo_Tools.LockScreen(Me, True)
  If chk_PerfBorderL(Index).Value = vbUnchecked Then
    If mo_CurrentCutout.PCT_UBoW(Index) < 0 Then
      mo_CurrentCutout.PCT_UBoW(Index) = mo_PrdConfig.SYS_UnperfBorder(Index)
    End If
  Else
    mo_CurrentCutout.PCT_UBoW(Index) = -1
    mo_CurrentCutout.PCT_UBor(Index) = -1
  End If
  Call mo_CurrentCutout.CalcPerfBorder
  Call DisplayLoudFrame(mo_CurrentCutout)
  Call mo_Tools.LockScreen(Me, False)
  mb_InternalInit = False
  Exit Sub
ErrHandler:
  Call ErrorMessage("chk_PerfBorderL_Click")
End Sub

Private Sub chk_StandardBendingA_Click()
On Error GoTo ErrHandler

  If mb_InternalInit Then Exit Sub
  mb_InternalInit = True
  Call mo_Tools.LockScreen(Me, True)
  mo_PrdConfig.RPL_SBndA = (chk_StandardBendingA.Value = vbChecked)
  If mo_PrdConfig.RPL_SBndA Then
    mo_PrdConfig.RPL_SUZA = True
    Call mo_PrdConfig.SetStandardPanelUZS(eDPCSide.esSideC)
    Call mo_PrdConfig.SetStandardPanelUZS(eDPCSide.esSideD)
    Call mo_PrdConfig.LoadThicknessHeight(True, False, False)
  Else
    Call mo_PrdConfig.ResetPanelHeight(eDPCSide.esSideC)
    Call mo_PrdConfig.ResetPanelHeight(eDPCSide.esSideD)
  End If
  'Call mo_PrdConfig.CalculateCoWMinMax
  'Call mo_PrdConfig.CalculateCutAB
  Call DisplayBendingSide(eDPCSide.esSideC)
  Call DisplayBendingSide(eDPCSide.esSideD)
  Call DisplayBending
  Call mo_Tools.LockScreen(Me, False)
  mb_InternalInit = False
  Exit Sub
ErrHandler:
  Call ErrorMessage("chk_StandardBendingA_Click")
End Sub

Private Sub chk_StandardUZSA_Click()
On Error GoTo ErrHandler
  
  If mb_InternalInit Then Exit Sub
  mb_InternalInit = True
  Call mo_Tools.LockScreen(Me, True)
  mo_PrdConfig.RPL_SUZA = (chk_StandardUZSA.Value = vbChecked)
  If mo_PrdConfig.RPL_SUZA Then
    Call mo_PrdConfig.SetStandardPanelUZS(eDPCSide.esSideC)
    Call mo_PrdConfig.SetStandardPanelUZS(eDPCSide.esSideD)
  Else
    Call mo_PrdConfig.ResetPanelUZS(eDPCSide.esSideC)
    Call mo_PrdConfig.ResetPanelUZS(eDPCSide.esSideD)
  End If
  'Call mo_PrdConfig.CalculateCoWMinMax
  'Call mo_PrdConfig.CalculateCutAB
  Call DisplayBendingSide(eDPCSide.esSideC)
  Call DisplayBendingSide(eDPCSide.esSideD)
  Call DisplayBending
  Call mo_Tools.LockScreen(Me, False)
  mb_InternalInit = False
  Exit Sub
ErrHandler:
  Call ErrorMessage("chk_StandardUZSA_Click")
End Sub

Private Sub chk_StandardBendingB_Click()
On Error GoTo ErrHandler

  If mb_InternalInit Then Exit Sub
  mb_InternalInit = True
  Call mo_Tools.LockScreen(Me, True)
  mo_PrdConfig.RPL_SBndB = (chk_StandardBendingB.Value = vbChecked)
  If mo_PrdConfig.RPL_SBndB Then
    mo_PrdConfig.RPL_SUZB = True
    Call mo_PrdConfig.SetStandardPanelUZS(eDPCSide.esSideE)
    Call mo_PrdConfig.SetStandardPanelUZS(eDPCSide.esSideF)
    Call mo_PrdConfig.LoadThicknessHeight(False, True, False)
  Else
    Call mo_PrdConfig.ResetPanelHeight(eDPCSide.esSideE)
    Call mo_PrdConfig.ResetPanelHeight(eDPCSide.esSideF)
  End If
  Call DisplayBendingSide(eDPCSide.esSideE)
  Call DisplayBendingSide(eDPCSide.esSideF)
  Call DisplayBending
  Call mo_Tools.LockScreen(Me, False)
  mb_InternalInit = False
  Exit Sub
ErrHandler:
  Call ErrorMessage("chk_StandardBendingB_Click")
End Sub

Private Sub chk_StandardUZSB_Click()
On Error GoTo ErrHandler
  
  If mb_InternalInit Then Exit Sub
  mb_InternalInit = True
  Call mo_Tools.LockScreen(Me, True)
  mo_PrdConfig.RPL_SUZB = (chk_StandardUZSB.Value = vbChecked)
  If mo_PrdConfig.RPL_SUZB Then
    Call mo_PrdConfig.SetStandardPanelUZS(eDPCSide.esSideE)
    Call mo_PrdConfig.SetStandardPanelUZS(eDPCSide.esSideF)
  Else
    Call mo_PrdConfig.ResetPanelUZS(eDPCSide.esSideE)
    Call mo_PrdConfig.ResetPanelUZS(eDPCSide.esSideF)
  End If
  Call DisplayBendingSide(eDPCSide.esSideE)
  Call DisplayBendingSide(eDPCSide.esSideF)
  Call DisplayBending
  Call mo_Tools.LockScreen(Me, False)
  mb_InternalInit = False
  Exit Sub
ErrHandler:
  Call ErrorMessage("chk_StandardUZSB_Click")
End Sub

Private Sub chk_StandardGap_Click()
On Error GoTo ErrHandler

Dim ll_SideIdx As Long

  
  If mb_InternalInit Then Exit Sub
  If IsTemplate Then Exit Sub
  
  mb_InternalInit = True
  Call mo_Tools.LockScreen(Me, True)
  mo_PrdConfig.RPL_StdGa = (chk_StandardGap.Value = vbChecked)
  If mo_PrdConfig.RPL_StdGa Then
    For ll_SideIdx = eDPCSide.esSideC To eDPCSide.esSideF
      mo_PrdConfig.RPL_Gap(ll_SideIdx) = mo_PrdTemp.RPL_Gap(ll_SideIdx)
    Next
    Call LoadStandardMaterial
    Call LoadPrice
  End If
  Call DisplayPanelQtySize
  Call DisplayPanelMaterial
  Call mo_Tools.LockScreen(Me, False)
  mb_InternalInit = False
  Exit Sub
ErrHandler:
  Call ErrorMessage("chk_StandardGap_Click")
End Sub

Private Sub chk_StandardInlay_Click()
On Error GoTo ErrHandler
  
  If mb_InternalInit Then Exit Sub
  
  mb_InternalInit = True
  Call mo_Tools.LockScreen(Me, True)
  mo_CurrentInlay.PIN_Std = (chk_StandardInlay.Value = vbChecked)
  If mo_CurrentInlay.PIN_Std Then
    Call mo_CurrentInlay.CalcInlaySize(mo_PrdConfig)
  End If
  Call DisplayInlayFrame(mo_CurrentInlay)
  Call mo_Tools.LockScreen(Me, False)
  mb_InternalInit = False
  Exit Sub
ErrHandler:
  Call ErrorMessage("chk_StandardInlay_Click")
End Sub

Private Sub chk_StandardMaterial_Click()
On Error GoTo ErrHandler
  
  If mb_InternalInit Then Exit Sub
  If IsTemplate Then Exit Sub
  
  mb_InternalInit = True
  Call mo_Tools.LockScreen(Me, True)
  mo_PrdConfig.RPL_StdMa = (chk_StandardMaterial.Value = vbChecked)
  Call LoadStandardMaterial
  Call LoadPanelPrice
  Call DisplayPanelMaterial
  Call mo_Tools.LockScreen(Me, False)
  mb_InternalInit = False
  Exit Sub
ErrHandler:
  Call ErrorMessage("chk_StandardMaterial_Click")
End Sub

Private Sub chk_ASFlag_Click()
On Error GoTo ErrHandler
  
  If mb_InternalInit Then Exit Sub
  If IsTemplate Then Exit Sub
  mb_InternalInit = True
  mo_PrdConfig.OFD_IsAsItem = (chk_ASFlag.Value = vbChecked)
  mb_InternalInit = False
  Exit Sub
ErrHandler:
  Call ErrorMessage("chk_ASFlag_Click")
End Sub

Private Sub chk_FreeOfCharge_Click()
On Error GoTo ErrHandler
  
  If mb_InternalInit Then Exit Sub
  If IsTemplate Then Exit Sub
  mb_InternalInit = True
  mo_PrdConfig.OFD_IsFree = (chk_FreeOfCharge.Value = vbChecked)
  Call mo_PrdConfig.CalcPositionPrice
  Call DisplayPrice(eDPCScreen.psNone)
  mb_InternalInit = False
  Exit Sub
ErrHandler:
  Call ErrorMessage("chk_FreeOfCharge_Click")
End Sub

Private Sub lvw_BendOption_ItemClick(ByVal Item As MSComctlLib.ListItem)
On Error GoTo ErrHandler

Dim lsa_Bending() As String
Dim ll_SideIdx As Long
Dim ll_Idx As Long

  If mb_InternalInit Then Exit Sub
  If Item Is Nothing Then Exit Sub
  If IsStandard Then Exit Sub
  
  mb_InternalInit = True
  Call mo_Tools.LockScreen(Me, True)
  ll_Idx = Val(Item.Tag)
  If (ll_Idx >= 0) And (ll_Idx < mo_PrdConfig.OptionalBNDCount) Then
    For ll_SideIdx = eDPCSide.esSideC To eDPCSide.esSideF
      Call mo_PrdConfig.LoadBending(ll_SideIdx, mo_PrdConfig.OptionalBND_Id(ll_Idx)(ll_SideIdx))
      Call mo_PrdConfig.SetStandardPanelUZS(ll_SideIdx)
    Next
      
    Call mo_PrdConfig.LoadThicknessHeight(True, True, False)
    
    For ll_SideIdx = eDPCSide.esSideC To eDPCSide.esSideF
      Call DisplayBendingSide(ll_SideIdx)
    Next
  End If
  Call mo_Tools.LockScreen(Me, False)
  mb_InternalInit = False
  Exit Sub
ErrHandler:
  Call ErrorMessage("lvw_BendOption_ItemClick")
End Sub

Private Sub opt_CoatingSide_Click(Index As Integer)
On Error GoTo ErrHandler
  
  If mb_InternalInit Then Exit Sub
  
  mb_InternalInit = True
  Call mo_Tools.LockScreen(Me, True)
  Call mo_PrdConfig.LoadCoatingSide(mo_Tools.WhichOptionIsTrue(opt_CoatingSide) + 1)
  
  Call LoadCoatingGrid(tvw_Coating.SelectedItem)
  Call LoadCoatingPrice
  Call DisplayCoating
  Call mo_Tools.LockScreen(Me, False)
  mb_InternalInit = False
  Exit Sub
ErrHandler:
  Call ErrorMessage("opt_CoatingSide_Click")
End Sub

Private Sub DrawInlaySketch(ByVal ao_Canvas As PictureBox)
On Error GoTo ErrHandler

Dim ld_X1 As Double, ld_X2 As Double, ld_Y1 As Double, ld_Y2 As Double
Dim ld_IX1 As Double, ld_IX2 As Double, ld_IY1 As Double, ld_IY2 As Double
Dim ld_Width As Double, ld_Height As Double
Dim lo_Inlay As DPC_Inlay
Dim ll_Idx As Long
Dim ls_Text As String


  Call ao_Canvas.Cls
  ao_Canvas.ForeColor = vbBlack
  'ao_Canvas.FillColor = vb
  ao_Canvas.FillStyle = FillStyleConstants.vbFSSolid
  ao_Canvas.BorderStyle = BorderStyleConstants.vbBSSolid
  ao_Canvas.DrawWidth = 3
  ao_Canvas.DrawStyle = DrawStyleConstants.vbSolid
  ld_X1 = 450
  ld_Y1 = 150
  ld_X2 = 5000
  ld_Y2 = 1300
  Call mo_Tools.DrawLine(ao_Canvas, ld_X1, ld_Y1, ld_X1, ld_Y2)
  Call mo_Tools.DrawLine(ao_Canvas, ld_X1, ld_Y2, ld_X2, ld_Y2)
  Call mo_Tools.DrawLine(ao_Canvas, ld_X2, ld_Y1, ld_X2, ld_Y2)
  
  If mo_PrdConfig.RPL_Plate <> eDPCPlateType.bpNone Then
    ao_Canvas.ForeColor = vbRed
    ao_Canvas.FillColor = vbRed
    ao_Canvas.FillStyle = FillStyleConstants.vbFSSolid
    ao_Canvas.BorderStyle = BorderStyleConstants.vbBSSolid
    ao_Canvas.DrawWidth = 5
    ao_Canvas.DrawStyle = DrawStyleConstants.vbSolid
    Call mo_Tools.DrawLine(ao_Canvas, ld_X1 + 80, ld_Y1 - 80, ld_X2 - 80, ld_Y1 - 80)
    
  End If
  
  ld_Height = 200
  
  ao_Canvas.ForeColor = vbWhite
  ao_Canvas.FillColor = vbBlue
  ao_Canvas.FillStyle = FillStyleConstants.vbFSSolid
  ao_Canvas.BorderStyle = BorderStyleConstants.vbBSSolid
  ao_Canvas.DrawWidth = 1
  ao_Canvas.DrawStyle = DrawStyleConstants.vbSolid
  ll_Idx = 0
  For Each lo_Inlay In mo_PrdConfig.Inlays
    If lo_Inlay.RowStatus <> eDPCRowStatus.rsDrop Then
      ld_IX1 = ld_X1 + 50
      ld_IX2 = ld_X2 - 50
      ld_IY1 = ld_Y2 - (ll_Idx + 1) * (ld_Height + 30)
      ld_IY2 = ld_Y2 - (ll_Idx * (ld_Height + 30) + 30)
      ao_Canvas.Line (ld_IX1, ld_IY1)-(ld_IX2, ld_IY2), , B
      
      ls_Text = lo_Inlay.INL_Name
      ao_Canvas.CurrentX = ld_IX1 + (ld_IX2 - ld_IX1) / 2 - ao_Canvas.TextWidth(ls_Text) / 2
      ao_Canvas.CurrentY = ld_IY1 + 10
      ao_Canvas.Print ls_Text
      
      ll_Idx = ll_Idx + 1
    End If
  Next
  Exit Sub
ErrHandler:
  Call ErrorHandler("DrawInlaySketch")
End Sub

Private Sub DrawVisualDrawing(ByVal ao_Canvas As PictureBox)
On Error GoTo ErrHandler

Dim ld_MX1 As Double, ld_MX2 As Double, ld_MY1 As Double, ld_MY2 As Double
Dim ld_PX1 As Double, ld_PX2 As Double, ld_PY1 As Double, ld_PY2 As Double
Dim ld_GX1 As Double, ld_GX2 As Double, ld_GY1 As Double, ld_GY2 As Double
Dim ld_GapC As Double, ld_GapD As Double, ld_GapE As Double, ld_GapF As Double
Dim ld_DefGapX As Double, ld_DefGapY As Double
Dim ld_DefLineX As Double, ld_DefLineY As Double
Dim ld_MW As Double, ld_MH As Double, ld_PW As Double, ld_PH As Double
Dim ll_PanelBorderWidth As Long
Dim ll_Idx As Long
Dim ls_Text As String
Dim lo_Cutout As DPC_Cutout

  Call ao_Canvas.Cls
  ll_PanelBorderWidth = 4
  ld_DefGapX = ao_Canvas.ScaleX(30, vbPixels, vbTwips)
  ld_DefGapY = ao_Canvas.ScaleY(30, vbPixels, vbTwips)
  ld_DefLineX = ao_Canvas.ScaleX(ll_PanelBorderWidth, vbPixels, vbTwips)
  ld_DefLineY = ao_Canvas.ScaleY(ll_PanelBorderWidth, vbPixels, vbTwips)
  
  If mo_PrdConfig.RPL_ModA = mo_PrdConfig.RPL_ModB Then
    ld_MH = ao_Canvas.ScaleHeight - (ao_Canvas.ScaleHeight * 0.3)
    ld_MW = ao_Canvas.ScaleY(ld_MH, vbTwips, vbPixels)
    ld_MW = ao_Canvas.ScaleX(ld_MW, vbPixels, vbTwips)
  Else
    ld_MH = ao_Canvas.ScaleHeight - (ao_Canvas.ScaleHeight * 0.3)
    ld_MW = ao_Canvas.ScaleWidth - (ao_Canvas.ScaleWidth * 0.3)
  End If
  ld_MX1 = (ao_Canvas.ScaleWidth - ld_MW) / 2
  ld_MY1 = (ao_Canvas.ScaleHeight - ld_MH) / 2
  ld_MX2 = ld_MX1 + ld_MW
  ld_MY2 = ld_MY1 + ld_MH
  
  
  If (mo_PrdConfig.RPL_Gap(eDPCSide.esSideC) > 0) Or (mo_PrdConfig.RPL_Gap(eDPCSide.esSideD) > 0) Then
    ld_GapC = ld_DefGapY / 2
    ld_GapD = ld_DefGapY / 2
  Else
    ld_GapC = ld_DefLineX / 2
    ld_GapD = ld_DefLineY / 2
  End If
  If (mo_PrdConfig.RPL_Gap(eDPCSide.esSideE) > 0) Or (mo_PrdConfig.RPL_Gap(eDPCSide.esSideF) > 0) Then
    ld_GapE = ld_DefGapY / 2
    ld_GapF = ld_DefGapY / 2
  Else
    ld_GapE = ld_DefLineX / 2
    ld_GapF = ld_DefLineY / 2
  End If
  
  ld_PX1 = ld_MX1 + ld_GapE
  ld_PX2 = ld_MX2 - ld_GapF
  ld_PY1 = ld_MY1 + ld_GapC
  ld_PY2 = ld_MY2 - ld_GapD
  ld_PW = ld_PX2 - ld_PX1
  ld_PH = ld_PY2 - ld_PY1
  
  ao_Canvas.FillStyle = FillStyleConstants.vbFSSolid
  ao_Canvas.DrawWidth = ll_PanelBorderWidth
  
  ld_GX1 = ld_PX1
  ld_GX2 = ld_PX2
  ld_GY1 = ld_PY1
  ld_GY2 = ld_PY2
  ' calc gasket on C side
  If mo_PrdConfig.IsGasketOn(eDPCSide.esSideC) Then
    If mo_PrdConfig.RPL_Gap(eDPCSide.esSideD) > 0 Then
      ld_GY1 = ld_MY1 + ld_DefLineY / 2 ' ld_PY1 - ld_GapC + ld_DefLineY
    Else
      ld_GY1 = ld_PY1 - ld_GapC - ld_GapD + ld_DefLineY
    End If
  End If
  ' calc gasket on D side
  If mo_PrdConfig.IsGasketOn(eDPCSide.esSideD) Then
    If mo_PrdConfig.RPL_Gap(eDPCSide.esSideC) > 0 Then
      ld_GY2 = ld_MY2 - ld_DefLineY / 2 ' ld_PY2 + ld_GapD - ld_DefLineY
    Else
      ld_GY2 = ld_PY2 + ld_GapD + ld_GapC + ld_DefLineY
    End If
  End If
  ' calc gasket on E side
  If mo_PrdConfig.IsGasketOn(eDPCSide.esSideE) Then
    If mo_PrdConfig.RPL_Gap(eDPCSide.esSideF) > 0 Then
      ld_GX1 = ld_MX1 + ld_DefLineX / 2 ' ld_PX1 - ld_GapE + ld_DefLineX
    Else
      ld_GX1 = ld_PX1 - ld_GapE - ld_GapF + ld_DefLineX
    End If
  End If
  ' calc gasket on F side
  If mo_PrdConfig.IsGasketOn(eDPCSide.esSideF) Then
    If mo_PrdConfig.RPL_Gap(eDPCSide.esSideE) > 0 Then
      ld_GX2 = ld_MX2 - ld_DefLineX / 2 'ld_PX2 + ld_GapF - ld_DefLineX
    Else
      ld_GX2 = ld_PX2 + ld_GapF + ld_GapF + ld_DefLineX
    End If
  End If
  
  ' draw gasket
  ao_Canvas.ForeColor = RGB(60, 179, 113) 'vbLightGreen1 'RGB(153, 0, 0) 'vbMaroon
  ao_Canvas.FillColor = RGB(153, 255, 153)   'vbLightGreen2 'RGB(153, 51, 0)  'vbSaddleBrown
  ao_Canvas.Line (ld_GX1, ld_GY1)-(ld_GX2, ld_GY2), , B
  'Call DrawShadowModule(ao_Canvas, ld_GX1, ld_GY1, ld_GX2, ld_GY2, ld_Width, ld_Height, RGB(130, 250, 183), RGB(200, 255, 200))
  Call DrawShadowModule(ao_Canvas, ld_GX1, ld_GY1, ld_GX2, ld_GY2, ld_MW, ld_MH, RGB(220, 255, 240), RGB(240, 255, 250))
  
  ld_GX1 = ld_PX1
  ld_GX2 = ld_PX2
  ld_GY1 = ld_PY1
  ld_GY2 = ld_PY2
  ' calc spacer on C side
  If mo_PrdConfig.GSK_Gap2(eDPCSide.esSideC) > 0 Then
    If mo_PrdConfig.GSK_Gap2(eDPCSide.esSideD) > 0 Then
      ld_GY1 = ld_PY1 - ld_GapC + ld_DefLineY / 2
    Else
      ld_GY1 = ld_PY1 - ld_GapC - ld_GapD + ld_DefLineY
    End If
  End If
  ' calc spacer on D side
  If mo_PrdConfig.GSK_Gap2(eDPCSide.esSideD) > 0 Then
    If mo_PrdConfig.GSK_Gap2(eDPCSide.esSideC) > 0 Then
      ld_GY2 = ld_PY2 + ld_GapD - ld_DefLineY / 2
    Else
      ld_GY2 = ld_PY2 + ld_GapD + ld_GapC - ld_DefLineY
    End If
  End If
  ' calc spacer on E side
  If mo_PrdConfig.GSK_Gap2(eDPCSide.esSideE) > 0 Then
    If mo_PrdConfig.GSK_Gap2(eDPCSide.esSideF) > 0 Then
      ld_GX1 = ld_PX1 - ld_GapE + ld_DefLineX / 2
    Else
      ld_GX1 = ld_PX1 - ld_GapE - ld_GapF + ld_DefLineX
    End If
  End If
  ' calc spacer on F side
  If mo_PrdConfig.GSK_Gap2(eDPCSide.esSideF) > 0 Then
    If mo_PrdConfig.GSK_Gap2(eDPCSide.esSideE) > 0 Then
      ld_GX2 = ld_PX2 + ld_GapF - ld_DefLineX / 2
    Else
      ld_GX2 = ld_PX2 + ld_GapF + ld_GapE - ld_DefLineX
    End If
  End If
  ' draw spacer
  ao_Canvas.ForeColor = RGB(204, 153, 0)
  ao_Canvas.FillStyle = FillStyleConstants.vbFSSolid
  ao_Canvas.FillColor = RGB(255, 204, 0)    'vbLightGreen2 'RGB(153, 51, 0)  'vbSaddleBrown
  
  ao_Canvas.Line (ld_GX1, ld_PY1 + (ld_MH / 4) - 200)-(ld_GX2, ld_PY1 + (ld_MH / 4) + 200), , B
  ao_Canvas.Line (ld_GX1, ld_PY2 - (ld_MH / 4) + 200)-(ld_GX2, ld_PY2 - (ld_MH / 4) - 200), , B
  
  ao_Canvas.Line (ld_PX1 + (ld_MW / 4) - 200, ld_GY1)-(ld_PX1 + (ld_MW / 4) + 200, ld_GY2), , B
  ao_Canvas.Line (ld_PX2 - (ld_MW / 4) + 200, ld_GY1)-(ld_PX2 - (ld_MW / 4) - 200, ld_GY2), , B
  
  
  ' draw main panel
  ao_Canvas.ForeColor = ColorConstants.vbBlack
  ao_Canvas.FillColor = RGB(190, 180, 170)
  ao_Canvas.Line (ld_PX1, ld_PY1)-(ld_PX2, ld_PY2), , B
  ' shadow panel modules
  Call DrawShadowModule(ao_Canvas, ld_PX1, ld_PY1, ld_PX2, ld_PY2, ld_MW, ld_MH, RGB(210, 210, 210), RGB(240, 240, 240))
  
  If (mo_PrdConfig.RPL_Gap(eDPCSide.esSideC) > 0) And (mo_PrdConfig.RPL_Gap(eDPCSide.esSideD) > 0) Then
    Call DrawMeasure(ao_Canvas, ld_PX1 + ld_MW / 3, ld_PY1, ld_PY1 - ld_GapC - ld_GapD, 200, "Top", mo_Tools.DblToScreen(mo_PrdConfig.RPL_Gap(eDPCSide.esSideC) + mo_PrdConfig.RPL_Gap(eDPCSide.esSideD)) & " mm")
    Call DrawMeasure(ao_Canvas, ld_PX1 + ld_MW / 2, ld_PY1, ld_PY1 - ld_GapC, 200, "Top", mo_Tools.DblToScreen(mo_PrdConfig.RPL_Gap(eDPCSide.esSideC)) & " mm")
    Call DrawMeasure(ao_Canvas, ld_PX1 + ld_MW / 2, ld_PY2, ld_PY2 + ld_GapD, ao_Canvas.ScaleHeight - 200, "Bottom", mo_Tools.DblToScreen(mo_PrdConfig.RPL_Gap(eDPCSide.esSideD)) & " mm")
  ElseIf (mo_PrdConfig.RPL_Gap(eDPCSide.esSideC) > 0) Or (mo_PrdConfig.RPL_Gap(eDPCSide.esSideD) > 0) Then
    Call DrawMeasure(ao_Canvas, ld_PX1 + ld_MW / 3, ld_PY1, ld_PY1 - ld_GapC - ld_GapD, 200, "Top", mo_Tools.DblToScreen(mo_PrdConfig.RPL_Gap(eDPCSide.esSideC) + mo_PrdConfig.RPL_Gap(eDPCSide.esSideD)) & " mm")
  End If
  
  If (mo_PrdConfig.RPL_Gap(eDPCSide.esSideE) > 0) And (mo_PrdConfig.RPL_Gap(eDPCSide.esSideF) > 0) Then
    Call DrawMeasure(ao_Canvas, ld_PX1, ld_PY1 + ld_MH / 3, ld_PX1 - ld_GapE - ld_GapF, ld_PX1 - 2000, "Left", mo_Tools.DblToScreen(mo_PrdConfig.RPL_Gap(eDPCSide.esSideE) + mo_PrdConfig.RPL_Gap(eDPCSide.esSideF)) & " mm")
    Call DrawMeasure(ao_Canvas, ld_PX1, ld_PY1 + ld_MH / 2, ld_PX1 - ld_GapE, ld_PX1 - 2000, "Left", mo_Tools.DblToScreen(mo_PrdConfig.RPL_Gap(eDPCSide.esSideE)) & " mm")
    Call DrawMeasure(ao_Canvas, ld_PX2, ld_PY1 + ld_MH / 2, ld_PX2 + ld_GapF, ld_PX2 + 2000, "Right", mo_Tools.DblToScreen(mo_PrdConfig.RPL_Gap(eDPCSide.esSideF)) & " mm")
  ElseIf (mo_PrdConfig.RPL_Gap(eDPCSide.esSideE) > 0) Or (mo_PrdConfig.RPL_Gap(eDPCSide.esSideF) > 0) Then
    Call DrawMeasure(ao_Canvas, ld_PX1, ld_PY1 + ld_MH / 3, ld_PX1 - ld_GapE - ld_GapF, ld_PX1 - 2000, "Left", mo_Tools.DblToScreen(mo_PrdConfig.RPL_Gap(eDPCSide.esSideE) + mo_PrdConfig.RPL_Gap(eDPCSide.esSideF)) & " mm")
  End If
  
  
  If mo_PrdConfig.HasPerforation Then
    If mo_PrdConfig.RPL_UBor(eDPCSide.esSideC) > 0 Then
      Call DrawMeasure(ao_Canvas, ld_PX1 + ld_MW / 3.5, ld_PY1 + 400, ld_PY1, 200, "Top", mo_Tools.DblToScreen(mo_PrdConfig.RPL_UBor(eDPCSide.esSideC)) & " mm")
      ld_PY1 = ld_PY1 + 400
    End If
    If mo_PrdConfig.RPL_UBor(eDPCSide.esSideD) > 0 Then
      Call DrawMeasure(ao_Canvas, ld_PX1 + ld_MW / 3.5, ld_PY2 - 400, ld_PY2, ao_Canvas.ScaleHeight - 200, "Bottom", mo_Tools.DblToScreen(mo_PrdConfig.RPL_UBor(eDPCSide.esSideD)) & " mm")
      ld_PY2 = ld_PY2 - 400
    End If
    If mo_PrdConfig.RPL_UBor(eDPCSide.esSideE) > 0 Then
      Call DrawMeasure(ao_Canvas, ld_PX1 + 400, ld_PY1 + ld_MH / 4, ld_PX1, ld_PX1 - 2000, "Left", mo_Tools.DblToScreen(mo_PrdConfig.RPL_UBor(eDPCSide.esSideE)) & " mm")
      ld_PX1 = ld_PX1 + 400
    End If
    If mo_PrdConfig.RPL_UBor(eDPCSide.esSideF) > 0 Then
      Call DrawMeasure(ao_Canvas, ld_PX2 - 400, ld_PY1 + ld_MH / 4, ld_PX2, ld_PX2 + 2000, "Right", mo_Tools.DblToScreen(mo_PrdConfig.RPL_UBor(eDPCSide.esSideF)) & " mm")
      ld_PX2 = ld_PX2 - 400
    End If
    ao_Canvas.ForeColor = vbBlack
    For ll_Idx = ld_PX1 To ld_PX2 Step 100
      Call DashLine(ao_Canvas, ll_Idx, ld_PY1, ll_Idx, ld_PY2, 30, 60, 3)
    Next
  End If
  
  ' draw cutout
  ao_Canvas.ForeColor = ColorConstants.vbBlack
  ao_Canvas.FillColor = RGB(50, 50, 50)
  ao_Canvas.FillStyle = FillStyleConstants.vbFSSolid
  
  If mo_PrdConfig.HasAnyCutoutShape(eDPCCutoutShape.eRectangular) Then
    ao_Canvas.Line (ld_PX1 + 500, ld_PY1 + 500)-(ld_PX2 - 500, ld_PY2 - 500), , B
  ElseIf mo_PrdConfig.HasAnyCutoutShape(eDPCCutoutShape.eRound) Then
    ao_Canvas.Circle (ld_PX1 + (ld_PX2 - ld_PX1) / 2, ld_PY1 + (ld_PY2 - ld_PY1) / 2), 750
  End If
  
  
  'For Each lo_Cutout In mo_PrdConfig.Cutouts
  '  If lo_Cutout.RowStatus <> eDPCRowStatus.rsDrop Then
  '    If lo_Cutout.CUT_Shape = eDPCCutoutShape.eRectangular Then
  '      ao_Canvas.Line (ld_PX1 + lo_Cutout.PCT_SizeM * ld_AspectRatio, ld_PY1 + lo_Cutout.PCT_SizeL * ld_AspectRatio)-(ld_PX1 + lo_Cutout.PCT_SizeM * ld_AspectRatio + lo_Cutout.PCT_SizeJ * ld_AspectRatio, ld_PY1 + lo_Cutout.PCT_SizeL * ld_AspectRatio + lo_Cutout.PCT_SizeK * ld_AspectRatio), , B
  '    ElseIf lo_Cutout.CUT_Shape = eDPCCutoutShape.eRound Then
  '      ao_Canvas.Circle (ld_PX1 + lo_Cutout.PCT_SizeM * ld_AspectRatio, ld_PY1 + lo_Cutout.PCT_SizeL * ld_AspectRatio), lo_Cutout.PCT_SizeD / 2 * ld_AspectRatio
  '    End If
  '  End If
  'Next

  ' draw module boundaries
  ao_Canvas.ForeColor = RGB(128, 0, 128)
  Call DashLine(ao_Canvas, 0, ld_MY1, ao_Canvas.ScaleWidth, ld_MY1, 50, 50, 2)
  Call DashLine(ao_Canvas, 0, ld_MY2, ao_Canvas.ScaleWidth, ld_MY2, 50, 50, 2)
  Call DashLine(ao_Canvas, ld_MX1, 0, ld_MX1, ao_Canvas.ScaleHeight, 50, 50, 2)
  Call DashLine(ao_Canvas, ld_MX2, 0, ld_MX2, ao_Canvas.ScaleHeight, 50, 50, 2)

  ls_Text = "View from back of tile"
  ao_Canvas.ForeColor = vbBlue
  ao_Canvas.FontBold = True
  ao_Canvas.FontSize = 10
  ao_Canvas.CurrentX = ao_Canvas.ScaleWidth / 2 - ao_Canvas.TextWidth(ls_Text) / 2
  ao_Canvas.CurrentY = ao_Canvas.ScaleHeight / 3 '- ao_Canvas.TextHeight(ls_Text) / 2
  ao_Canvas.Print ls_Text

  ao_Canvas.ForeColor = vbBlack
  ao_Canvas.FontBold = True
  ao_Canvas.FontSize = 12
  ls_Text = mv_Edge(eDPCSide.esSideC)
  ao_Canvas.CurrentX = ld_PX1 + ld_PW / 2 - ao_Canvas.TextWidth(ls_Text) / 2
  ao_Canvas.CurrentY = ld_PY1 + ao_Canvas.TextHeight(ls_Text) / 2
  ao_Canvas.Print ls_Text
  ls_Text = mv_Edge(eDPCSide.esSideD)
  ao_Canvas.CurrentX = ld_PX1 + ld_PW / 2 - ao_Canvas.TextWidth(ls_Text) / 2
  ao_Canvas.CurrentY = ld_PY2 - 1.5 * ao_Canvas.TextHeight(ls_Text)
  ao_Canvas.Print ls_Text
  ls_Text = mv_Edge(eDPCSide.esSideE)
  ao_Canvas.CurrentX = ld_PX1 + 1.5 * ao_Canvas.TextWidth(ls_Text)
  ao_Canvas.CurrentY = ld_PY1 + ld_PH / 2 - ao_Canvas.TextHeight(ls_Text) / 2
  ao_Canvas.Print ls_Text
  ls_Text = mv_Edge(eDPCSide.esSideF)
  ao_Canvas.CurrentX = ld_PX2 - 2.5 * ao_Canvas.TextWidth(ls_Text)
  ao_Canvas.CurrentY = ld_PY1 + ld_PH / 2 - ao_Canvas.TextHeight(ls_Text) / 2
  ao_Canvas.Print ls_Text
  Exit Sub
ErrHandler:
  Call ErrorHandler("DrawVisualDrawing")
End Sub

Private Sub DrawShadowModule(ByVal ao_Canvas As PictureBox, ByVal ad_X1 As Double, ByVal ad_Y1 As Double, ByVal ad_X2 As Double, ByVal ad_Y2 As Double, ByVal ad_Width As Double, ByVal ad_Height As Double, ByVal al_ForeColor As Long, ByVal al_FillColor As Long)
On Error GoTo ErrHandler

  ao_Canvas.ForeColor = al_ForeColor
  ao_Canvas.FillColor = al_FillColor
  ' panels on top left side
  ao_Canvas.Line (ad_X1 - ad_Width, ad_Y1 - ad_Height)-(ad_X2 - ad_Width, ad_Y2 - ad_Height), , B
  ' panels on top middle side
  ao_Canvas.Line (ad_X1, ad_Y1 - ad_Height)-(ad_X2, ad_Y2 - ad_Height), , B
  ' panels on top right side
  ao_Canvas.Line (ad_X1 + ad_Width, ad_Y1 - ad_Height)-(ad_X2 + ad_Width, ad_Y2 - ad_Height), , B
  
  ' panel on left side
  ao_Canvas.Line (ad_X1 - ad_Width, ad_Y1)-(ad_X2 - ad_Width, ad_Y2), , B
  ' panel on right side
  ao_Canvas.Line (ad_X1 + ad_Width, ad_Y1)-(ad_X2 + ad_Width, ad_Y2), , B
  ' panels on bottom left side
  ao_Canvas.Line (ad_X1 - ad_Width, ad_Y1 + ad_Height)-(ad_X2 - ad_Width, ad_Y2 + ad_Height), , B
  ' panel of bottom middle side
  ao_Canvas.Line (ad_X1, ad_Y1 + ad_Height)-(ad_X2, ad_Y2 + ad_Height), , B
  ' panel of bottom right side
  ao_Canvas.Line (ad_X1 + ad_Width, ad_Y1 + ad_Height)-(ad_X2 + ad_Width, ad_Y2 + ad_Height), , B

  Exit Sub
ErrHandler:
  Call ErrorHandler("DrawShadowModule")
End Sub

Private Sub DrawMeasure(ByVal ao_Canvas As PictureBox, ByVal ad_X1 As Double, _
  ByVal ad_Y1 As Double, ByVal ad_D1 As Double, ByVal ad_D2 As Double, ByVal as_Direction As String, ByVal as_Text As String)
On Error GoTo ErrHandler
  
  Dim ld_Arrow As Double
  
  ao_Canvas.ForeColor = vbBlue
  ao_Canvas.DrawStyle = DrawStyleConstants.vbSolid
  ao_Canvas.FillColor = ColorConstants.vbBlack
  ao_Canvas.FillStyle = FillStyleConstants.vbFSSolid
  ao_Canvas.DrawWidth = 2
  ao_Canvas.FontBold = True
  ao_Canvas.FontSize = 12
  
  ld_Arrow = 150
  If StrComp(as_Direction, "Top", vbTextCompare) = 0 Then
    Call mo_Tools.DrawLine(ao_Canvas, ad_X1, ad_Y1, ad_X1, ad_D2)
    If Abs(ad_Y1 - ad_D1) / 2 <= ld_Arrow Then
      ld_Arrow = -ld_Arrow
    End If
    Call mo_Tools.DrawLine(ao_Canvas, ad_X1 + ld_Arrow, ad_Y1 - ld_Arrow, ad_X1, ad_Y1)
    Call mo_Tools.DrawLine(ao_Canvas, ad_X1 - ld_Arrow, ad_Y1 - ld_Arrow, ad_X1, ad_Y1)
    Call mo_Tools.DrawLine(ao_Canvas, ad_X1 + ld_Arrow, ad_D1 + ld_Arrow, ad_X1, ad_D1)
    Call mo_Tools.DrawLine(ao_Canvas, ad_X1 - ld_Arrow, ad_D1 + ld_Arrow, ad_X1, ad_D1)
  
    ao_Canvas.CurrentX = ad_X1 + 100
    ao_Canvas.CurrentY = ad_D2
    ao_Canvas.Print as_Text
  ElseIf StrComp(as_Direction, "Bottom", vbTextCompare) = 0 Then
    Call mo_Tools.DrawLine(ao_Canvas, ad_X1, ad_Y1, ad_X1, ad_D2)
    If Abs(ad_Y1 - ad_D1) / 2 <= ld_Arrow Then
      ld_Arrow = -ld_Arrow
    End If
    
    Call mo_Tools.DrawLine(ao_Canvas, ad_X1 + ld_Arrow, ad_Y1 + ld_Arrow, ad_X1, ad_Y1)
    Call mo_Tools.DrawLine(ao_Canvas, ad_X1 - ld_Arrow, ad_Y1 + ld_Arrow, ad_X1, ad_Y1)
    Call mo_Tools.DrawLine(ao_Canvas, ad_X1 + ld_Arrow, ad_D1 - ld_Arrow, ad_X1, ad_D1)
    Call mo_Tools.DrawLine(ao_Canvas, ad_X1 - ld_Arrow, ad_D1 - ld_Arrow, ad_X1, ad_D1)
  
    ao_Canvas.CurrentX = ad_X1 + 100
    ao_Canvas.CurrentY = ad_D2 - ao_Canvas.TextHeight(as_Text)
    ao_Canvas.Print as_Text
  ElseIf StrComp(as_Direction, "Left", vbTextCompare) = 0 Then
    Call mo_Tools.DrawLine(ao_Canvas, ad_X1, ad_Y1, ad_D2, ad_Y1)
    If Abs(ad_X1 - ad_D1) / 2 <= ld_Arrow Then
      ld_Arrow = -ld_Arrow
    End If
    
    Call mo_Tools.DrawLine(ao_Canvas, ad_X1 - ld_Arrow, ad_Y1 - ld_Arrow, ad_X1, ad_Y1)
    Call mo_Tools.DrawLine(ao_Canvas, ad_X1 - ld_Arrow, ad_Y1 + ld_Arrow, ad_X1, ad_Y1)
    Call mo_Tools.DrawLine(ao_Canvas, ad_D1 + ld_Arrow, ad_Y1 - ld_Arrow, ad_D1, ad_Y1)
    Call mo_Tools.DrawLine(ao_Canvas, ad_D1 + ld_Arrow, ad_Y1 + ld_Arrow, ad_D1, ad_Y1)
  
    ao_Canvas.CurrentX = ad_D2
    ao_Canvas.CurrentY = ad_Y1 - ao_Canvas.TextHeight(as_Text)
    ao_Canvas.Print as_Text
  ElseIf StrComp(as_Direction, "Right", vbTextCompare) = 0 Then
    Call mo_Tools.DrawLine(ao_Canvas, ad_X1, ad_Y1, ad_D2, ad_Y1)
    If Abs(ad_X1 - ad_D1) / 2 <= ld_Arrow Then
      ld_Arrow = -ld_Arrow
    End If
    
    Call mo_Tools.DrawLine(ao_Canvas, ad_X1 + ld_Arrow, ad_Y1 - ld_Arrow, ad_X1, ad_Y1)
    Call mo_Tools.DrawLine(ao_Canvas, ad_X1 + ld_Arrow, ad_Y1 + ld_Arrow, ad_X1, ad_Y1)
    Call mo_Tools.DrawLine(ao_Canvas, ad_D1 - ld_Arrow, ad_Y1 - ld_Arrow, ad_D1, ad_Y1)
    Call mo_Tools.DrawLine(ao_Canvas, ad_D1 - ld_Arrow, ad_Y1 + ld_Arrow, ad_D1, ad_Y1)
  
    ao_Canvas.CurrentX = ad_D2 - ao_Canvas.TextWidth(as_Text)
    ao_Canvas.CurrentY = ad_Y1 - ao_Canvas.TextHeight(as_Text)
    ao_Canvas.Print as_Text
  End If
  
  Exit Sub
ErrHandler:
  Call ErrorHandler("DrawMeasure")
End Sub

Private Sub DashLine(ByVal ao_Canvas As PictureBox, ByVal x1 As _
    Single, ByVal y1 As Single, ByVal x2 As Single, ByVal _
    y2 As Single, ByVal dash_length As Single, ByVal _
    skip_length As Single, ByVal draw_width As Integer)
On Error GoTo ErrHandler

Dim dash_dx As Single
Dim dash_dy As Single
Dim skip_dx As Single
Dim skip_dy As Single
Dim length As Single
Dim x As Single
Dim y As Single
Dim i As Integer
Dim i_max As Integer

  ' Get vectors in the desired direction
  ' with the right length.
  skip_dx = x2 - x1
  skip_dy = y2 - y1
  length = Sqr(skip_dx * skip_dx + skip_dy * skip_dy)
  If length > 0 Then
    dash_dx = skip_dx / length * dash_length
    dash_dy = skip_dy / length * dash_length
    skip_dx = skip_dx / length * skip_length
    skip_dy = skip_dy / length * skip_length
  
    ao_Canvas.DrawWidth = draw_width
    x = x1
    y = y1
    i_max = Int(length / (dash_length + skip_length))
    For i = 1 To i_max
        ao_Canvas.Line (x, y)-Step(dash_dx, dash_dy)
        x = x + dash_dx + skip_dx
        y = y + dash_dy + skip_dy
    Next i
  
    ' See how much line is undrawn.
    length = length - i_max * (dash_length + skip_length)
    If length > dash_length Then
        ao_Canvas.Line (x, y)-Step(dash_dx, dash_dy)
    Else
        ao_Canvas.Line (x, y)-(x2, y2)
    End If
  End If
  Exit Sub
ErrHandler:
  Call ErrorHandler("DashLine")
End Sub

Private Sub DrawPanelSketch(ByVal ao_Canvas As PictureBox)
On Error GoTo ErrHandler

Dim ld_AspectRatioX As Double
Dim ld_AspectRatioY As Double
Dim ld_AspectRatio As Double
Dim ld_PanelX1 As Double, ld_PanelX2 As Double
Dim ld_PanelY1 As Double, ld_PanelY2 As Double
Dim ld_ModuleX1 As Double, ld_ModuleX2 As Double
Dim ld_ModuleY1 As Double, ld_ModuleY2 As Double
Dim ld_Width As Double, ld_Height As Double
Dim ll_IdxX As Long, ll_IdxY As Long
Dim ld_ModuleW As Double, ld_ModuleH As Double
Dim ld_PanelW As Double, ld_PanelH As Double
Dim lo_Cutout As DPC_Cutout
Dim ls_Text As String

  Call ao_Canvas.Cls
  If mo_PrdConfig.RPL_ModA <= 0 Then Exit Sub
  If mo_PrdConfig.RPL_ModB <= 0 Then Exit Sub
  If mo_PrdConfig.RPL_PanA <= 0 Then Exit Sub
  If mo_PrdConfig.RPL_PanB <= 0 Then Exit Sub
  
  ld_Width = ao_Canvas.ScaleWidth 'ao_Canvas.ScaleX(ao_Canvas.ScaleWidth, vbTwips, vbPixels)
  ld_Height = ao_Canvas.ScaleHeight 'ao_Canvas.ScaleY(ao_Canvas.ScaleHeight, vbTwips, vbPixels)
  
  ld_AspectRatioX = ld_Width / (mo_PrdConfig.RPL_ModA * 1.1)
  ld_AspectRatioY = ld_Height / (mo_PrdConfig.RPL_ModB * 1.1)
  
  If ld_AspectRatioX < ld_AspectRatioY Then
    ld_AspectRatio = ld_AspectRatioX
  Else
    ld_AspectRatio = ld_AspectRatioY
  End If
  
  ld_ModuleX1 = (ld_Width - mo_PrdConfig.RPL_ModA * ld_AspectRatio) / 2
  ld_ModuleX2 = (ld_Width + mo_PrdConfig.RPL_ModA * ld_AspectRatio) / 2
  
  ld_ModuleY1 = (ld_Height - mo_PrdConfig.RPL_ModB * ld_AspectRatio) / 2
  ld_ModuleY2 = (ld_Height + mo_PrdConfig.RPL_ModB * ld_AspectRatio) / 2
  
  ao_Canvas.ForeColor = vbGreen
  ao_Canvas.FillColor = vbGreen
  ao_Canvas.FillStyle = FillStyleConstants.vbFSSolid
  ao_Canvas.BorderStyle = BorderStyleConstants.vbBSSolid
  ao_Canvas.DrawWidth = 1
  ao_Canvas.DrawStyle = DrawStyleConstants.vbSolid
  ao_Canvas.Line (ld_ModuleX1, ld_ModuleY1)-(ld_ModuleX2, ld_ModuleY2), , B
  
  ld_PanelX1 = ld_ModuleX1 + 2 * mo_PrdConfig.RPL_Gap(eDPCSide.esSideE) * ld_AspectRatio
  ld_PanelX2 = ld_ModuleX2 - 2 * mo_PrdConfig.RPL_Gap(eDPCSide.esSideF) * ld_AspectRatio
  
  ld_PanelY1 = ld_ModuleY1 + 2 * mo_PrdConfig.RPL_Gap(eDPCSide.esSideC) * ld_AspectRatio
  ld_PanelY2 = ld_ModuleY2 - 2 * mo_PrdConfig.RPL_Gap(eDPCSide.esSideD) * ld_AspectRatio
  
  ao_Canvas.ForeColor = vbBlack
  ao_Canvas.FillColor = vbWhite
  ao_Canvas.FillStyle = FillStyleConstants.vbFSSolid
  ao_Canvas.BorderStyle = BorderStyleConstants.vbBSSolid
  ao_Canvas.DrawWidth = 1
  ao_Canvas.DrawStyle = DrawStyleConstants.vbSolid
  ld_ModuleW = ld_ModuleX2 - ld_ModuleX1
  ld_ModuleH = ld_ModuleY2 - ld_ModuleY1
  For ll_IdxX = -5 To 5
    For ll_IdxY = -5 To 5
      ao_Canvas.Line (ld_PanelX1 + (ll_IdxX * ld_ModuleW), ld_PanelY1 + (ll_IdxY * ld_ModuleH))-(ld_PanelX2 + (ll_IdxX * ld_ModuleW), ld_PanelY2 + (ll_IdxY * ld_ModuleH)), , B
    Next
  Next
  
  ld_PanelW = ld_PanelX2 - ld_PanelX1
  ld_PanelH = ld_PanelY2 - ld_PanelY1
  
  If mo_PrdConfig.HasPerforation Then
    ao_Canvas.FillColor = vbGrayed
    ao_Canvas.FillStyle = vbDiagonalCross
    ao_Canvas.BorderStyle = vbTransparent
    ao_Canvas.DrawWidth = 1
    ao_Canvas.DrawStyle = vbTransparent
    If (mo_PrdConfig.RPL_UBor(eDPCSide.esSideC) > 0) Or (mo_PrdConfig.RPL_UBor(eDPCSide.esSideD) > 0) Or (mo_PrdConfig.RPL_UBor(eDPCSide.esSideE) > 0) Or (mo_PrdConfig.RPL_UBor(eDPCSide.esSideF) > 0) Then
      ao_Canvas.Line (ld_PanelX1 + mo_PrdConfig.RPL_UBor(eDPCSide.esSideE) * ld_AspectRatio, ld_PanelY1 + mo_PrdConfig.RPL_UBor(eDPCSide.esSideC) * ld_AspectRatio)-(ld_PanelX2 - mo_PrdConfig.RPL_UBor(eDPCSide.esSideF) * ld_AspectRatio, ld_PanelY2 - mo_PrdConfig.RPL_UBor(eDPCSide.esSideD) * ld_AspectRatio), , B
    Else
      ao_Canvas.Line (ld_PanelX1, ld_PanelY1)-(ld_PanelX2, ld_PanelY2), , B
    End If
  End If
  
  ao_Canvas.FillColor = vbGrayText
  ao_Canvas.FillStyle = vbSolid
  ao_Canvas.BorderStyle = vbBSSolid
  For Each lo_Cutout In mo_PrdConfig.Cutouts
    If lo_Cutout.RowStatus <> eDPCRowStatus.rsDrop Then
      If lo_Cutout.CUT_Shape = eDPCCutoutShape.eRectangular Then
        ao_Canvas.Line (ld_PanelX1 + lo_Cutout.PCT_SizeM * ld_AspectRatio, ld_PanelY1 + lo_Cutout.PCT_SizeL * ld_AspectRatio)-(ld_PanelX1 + lo_Cutout.PCT_SizeM * ld_AspectRatio + lo_Cutout.PCT_SizeJ * ld_AspectRatio, ld_PanelY1 + lo_Cutout.PCT_SizeL * ld_AspectRatio + lo_Cutout.PCT_SizeK * ld_AspectRatio), , B
      ElseIf lo_Cutout.CUT_Shape = eDPCCutoutShape.eRound Then
        ao_Canvas.Circle (ld_PanelX1 + lo_Cutout.PCT_SizeM * ld_AspectRatio, ld_PanelY1 + lo_Cutout.PCT_SizeL * ld_AspectRatio), lo_Cutout.PCT_SizeD / 2 * ld_AspectRatio
      End If
    End If
  Next
  
  Dim ls_Edge As String
  ao_Canvas.Font = "Arial"
  ao_Canvas.FontBold = True
  ao_Canvas.FontSize = 14
  ao_Canvas.ForeColor = vbBlack
  
  ls_Edge = mv_Edge(eDPCSide.esSideC)
  ao_Canvas.CurrentX = ld_PanelX1 + ld_PanelW / 2 - ao_Canvas.TextWidth(ls_Edge) / 2
  ao_Canvas.CurrentY = ld_PanelY1 + ao_Canvas.TextHeight(ls_Edge) / 2
  ao_Canvas.Print ls_Edge
  ls_Edge = mv_Edge(eDPCSide.esSideD)
  ao_Canvas.CurrentX = ld_PanelX1 + ld_PanelW / 2 - ao_Canvas.TextWidth(ls_Edge) / 2
  ao_Canvas.CurrentY = ld_PanelY2 - 1.5 * ao_Canvas.TextHeight(ls_Edge)
  ao_Canvas.Print ls_Edge
  ls_Edge = mv_Edge(eDPCSide.esSideE)
  ao_Canvas.CurrentX = ld_PanelX1 + 1.5 * ao_Canvas.TextWidth(ls_Edge)
  ao_Canvas.CurrentY = ld_PanelY1 + ld_PanelH / 2 - ao_Canvas.TextHeight(ls_Edge) / 2
  ao_Canvas.Print ls_Edge
  ls_Edge = mv_Edge(eDPCSide.esSideF)
  ao_Canvas.CurrentX = ld_PanelX2 - 2.5 * ao_Canvas.TextWidth(ls_Edge)
  ao_Canvas.CurrentY = ld_PanelY1 + ld_PanelH / 2 - ao_Canvas.TextHeight(ls_Edge) / 2
  ao_Canvas.Print ls_Edge

  ls_Text = "View from back of tile"
  
  ao_Canvas.FontBold = True
  ao_Canvas.FontSize = 10
  ao_Canvas.CurrentX = ao_Canvas.ScaleWidth / 2 - ao_Canvas.TextWidth(ls_Text) / 2
  ao_Canvas.CurrentY = ao_Canvas.ScaleHeight / 3 '- ao_Canvas.TextHeight(ls_Text) / 2
  ao_Canvas.Print ls_Text
  Exit Sub
ErrHandler:
  Call ErrorHandler("DrawPanelSketch")
End Sub

Private Sub cbo_Bending_ComboItemSelected(Index As Integer)
On Error GoTo ErrHandler
  
  If mb_InternalInit Then Exit Sub
  
  mb_InternalInit = True
  Call mo_Tools.LockScreen(Me, True)
  Call mo_PrdConfig.LoadBending(Index, mo_Tools.GetComboKey(cbo_Bending(Index)))
  Call mo_PrdConfig.SetStandardPanelUZS(Index)
  If (Index = eDPCSide.esSideC) Or (Index = eDPCSide.esSideD) Then
    Call mo_PrdConfig.LoadThicknessHeight(True, False, False)
  Else
    Call mo_PrdConfig.LoadThicknessHeight(False, True, False)
  End If
  'Call mo_PrdConfig.CalculateCoWMinMax
  'Call mo_PrdConfig.CalculateCutAB
  Call DisplayBendingSide(Index)
  Call DisplayBending
  Call mo_Tools.LockScreen(Me, False)
  mb_InternalInit = False
  Exit Sub
ErrHandler:
  Call ErrorMessage("cbo_Bending_ComboItemSelected")
End Sub

Private Sub DisplayBending()
On Error GoTo ErrHandler
  
  Call DisplayOptionalBending
  fra_BendingOption.Visible = Not IsStandard
  
  If mo_PrdConfig.RPL_IsOut > 0 Then
    opt_InOut(mo_PrdConfig.RPL_IsOut - 1).Value = True
  End If
  
  Call mo_Tools.SetTextBox(txt_Tech, "RPL_CoWMin", mo_Tools.DblToScreen(mo_PrdConfig.RPL_CoWMin), IsTemplate)
  Call mo_Tools.SetTextBox(txt_Tech, "RPL_CoWMax", mo_Tools.DblToScreen(mo_PrdConfig.RPL_CoWMax), IsTemplate)
  Call mo_Tools.SetTextBox(txt_Tech, "RPL_CoilW", mo_Tools.DblToScreen(mo_PrdConfig.RPL_CoilW), IsTemplate)
  Call mo_Tools.SetTextBox(txt_Tech, "RPL_CutB", mo_Tools.DblToScreen(mo_PrdConfig.RPL_CutB), IsTemplate)
  Call mo_Tools.SetTextBox(txt_Tech, "RPL_CutA", mo_Tools.DblToScreen(mo_PrdConfig.RPL_CutA), IsTemplate)
  Call mo_Tools.SetTextBox(txt_Tech, "RPL_Thick", mo_Tools.DblToScreen(mo_PrdConfig.RPL_Thick), False)
  Exit Sub
ErrHandler:
  Call ErrorHandler("DisplayBending")
End Sub

Private Sub DisplayBendingSide(ByVal al_SideIdx As Long)
On Error GoTo ErrHandler

Dim lb_EnableH As Boolean
Dim lb_EnableUZS As Boolean
Dim ll_IMG_Id As Long
Dim lb_NotchClosed As Boolean
Dim ls_Value As String


  If Not cbo_Bending(al_SideIdx).SearchItem(mo_PrdConfig.BND_Id(al_SideIdx)) Then
    Call cbo_Bending(al_SideIdx).Clear
    If mo_PrdConfig.BND_Id(al_SideIdx) <> "" Then
      Call cbo_Bending(al_SideIdx).AddItem(Array(mo_PrdConfig.BND_Id(al_SideIdx), mo_PrdConfig.BND_Name(al_SideIdx)), True)
    End If
  End If
  
  ' remove editing for Level 2 items standard configurator
  cbo_Bending(al_SideIdx).Enabled = IsTemplate Or _
                                    (mo_PrdConfig.LEV_Id = eDPCLevel.lvEngineered) Or _
                                    ((mo_PrdConfig.LEV_Id = eDPCLevel.lvCustom) And (mo_PrdConfig.SYS_BaeType = 0))
                                    
  ' ((Not mo_PrdConfig.BND_IsCus(al_SideIdx)) And (Not IsStandard)) Or
  
  If (al_SideIdx = eDPCSide.esSideC) Or (al_SideIdx = eDPCSide.esSideD) Then
    lb_EnableH = ((Not mo_PrdConfig.RPL_SBndA) And (Not IsStandard)) Or IsTemplate
    lb_EnableUZS = ((Not mo_PrdConfig.RPL_SUZA) And (Not IsStandard)) Or IsTemplate
    
    chk_StandardBendingA.Value = IIf(mo_PrdConfig.RPL_SBndA, vbChecked, vbUnchecked)
    chk_StandardUZSA.Value = IIf(mo_PrdConfig.RPL_SUZA, vbChecked, vbUnchecked)
    
    Call mo_Tools.EnableControl(chk_StandardBendingA, IsTemplate Or ((Not mo_PrdConfig.BND_IsCus(al_SideIdx)) And (Not IsStandard)) Or (mo_PrdConfig.LEV_Id = eDPCLevel.lvEngineered))
    Call mo_Tools.EnableControl(chk_StandardUZSA, IsTemplate Or ((Not IsStandard) And (Not mo_PrdConfig.RPL_SBndA)))
  ElseIf (al_SideIdx = eDPCSide.esSideE) Or (al_SideIdx = eDPCSide.esSideF) Then
    lb_EnableH = ((Not mo_PrdConfig.RPL_SBndB) And (Not IsStandard)) Or IsTemplate
    lb_EnableUZS = ((Not mo_PrdConfig.RPL_SUZB) And (Not IsStandard)) Or IsTemplate
    
    chk_StandardBendingB.Value = IIf(mo_PrdConfig.RPL_SBndB, vbChecked, vbUnchecked)
    chk_StandardUZSB.Value = IIf(mo_PrdConfig.RPL_SUZB, vbChecked, vbUnchecked)
    
    Call mo_Tools.EnableControl(chk_StandardBendingB, IsTemplate Or ((Not mo_PrdConfig.BND_IsCus(al_SideIdx)) And (Not IsStandard)) Or (mo_PrdConfig.LEV_Id = eDPCLevel.lvEngineered))
    Call mo_Tools.EnableControl(chk_StandardUZSB, IsTemplate Or ((Not IsStandard) And (Not mo_PrdConfig.RPL_SBndB)))
  Else
    Err.Raise ArmErr.InvalidArgument, "al_SideIdx", "Invalid side index: " & al_SideIdx
  End If
  
  ls_Value = IIf(mo_PrdConfig.RPL_H(al_SideIdx) >= 0 And (Not mo_PrdConfig.BND_IsCus(al_SideIdx)), mo_Tools.DblToScreen(mo_PrdConfig.RPL_H(al_SideIdx)), "")
  Call mo_Tools.SetTextBox(txt_Textbox, "RPL_H" & mv_Edge(al_SideIdx), ls_Value, lb_EnableH, mo_PrdConfig.BND_HasH(al_SideIdx))
  ls_Value = IIf(mo_PrdConfig.RPL_S(al_SideIdx) >= 0 And (Not mo_PrdConfig.BND_IsCus(al_SideIdx)), mo_Tools.DblToScreen(mo_PrdConfig.RPL_S(al_SideIdx)), "")
  Call mo_Tools.SetTextBox(txt_Textbox, "RPL_S" & mv_Edge(al_SideIdx), ls_Value, lb_EnableUZS, mo_PrdConfig.BND_HasS(al_SideIdx))
  
  ls_Value = IIf(mo_PrdConfig.RPL_U(al_SideIdx) >= 0 And (Not mo_PrdConfig.BND_IsCus(al_SideIdx)), mo_Tools.DblToScreen(mo_PrdConfig.RPL_U(al_SideIdx)), "")
  If (al_SideIdx = eDPCSide.esSideC) Or (al_SideIdx = eDPCSide.esSideD) Then
    Call mo_Tools.SetTextBox(txt_Textbox, "RPL_U" & mv_Edge(al_SideIdx), ls_Value, False, mo_PrdConfig.BND_HasU(al_SideIdx))
  Else
    Call mo_Tools.SetTextBox(txt_Textbox, "RPL_U" & mv_Edge(al_SideIdx), ls_Value, lb_EnableUZS, mo_PrdConfig.BND_HasU(al_SideIdx))
  End If
  
  If (al_SideIdx = eDPCSide.esSideC) Or (al_SideIdx = eDPCSide.esSideD) Then
    ls_Value = IIf(mo_PrdConfig.RPL_UMin(al_SideIdx) >= 0 And (Not mo_PrdConfig.BND_IsCus(al_SideIdx)), mo_Tools.DblToScreen(mo_PrdConfig.RPL_UMin(al_SideIdx)), "")
    Call mo_Tools.SetTextBox(txt_Textbox, "RPL_UMin" & mv_Edge(al_SideIdx), ls_Value, lb_EnableUZS, mo_PrdConfig.BND_HasU(al_SideIdx))
    ls_Value = IIf(mo_PrdConfig.RPL_UMax(al_SideIdx) >= 0 And (Not mo_PrdConfig.BND_IsCus(al_SideIdx)), mo_Tools.DblToScreen(mo_PrdConfig.RPL_UMax(al_SideIdx)), "")
    Call mo_Tools.SetTextBox(txt_Textbox, "RPL_UMax" & mv_Edge(al_SideIdx), ls_Value, lb_EnableUZS, mo_PrdConfig.BND_HasU(al_SideIdx))
  End If
  
  chk_RPL_BVis(al_SideIdx).Enabled = mo_PrdConfig.BND_CanVi(al_SideIdx) And (Not IsStandard)
  chk_RPL_NClo(al_SideIdx).Enabled = mo_PrdConfig.BND_CanVi(al_SideIdx) And (Not IsStandard)
  chk_RPL_BVis(al_SideIdx).Value = IIf(mo_PrdConfig.RPL_BVis(al_SideIdx), vbChecked, vbUnchecked)
  chk_RPL_NClo(al_SideIdx).Value = IIf(mo_PrdConfig.RPL_NClo(al_SideIdx), vbChecked, vbUnchecked)
  
  
  If (al_SideIdx = eDPCSide.esSideC) Or (al_SideIdx = eDPCSide.esSideD) Then
    lb_NotchClosed = mo_PrdConfig.RPL_NClo(eDPCSide.esSideE) Or mo_PrdConfig.RPL_NClo(eDPCSide.esSideF)
  Else
    lb_NotchClosed = mo_PrdConfig.RPL_NClo(eDPCSide.esSideC) Or mo_PrdConfig.RPL_NClo(eDPCSide.esSideD)
  End If
  
  If lb_NotchClosed Then
    If (al_SideIdx = eDPCSide.esSideC) Or (al_SideIdx = eDPCSide.esSideE) Then
      ll_IMG_Id = mo_PrdConfig.IMG_IdV2BND(al_SideIdx)
    Else
      ll_IMG_Id = mo_PrdConfig.IMG_IdVBND(al_SideIdx)
    End If
  Else
    If (al_SideIdx = eDPCSide.esSideC) Or (al_SideIdx = eDPCSide.esSideE) Then
      ll_IMG_Id = mo_PrdConfig.IMG_Id2BND(al_SideIdx)
    Else
      ll_IMG_Id = mo_PrdConfig.IMG_IdBND(al_SideIdx)
    End If
  End If
  Call mo_Tools.DrawDPCImage(mo_Db, mo_FSO, ms_DPCImageCachePath, ll_IMG_Id, pct_Bending(al_SideIdx))
  Exit Sub
ErrHandler:
  Call ErrorHandler("DisplayBendingSide")
End Sub

Private Sub DisplayPerimeter()
On Error GoTo ErrHandler

  chk_PerimeterTrim.Value = IIf(mo_PrdConfig.RPL_PerDe = eDPCPerimeterDelivery.pdSeparate, vbChecked, vbUnchecked)
  Call mo_Tools.SetTextBox(txt_Textbox, "RPL_SwGap", mo_Tools.DblToScreen(mo_PrdConfig.RPL_SwGap), True, mo_PrdConfig.RPL_PerDe = eDPCPerimeterDelivery.pdSeparate)
  Call mo_Tools.SetLabelVisible(lbl_Label, "lbl_ShadowGap", mo_PrdConfig.RPL_PerDe = eDPCPerimeterDelivery.pdSeparate)
  Exit Sub
ErrHandler:
  Call ErrorHandler("DisplayPerimeter")
End Sub
  
Private Sub DisplayPriceValidity(ByVal ao_OfferPos As DPC_OfferPos)
On Error GoTo ErrHandler

Dim lo_CheckBox As CheckBox

  Set lo_CheckBox = mo_Tools.GetControl(chk_Price, "chk_" & ao_OfferPos.DOF_Tag)
  If Not lo_CheckBox Is Nothing Then
    lo_CheckBox.Value = IIf(ao_OfferPos.OFD_Valid, vbChecked, vbUnchecked)
    Call mo_Tools.SetLabelVisible(lbl_Price, "_lbl_CURR_" & ao_OfferPos.DOF_Tag, ao_OfferPos.OFD_Valid)
    Call mo_Tools.SetTextVisible(txt_Price, "txt_" & ao_OfferPos.DOF_Tag & "_A", ao_OfferPos.OFD_Valid)
    Call mo_Tools.SetTextVisible(txt_Price, "txt_" & ao_OfferPos.DOF_Tag & "_M", ao_OfferPos.OFD_Valid)
  End If
  Exit Sub
ErrHandler:
  Call ErrorHandler("DisplayPriceValidity")
End Sub

Private Sub DisplayPriceVisibility()
On Error GoTo ErrHandler

  Dim lo_Offer As DPC_OfferPos
  
  For Each lo_Offer In mo_PrdConfig.OfferPrice
    Call DisplayPriceValidity(lo_Offer)
  Next
  If Not (mo_CurrentInlay Is Nothing) Then
    For Each lo_Offer In mo_CurrentInlay.OfferPrice
      Call DisplayPriceValidity(lo_Offer)
    Next
  End If
  If Not (mo_CurrentCutout Is Nothing) Then
    For Each lo_Offer In mo_CurrentCutout.OfferPrice
      Call DisplayPriceValidity(lo_Offer)
    Next
  End If
  Exit Sub
ErrHandler:
  Call ErrorHandler("DisplayPriceVisibility")
End Sub

Private Function GetIMG_IdBNDField(ByVal al_SideIdx As Long) As String
On Error GoTo ErrHandler

Dim ll_IMG_Id As Long

  If mo_PrdConfig.RPL_NClo(al_SideIdx) Then
    If (al_SideIdx = eDPCSide.esSideC) Or (al_SideIdx = eDPCSide.esSideE) Then
      GetIMG_IdBNDField = "IMG_IdV2"
    Else
      GetIMG_IdBNDField = "IMG_IdV"
    End If
  Else
    If (al_SideIdx = eDPCSide.esSideC) Or (al_SideIdx = eDPCSide.esSideE) Then
      GetIMG_IdBNDField = "IMG_Id2"
    Else
      GetIMG_IdBNDField = "IMG_Id"
    End If
  End If
  Exit Function
ErrHandler:
  Call ErrorHandler("GetIMG_IdBNDField")
End Function

Private Sub cbo_Packing_ComboItemSelected()
On Error GoTo ErrHandler
  
  If mb_InternalInit Then Exit Sub
  
  mb_InternalInit = True
  Call mo_Tools.LockScreen(Me, True)
  Call mo_PrdConfig.LoadPacking(mo_Tools.GetComboKey(cbo_Packing))
  Call LoadPackingPrice
  Call DisplayPacking
  Call mo_Tools.LockScreen(Me, False)
  mb_InternalInit = False
  Exit Sub
ErrHandler:
  Call ErrorMessage("cbo_Packing_ComboItemSelected")
End Sub

Private Sub cbo_Labeling_ComboItemSelected()
On Error GoTo ErrHandler
  
  If mb_InternalInit Then Exit Sub
  
  mb_InternalInit = True
  Call mo_Tools.LockScreen(Me, True)
  Call mo_PrdConfig.LoadLabeling(mo_Tools.GetComboKey(cbo_Labeling))
  Call LoadLabelingPrice
  Call DisplayLabeling
  Call mo_Tools.LockScreen(Me, False)
  mb_InternalInit = False
  Exit Sub
ErrHandler:
  Call ErrorMessage("cbo_Labeling_ComboItemSelected")
End Sub

Private Sub cbo_LabelLanguage_ComboItemSelected()
On Error GoTo ErrHandler
  
  If mb_InternalInit Then Exit Sub
  
  mb_InternalInit = True
  Call mo_Tools.LockScreen(Me, True)
  mo_PrdConfig.RPL_LabLng = mo_Tools.GetComboKey(cbo_LabelLanguage)
  mo_PrdConfig.RPL_LabLngDesc = cbo_LabelLanguage.Text
  Call mo_Tools.LockScreen(Me, False)
  mb_InternalInit = False
  Exit Sub
ErrHandler:
  Call ErrorMessage("cbo_LabelLanguage_ComboItemSelected")
End Sub

Private Sub opt_PackLogo_Click(Index As Integer)
On Error GoTo ErrHandler
  
  If mb_InternalInit Then Exit Sub
  
  mb_InternalInit = True
  Call mo_Tools.LockScreen(Me, True)
  mo_PrdConfig.RPL_PkgLogo = mo_Tools.WhichOptionIsTrue(opt_PackLogo)
  Call mo_Tools.LockScreen(Me, False)
  mb_InternalInit = False
  Exit Sub
ErrHandler:
  Call ErrorMessage("cbo_LabelLanguage_ComboItemSelected")
End Sub

Private Sub cbo_PerfView_ComboItemSelected()
On Error GoTo ErrHandler

  If mb_InternalInit Then Exit Sub
  mb_InternalInit = True
  Call mo_Tools.LockScreen(Me, True)
  If Not cbo_PerfView.SelectedItem Is Nothing Then
    mv_PerfTreeviewInfo = mo_Tools.LoadTreeViewInfo(mo_Db, TREEVIEW_PERFORATION, cbo_PerfView.SelectedItem.Key)
    Call LoadTreeView(tvw_Perforation, mv_PerfTreeviewInfo)
  End If
  Call mo_Tools.LockScreen(Me, False)
  mb_InternalInit = False
  Exit Sub
ErrHandler:
  Call ErrorMessage("cbo_PerfView_ComboItemSelected")
End Sub

Private Sub cbo_Perforation_ComboItemSelected()
On Error GoTo ErrHandler
  
  If mb_InternalInit Then Exit Sub
  mb_InternalInit = True
  Call mo_Tools.LockScreen(Me, True)
  Call mo_PrdConfig.LoadPerforation(mo_Tools.GetComboKey(cbo_Perforation))
  Call LoadPerforationPrice
  Call LoadPanelPrice
  Call DisplayPerforation
  Call DisplayPerforationBorder
  Call mo_Tools.LockScreen(Me, False)
  mb_InternalInit = False
  Exit Sub
ErrHandler:
  Call ErrorMessage("cbo_Perforation_ComboItemSelected")
End Sub

Private Sub opt_InOut_Click(Index As Integer)
On Error GoTo ErrHandler
  
  If mb_InternalInit Then Exit Sub
  mb_InternalInit = True
  Call mo_Tools.LockScreen(Me, True)
  mo_PrdConfig.RPL_IsOut = IIf(Index = 0, eDPCPanelInOut.ioInside, eDPCPanelInOut.ioOutside)
  Call mo_Tools.LockScreen(Me, False)
  mb_InternalInit = False
  Exit Sub
ErrHandler:
  Call ErrorMessage("opt_InOut_Click")
End Sub

Private Sub chk_PerimeterTrim_Click()
On Error GoTo ErrHandler
  
  If mb_InternalInit Then Exit Sub
  mb_InternalInit = True
  Call mo_Tools.LockScreen(Me, True)
  mo_PrdConfig.RPL_PerDe = IIf(chk_PerimeterTrim.Value = vbChecked, eDPCPerimeterDelivery.pdSeparate, eDPCPerimeterDelivery.pdNoPerimeter)
  Call DisplayPerimeter
  Call mo_Tools.LockScreen(Me, False)
  mb_InternalInit = False
  Exit Sub
ErrHandler:
  mb_InternalInit = False
  Call ErrorMessage("chk_PerimeterTrim_Click")
End Sub

Private Sub chk_SpcPkg_Click()
On Error GoTo ErrHandler

  If mb_InternalInit Then Exit Sub
  mb_InternalInit = True
  Call mo_Tools.LockScreen(Me, True)
  mo_PrdConfig.RPL_SpcPkg = IIf(chk_SpcPkg.Value = vbChecked, eDPCSpecialPackage.spThermoPalette, eDPCSpecialPackage.spUndef)
  Call DisplayPacking
  Call mo_Tools.LockScreen(Me, False)
  mb_InternalInit = False
  Exit Sub
ErrHandler:
  Call ErrorMessage("chk_SpcPkg_Click")
End Sub

Private Sub opt_QtyType_Click(Index As Integer)
On Error GoTo ErrHandler

  If mb_InternalInit Then Exit Sub
  mb_InternalInit = True
  Call mo_Tools.LockScreen(Me, True)
  Select Case Index
  Case 0
    mo_PrdConfig.PanelQtyM2 = mo_Tools.ScreenToDbl(mo_Tools.GetTextValue(txt_Textbox, "PanelQtyM2"))
  Case 1
    mo_PrdConfig.PanelQtyPCS = mo_Tools.ScreenToLong(mo_Tools.GetTextValue(txt_Textbox, "PanelQtyPCS"))
  End Select
  Call LoadPrice
  Call DisplayPanelQtySize
  Call mo_Tools.LockScreen(Me, False)
  mb_InternalInit = False
  Exit Sub
ErrHandler:
  Call ErrorMessage("opt_QtyType_Click")
End Sub

Private Sub opt_StandardCoating_Click(Index As Integer)
On Error GoTo ErrHandler
  
  If mb_InternalInit Then Exit Sub
  mb_InternalInit = True
  Call mo_Tools.LockScreen(Me, True)
  If Index = 0 Then
    Call mo_PrdConfig.LoadCoating(mo_Tools.GetAConfigData("DPC_Default_COA1"))
  Else
    Call mo_PrdConfig.ResetCoating
    'Call LoadCoatingGrid(tvw_Coating.SelectedItem)
  End If
  Call DisplayCoating
  Call LoadCoatingPrice
  Call mo_Tools.LockScreen(Me, False)
  mb_InternalInit = False
  Exit Sub
ErrHandler:
  Call ErrorMessage("opt_StandardCoating_Click")
End Sub

Private Sub opt_StandardPerforation_Click(Index As Integer)
On Error GoTo ErrHandler

  If mb_InternalInit Then Exit Sub
  mb_InternalInit = True
  Call mo_Tools.LockScreen(Me, True)
  If opt_StandardPerforation(0).Value Then
    mo_PrdConfig.NoPerforation = True
    mo_PrdConfig.RPL_PBord = eDPCPerforationBorderType.pbUndef
    Call mo_PrdConfig.LoadPerforation(mo_Tools.GetAConfigData("DPC_Default_PRF0"))
  ElseIf opt_StandardPerforation(1).Value Then
    Call mo_PrdConfig.LoadPerforation(mo_Tools.GetAConfigData("DPC_Default_PRF1"))
  ElseIf opt_StandardPerforation(2).Value Then
    Call mo_PrdConfig.LoadPerforation(mo_Tools.GetAConfigData("DPC_Default_PRF2"))
  ElseIf opt_StandardPerforation(3).Value Then
    Call mo_PrdConfig.LoadPerforation(mo_Tools.GetAConfigData("DPC_Default_PRF3"))
  Else
    Call mo_PrdConfig.ResetPerforation
    mo_PrdConfig.NoPerforation = False
  End If
  
  Call DisplayPerforationBorder
  Call DisplayPerforation
  Call LoadPerforationPrice
  Call LoadPanelPrice
  Call mo_Tools.LockScreen(Me, False)
  mb_InternalInit = False
  Exit Sub
ErrHandler:
  Call ErrorMessage("opt_StandardPerforation_Click")
End Sub

Private Sub opt_TopPlate_Click(Index As Integer)
On Error GoTo ErrHandler

  If mb_InternalInit Then Exit Sub
  mb_InternalInit = True
  Call mo_Tools.LockScreen(Me, True)
  mo_PrdConfig.RPL_Plate = Index
  mo_PrdConfig.CalcNotchRivet
  Call DisplayInlay
  Call mo_Tools.LockScreen(Me, False)
  mb_InternalInit = False
  Exit Sub
ErrHandler:
  Call ErrorMessage("opt_TopPlate_Click")
End Sub

Private Sub opt_UnperfBorder_Click(Index As Integer)
On Error GoTo ErrHandler

  If mb_InternalInit Then Exit Sub
  
  mb_InternalInit = True
  Call mo_Tools.LockScreen(Me, True)
  Call mo_PrdConfig.LoadPerforationBorder(mo_Tools.WhichOptionIsTrue(opt_UnperfBorder) + 1)
  'mo_PrdConfig.RPL_PBord = mo_Tools.WhichOptionIsTrue(opt_UnperfBorder) + 1
  Call DisplayPerforationBorder
  Call mo_Tools.LockScreen(Me, False)
  mb_InternalInit = False
  Exit Sub
ErrHandler:
  Call ErrorMessage("opt_UnperfBorder_Click")
End Sub

Private Sub pct_Image_Click()
Dim lo_Frm As frmDPC_Image

On Error GoTo ErrHandler

  If StrComp(tbs_Image.SelectedItem.Key, "tab_ImagePanel", vbTextCompare) <> 0 Then Exit Sub
  If Not IsTemplate Then Exit Sub
    
  If mb_InternalInit Then Exit Sub
  mb_InternalInit = True
  Call mo_Tools.LockScreen(Me, True)
  
  Set lo_Frm = New frmDPC_Image
  Load lo_Frm

  If mo_PrdConfig.IMG_Id = 0 Then
    lo_Frm.Mode = eDPCScreenMode.smAdd
  Else
    lo_Frm.Mode = eDPCScreenMode.smUpdate
  End If
  
  lo_Frm.IMG_Id = mo_PrdConfig.IMG_Id
  
  Set lo_Frm.Tools = mo_Tools
  Set lo_Frm.ArmDb = mo_Db
  lo_Frm.Language_Code = ms_Language_Code
  Call lo_Frm.Load_A_COM

  Call mo_Tools.LockScreen(Me, False)
  Call mo_Tools.ShowModalForm(lo_Frm)
  Call mo_Tools.LockScreen(Me, True)

  If lo_Frm.Result = True Then
    mo_PrdConfig.IMG_Id = lo_Frm.IMG_Id
    Call mo_Tools.DrawDPCImage(mo_Db, mo_FSO, ms_DPCImageCachePath, mo_PrdConfig.IMG_Id, pct_Image, "")
  End If
  
  Call lo_Frm.Unload_A_COM
  Unload lo_Frm
  Call mo_Tools.LockScreen(Me, False)
  mb_InternalInit = False
  Exit Sub
ErrHandler:
  Call ErrorMessage("pct_Image_Click")
End Sub


Private Sub tbs_Gasket_Click()
On Error GoTo ErrHandler

  fra_Gasket.Visible = tbs_Gasket.SelectedItem.Index = 1
  fra_Spacer.Visible = tbs_Gasket.SelectedItem.Index = 2
  Exit Sub
ErrHandler:
  Call ErrorMessage("tbs_Gasket_Click")
End Sub

Private Function GetTab(ByVal ao_TabStrip As MSComctlLib.TabStrip, ByVal as_TabKey As String) As MSComctlLib.Tab
On Error GoTo ErrHandler

Dim lo_Tab As MSComctlLib.Tab
  
  Set GetTab = Nothing
  For Each lo_Tab In ao_TabStrip.Tabs
    If StrComp(lo_Tab.Key, as_TabKey, vbTextCompare) = 0 Then
      Set GetTab = lo_Tab
      Exit For
    End If
  Next
  Exit Function
ErrHandler:
  Call ErrorHandler("GetTab")
End Function


Private Function GetTabIndex(ByVal ao_TabStrip As MSComctlLib.TabStrip, ByVal as_TabKey As String)
On Error GoTo ErrHandler

Dim lo_Tab As MSComctlLib.Tab

  GetTabIndex = -1
  Set lo_Tab = GetTab(ao_TabStrip, as_TabKey)
  If Not lo_Tab Is Nothing Then
    GetTabIndex = lo_Tab.Index - 1
  End If
  Exit Function
ErrHandler:
  Call ErrorMessage("GetTabIndex")
End Function

Private Sub tbs_Image_Click()
On Error GoTo ErrHandler

  If mb_InternalInit Then Exit Sub
  mb_InternalInit = True
  Call mo_Tools.LockScreen(Me, True)
  Call DisplayPanelImage
  Call mo_Tools.LockScreen(Me, False)
  mb_InternalInit = False
  Exit Sub
ErrHandler:
  Call ErrorMessage("tbs_Image_Click")
End Sub

Private Sub DisplayPanelImage()
On Error GoTo ErrHandler

Dim lo_TextBox As TextBox

  Call tbs_Image.Move(0, 0, fra_Image.Width)
  Call btn_ImageQuit.Move(fra_Image.Width - btn_Quit.Width, fra_Image.Height - btn_Quit.Height)
  
  pct_Image.Visible = False
  Call pct_Image.Move(0, tbs_Image.Height, fra_Image.Width, fra_Image.Height - tbs_Image.Height)
  Set lo_TextBox = mo_Tools.GetControl(txt_Textbox, "PRD_OfferComment")
  lo_TextBox.Visible = False
  Call lo_TextBox.Move(0, tbs_Image.Height, fra_Image.Width, fra_Image.Height - tbs_Image.Height)
  Set lo_TextBox = mo_Tools.GetControl(txt_Textbox, "PRD_InternalComment")
  lo_TextBox.Visible = False
  Call lo_TextBox.Move(0, tbs_Image.Height, fra_Image.Width, fra_Image.Height - tbs_Image.Height)
  
  Select Case UCase(tbs_Image.SelectedItem.Key)
  Case UCase("tab_ImageDrawing")
    Call DrawVisualDrawing(pct_Image)
    pct_Image.Visible = True
  Case UCase("tab_ImageSketch")
    Call DrawPanelSketch(pct_Image)
    pct_Image.Visible = True
  Case UCase("tab_ImagePanel")
    Call mo_Tools.DrawDPCImage(mo_Db, mo_FSO, ms_DPCImageCachePath, mo_PrdConfig.IMG_Id, pct_Image, "")
    pct_Image.Visible = True
  Case UCase("tab_ImageSystem")
    Call mo_Tools.DrawDPCImage(mo_Db, mo_FSO, ms_DPCImageCachePath, mo_PrdConfig.IMG_IdSYS, pct_Image, "")
    pct_Image.Visible = True
  Case UCase("tab_OfferComment")
    Set lo_TextBox = mo_Tools.GetControl(txt_Textbox, "PRD_OfferComment")
    lo_TextBox.Visible = True
  Case UCase("tab_InternalComment")
    Set lo_TextBox = mo_Tools.GetControl(txt_Textbox, "PRD_InternalComment")
    lo_TextBox.Visible = True
  Case Else
    Err.Raise ArmErr.InvalidArgument, "tbs_Image.SelectedItem.Key", "Unknown tab key : " & tbs_Image.SelectedItem.Key
  End Select
  Exit Sub
ErrHandler:
  Call ErrorHandler("DisplayPanelImage")
End Sub

Private Sub tbs_Step_BeforeClick(Cancel As Integer)
On Error GoTo ErrHandler
  
  If IsStandard Then
    Cancel = False
  Else
    Cancel = Not mb_InternalInit
  End If
  Exit Sub
ErrHandler:
  Call ErrorMessage("tbs_Step_BeforeClick")
End Sub

Private Sub tlb_InlayDetail_action(ByVal as_Role As String, as_Language As String)
On Error GoTo ErrHandler

Dim lo_Inlay As DPC_Inlay

  If mo_CurrentInlay Is Nothing Then Exit Sub
  
  mb_InternalInit = True
  Call mo_Tools.LockScreen(Me, True)
  Select Case as_Role
  Case "H"
    Select Case me_InlayScreen
    Case eDPCScreenMode.smAdd
      Call FrameToInlay(mo_CurrentInlay)
      If Not CheckStepInlayItem(eDPCScreen.psInlay, mo_CurrentInlay) Then
        Call mo_Tools.LockScreen(Me, False)
        mb_InternalInit = False
        Exit Sub
      End If
      Call mo_PrdConfig.InlayAdd(mo_CurrentInlay)
      mo_PrdConfig.NoInlay = False
    Case eDPCScreenMode.smUpdate
      Call FrameToInlay(mo_CurrentInlay)
      If Not CheckStepInlayItem(eDPCScreen.psInlay, mo_CurrentInlay) Then
        Call mo_Tools.LockScreen(Me, False)
        mb_InternalInit = False
        Exit Sub
      End If
      Set lo_Inlay = mo_PrdConfig.GetInlay(mo_CurrentInlay.Idx)
      If lo_Inlay Is Nothing Then
        Call mo_Tools.LockScreen(Me, False)
        mb_InternalInit = False
        Exit Sub
      Else
        Call lo_Inlay.CopyFrom(mo_CurrentInlay)
        Call mo_PrdConfig.InlayUpdate(lo_Inlay)
        mo_PrdConfig.NoInlay = False
      End If
    Case eDPCScreenMode.smDelete
      Call mo_PrdConfig.InlayDrop(mo_CurrentInlay)
    Case Else
      Err.Raise 0, "tlb_InlayDetail_action", "Invalid screen mode"
    End Select
    Call UpdateInlayOrder
    Call DisplayInlayGrid
    Call DisplayInlay
    Call EnableInlayNavigation(True)
    Call EnableNavigation(True)
    Set mo_CurrentInlay = Nothing
  Case "I"
    Select Case me_InlayScreen
    Case eDPCScreenMode.smAdd
      Call mo_PrdConfig.InitInlay(mo_CurrentInlay, rsAdd)
      Call DisplayInlayFrame(mo_CurrentInlay)
    Case eDPCScreenMode.smUpdate
      Set lo_Inlay = mo_PrdConfig.GetInlay(mo_CurrentInlay.Idx)
      If Not lo_Inlay Is Nothing Then
        Call mo_CurrentInlay.CopyFrom(lo_Inlay)
        Call DisplayInlayFrame(mo_CurrentInlay)
      End If
    End Select
  Case "T"
    Call EnableInlayNavigation(True)
    Call EnableNavigation(True)
    Set mo_CurrentInlay = Nothing
  End Select
  Call mo_Tools.LockScreen(Me, False)
  mb_InternalInit = False
  Exit Sub
ErrHandler:
  Call ErrorMessage("tlb_InlayDetail_action")
End Sub

Private Sub tlb_InlayMain_action(ByVal as_Role As String, as_Language As String)
On Error GoTo ErrHandler

Dim lo_Inlay As DPC_Inlay

  mb_InternalInit = True
  Call mo_Tools.LockScreen(Me, True)
  Select Case as_Role
  Case "A"
    me_InlayScreen = eDPCScreenMode.smAdd
    Call mo_Tools.ClearFrame(Controls, fra_Inlay)
    Call mo_Tools.EnableFrame(Controls, fra_Inlay, True)
    Set mo_CurrentInlay = New DPC_Inlay
    Call mo_PrdConfig.InitInlay(mo_CurrentInlay, eDPCRowStatus.rsAdd)
    Call DisplayInlayFrame(mo_CurrentInlay)
    Call tlb_InlayDetail.DisplayFace("1")
    Call EnableInlayNavigation(False)
    Call EnableNavigation(False)
  Case "B"
    If grd_Inlay.SelectedCount <> 1 Then
      Call mo_Tools.ShowMsg(mo_Db, ms_Language_Code, 9723, "#Please, select one row")
      Call mo_Tools.LockScreen(Me, False)
      mb_InternalInit = False
      Exit Sub
    End If
    me_InlayScreen = eDPCScreenMode.smUpdate
    Call mo_Tools.ClearFrame(Controls, fra_Inlay)
    Set lo_Inlay = mo_PrdConfig.GetInlay(Val(grd_Inlay.SelectedLine(0, "Idx")))
    If Not lo_Inlay Is Nothing Then
      Set mo_CurrentInlay = New DPC_Inlay
      Call mo_PrdConfig.InitInlay(mo_CurrentInlay, eDPCRowStatus.rsUpdate)
      Call mo_CurrentInlay.CopyFrom(lo_Inlay)
      Call mo_Tools.EnableFrame(Controls, fra_Inlay, True)
      Call DisplayInlayFrame(mo_CurrentInlay)
      Call tlb_InlayDetail.DisplayFace("2")
      Call EnableInlayNavigation(False)
      Call EnableNavigation(False)
    End If
  Case "C"
    If grd_Inlay.SelectedCount <> 1 Then
      Call mo_Tools.ShowMsg(mo_Db, ms_Language_Code, 9723, "#Please, select one row")
      Call mo_Tools.LockScreen(Me, False)
      mb_InternalInit = False
      Exit Sub
    End If
    me_InlayScreen = eDPCScreenMode.smDelete
    Set mo_CurrentInlay = mo_PrdConfig.GetInlay(Val(grd_Inlay.SelectedLine(0, "Idx")))
    If Not mo_CurrentInlay Is Nothing Then
      Call mo_Tools.ClearFrame(Controls, fra_Inlay)
      Call DisplayInlayFrame(mo_CurrentInlay)
      Call mo_Tools.EnableFrame(Controls, fra_Inlay, False)
      Call tlb_InlayDetail.DisplayFace("3")
      Call EnableInlayNavigation(False)
      Call EnableNavigation(False)
    End If
  End Select
  Call mo_Tools.LockScreen(Me, False)
  mb_InternalInit = False
  Exit Sub
ErrHandler:
  Call ErrorMessage("tlb_InlayMain_action")
End Sub

Private Sub tvw_Coating_NodeClick(ByVal Node As MSComctlLib.Node)
On Error GoTo ErrHandler

  If Node Is Nothing Then Exit Sub
  If mb_InternalInit Then Exit Sub
  mb_InternalInit = True
  Call mo_Tools.LockScreen(Me, True)
  Call LoadCoatingGrid(Node)
  Call mo_Tools.LockScreen(Me, False)
  mb_InternalInit = False
  Exit Sub
ErrHandler:
  Call ErrorMessage("tvw_Coating_NodeClick")
End Sub

Private Sub grd_Coating_Click()
On Error GoTo ErrHandler

  If mb_InternalInit Then Exit Sub
  mb_InternalInit = True
  Call mo_Tools.LockScreen(Me, True)
  If grd_Coating.SelectedCount = 1 Then
    Call mo_PrdConfig.LoadCoating(grd_Coating.SelectedLine(0, "COA_Id"))
    If mo_PrdConfig.HasCoating Then
      If mo_PrdConfig.RPL_CoSid = eDPCCoatingExecution.ceUndef Then
        mo_PrdConfig.RPL_CoSid = eDPCCoatingExecution.ceOneSide
      End If
    Else
      mo_PrdConfig.RPL_CoSid = eDPCCoatingExecution.ceUndef
    End If
    Call LoadCoatingPrice
    Call DisplayCoating
  End If
  Call mo_Tools.LockScreen(Me, False)
  mb_InternalInit = False
  Exit Sub
ErrHandler:
  Call ErrorMessage("grd_Coating_Click")
End Sub

Private Sub LoadPerforationTreeview()
On Error GoTo ErrHandler

  If cbo_PerfView.Count = 0 Then
    Call mo_Tools.LoadComboView(mo_Db, cbo_PerfView, TREEVIEW_PERFORATION, ms_Language_Code)
    If Not cbo_PerfView.SelectedItem Is Nothing Then
      mv_PerfTreeviewInfo = mo_Tools.LoadTreeViewInfo(mo_Db, TREEVIEW_PERFORATION, cbo_PerfView.SelectedItem.Key)
      Call LoadTreeView(tvw_Perforation, mv_PerfTreeviewInfo)
    End If
  End If
  Exit Sub
ErrHandler:
  Call ErrorHandler("LoadPerforationTreeview")
End Sub

Private Sub LoadCoatingTreeview()
On Error GoTo ErrHandler

  If tvw_Coating.Count = 0 Then
    mv_CoatingTreeviewInfo = mo_Tools.LoadTreeViewInfo(mo_Db, TREEVIEW_COATING, "TV1")
    Call LoadTreeView(tvw_Coating, mv_CoatingTreeviewInfo)
  End If
  Exit Sub
ErrHandler:
  Call ErrorHandler("LoadCoatingTreeview")
End Sub

Private Sub LoadCoatingGrid(ByVal ao_Node As MSComctlLib.Node)
On Error GoTo ErrHandler

Dim lv_req As Variant
Dim lo_Offer As DPC_OfferPos
Dim lo_BOM As DPC_BOM
Dim ls_COA_Id As String
  
  If ao_Node Is Nothing Then
    Exit Sub
  End If
  
  If ao_Node.Tag.ml_Level < 2 Then
    Exit Sub
  End If
  
  Call mo_PrdConfig.ResetCoating
  Call DisplayCoating
  
  mo_PrdConfig.COA_Type = ao_Node.Tag.IDValue
        
  Set lo_Offer = mo_PrdConfig.GetOfferPos(eDPCOfferDetail.odCoatingSetupCharge)
  lv_req = tvw_Coating.SelectedNodeRequest
  lv_req = Replace(lv_req, "$CURR_Code$", mo_Tools.SQLStr(mo_PrdConfig.CURR_Code), , , vbTextCompare)
  lv_req = Replace(lv_req, "$CT_Code$", mo_Tools.SQLStr(CT_Code), , , vbTextCompare)
  lv_req = Replace(lv_req, "$Qty$", mo_Tools.SqlDbl(mo_PrdConfig.PanelQtyM2), , , vbTextCompare)
  lv_req = Replace(lv_req, "$UM_Code$", mo_Tools.SQLStr(DPC_UOM_M2), , , vbTextCompare)
  lv_req = Replace(lv_req, "$RPL_PanB$", mo_Tools.SqlDbl(mo_PrdConfig.RPL_PanB), , , vbTextCompare)
  lv_req = Replace(lv_req, "$RPL_PanA$", mo_Tools.SqlDbl(mo_PrdConfig.RPL_PanA), , , vbTextCompare)
  lv_req = Replace(lv_req, "$PCR_CoSid$", mo_Tools.SqlInt(mo_PrdConfig.RPL_CoSid), , , vbTextCompare)
  lv_req = Replace(lv_req, "$SCH_Id$", mo_Tools.SQLStr(lo_Offer.SCH_Id), , , vbTextCompare)
  lv_req = Replace(lv_req, "$PRD_IdPar$", mo_Tools.SQLStr(mo_PrdConfig.PRD_IdPar), , , vbTextCompare)
  If mo_PrdConfig.COA_Type = eDPCCoatingType.ctTopRALNCS Then
    lv_req = Replace(lv_req, "$COA_IsCus$", mo_Tools.SqlBool(False), , , vbTextCompare)
    lv_req = Replace(lv_req, "$COA_Other$", "NULL", , , vbTextCompare)
    lv_req = Replace(lv_req, "$COA_Norm$", "NULL", , , vbTextCompare)
    lv_req = ReplaceCommonPlaceholders(lv_req)
    Call grd_Coating.Load(lv_req, True, , , ao_Node.Tag.ml_Level < tvw_Coating.Levels - 1)
  ElseIf mo_PrdConfig.COA_Type = eDPCCoatingType.ctOtherRALNCS Then
'    If mo_BOMSel Is Nothing Then
'        Set mo_BOMSel = UserControl.Controls.Add("Project1.DPC_BOMSel", "mo_BOMSel")
'        Call mo_BOMSel.Move(grd_Coating.Left, grd_Coating.Top, grd_Coating.Width, grd_Coating.Height)
'        Set mo_BOMSel.ArmDb = mo_Db
'        Set mo_BOMSel.ArmDbBaeurer = mo_DbBaeurer
'        mo_BOMSel.Language_Code = gut_LangLogin.Code
'        mo_BOMSel.U_Code = 0
'
'        If Not mo_BOMSel.Load_A_Com Then
'            MsgBox "Unable to launch DPC_BOMSel"
'            Call mo_BOMSel.Unload_A_Com
'        End If
'    End If
'    mo_BOMSel.Visible = True
'    Call mo_BOMSel.Zorder
    If mo_Tools.ReconnectSafe(mo_DbBaeurer, ms_BaeurerServer, ms_BaeurerDatabase, ms_BaeurerLoginName, ms_BaeurerPassword, ms_BaeurerSource) Then
      Set lo_BOM = SelectRawMaterial(eDPCBOMMaterial.bcCoating, False)
      If Not lo_BOM Is Nothing Then
        Call mo_PrdConfig.LoadCoatingBOM(lo_BOM)
        Call LoadCoatingPrice
      End If
    End If
  ElseIf mo_PrdConfig.COA_Type = eDPCCoatingType.ctCustomized Then
    lv_req = Replace(lv_req, "$COA_IsCus$", mo_Tools.SqlBool(True), , , vbTextCompare)
    lv_req = Replace(lv_req, "$COA_Other$", mo_Tools.SqlInt(eDPCColorNorm.cnOther), , , vbTextCompare)
    lv_req = Replace(lv_req, "$COA_Norm$", mo_Tools.SqlInt(eDPCColorNorm.cnOther), , , vbTextCompare)
    lv_req = ReplaceCommonPlaceholders(lv_req)
    ls_COA_Id = mo_Tools.SelectValue(mo_Db, lv_req, "COA_Id")
    If ls_COA_Id = "" Then
      ls_COA_Id = mo_Tools.GetAConfigData("DPC_Default_COA2")
    End If
    Call mo_PrdConfig.LoadCoating(ls_COA_Id)
    mo_PrdConfig.COA_App = ao_Node.Parent.Parent.Tag.IDValue
    mo_PrdConfig.COA_Mat = ao_Node.Parent.Tag.IDValue
    Call LoadCoatingPrice
  End If
  Call DisplayCoating
  Exit Sub
ErrHandler:
  Call ErrorHandler("LoadCoatingGrid")
End Sub

'Private Sub LoadInlayTreeview()
'On Error GoTo ErrHandler
'
'  If tvw_Inlay.Count = 0 Then
'    mv_InlayTreeviewInfo = mo_Tools.LoadTreeViewInfo(mo_Db, TREEVIEW_INLAY, "TV1")
'    Call LoadTreeView(tvw_Inlay, mv_InlayTreeviewInfo)
'  End If
'  Exit Sub
'ErrHandler:
'  Call ErrorHandler("LoadInlayTreeview")
'End Sub

Private Sub LoadInlayGrid()
On Error GoTo ErrHandler

Dim ls_req As String
Dim lo_Offer As DPC_OfferPos
Dim le_INL_Type As eDPCInlayType

  Call grd_InlayDetail.ClearGrid
  le_INL_Type = mo_Tools.WhichOptionIsTrue(opt_InlayType) + 1
  If (le_INL_Type = eDPCInlayType.itNone) Then
    grd_InlayDetail.Visible = False
    Exit Sub
  End If
  'lv_req = tvw_Inlay.SelectedNodeRequest
  Set lo_Offer = mo_CurrentInlay.GetOfferPos(eDPCOfferDetail.odInlaySetupCharge)
  ls_req = "exec DPC_Inlay_grd $COF_Lang$, $INL_Type$, $INL_Vend$, $RPL_PanA$, $RPL_PanB$, $Qty$, $CT_Code$, $CURR_Code$, $SCH_Id$,$PRD_IdPar$"
  ls_req = Replace(ls_req, "$INL_Type$", mo_Tools.SqlInt(le_INL_Type), , , vbTextCompare)
  ls_req = Replace(ls_req, "$INL_Vend$", mo_Tools.SqlStrKey(""), , , vbTextCompare)
  ls_req = Replace(ls_req, "$CURR_Code$", mo_Tools.SQLStr(mo_PrdConfig.CURR_Code), , , vbTextCompare)
  ls_req = Replace(ls_req, "$CT_Code$", mo_Tools.SQLStr(CT_Code), , , vbTextCompare)
  ls_req = Replace(ls_req, "$Qty$", mo_Tools.SqlDbl(mo_PrdConfig.PanelQtyM2), , , vbTextCompare)
  ls_req = Replace(ls_req, "$RPL_PanB$", mo_Tools.SqlDbl(mo_PrdConfig.RPL_PanB), , , vbTextCompare)
  ls_req = Replace(ls_req, "$RPL_PanA$", mo_Tools.SqlDbl(mo_PrdConfig.RPL_PanA), , , vbTextCompare)
  ls_req = Replace(ls_req, "$SCH_Id$", mo_Tools.SQLStr(lo_Offer.SCH_Id), , , vbTextCompare)
  ls_req = Replace(ls_req, "$PRD_IdPar$", mo_Tools.SQLStr(mo_PrdConfig.PRD_IdPar), , , vbTextCompare)
  ls_req = ReplaceCommonPlaceholders(ls_req)
  Call grd_InlayDetail.Load(ls_req, True)
  grd_InlayDetail.Visible = True
  Exit Sub
ErrHandler:
  Call ErrorHandler("LoadInlayGrid")
End Sub

Private Sub grd_InlayDetail_Click()
On Error GoTo ErrHandler

  If mb_InternalInit Then Exit Sub
  mb_InternalInit = True
  Call mo_Tools.LockScreen(Me, True)
  If grd_InlayDetail.SelectedCount = 1 Then
    Call mo_CurrentInlay.LoadInlay(grd_InlayDetail.SelectedLine(0, "INL_Id"))
    Call mo_CurrentInlay.CalcInlaySize(mo_PrdConfig)
    Call LoadInlayPrice(mo_CurrentInlay)
    Call DisplayInlayFrame(mo_CurrentInlay)
  End If
  Call mo_Tools.LockScreen(Me, False)
  mb_InternalInit = False
  Exit Sub
ErrHandler:
  Call ErrorMessage("grd_InlayDetail_Click")
End Sub

Private Sub btn_Inlay_Click()
On Error GoTo ErrHandler

Dim lo_BOM As DPC_BOM

  mb_InternalInit = True
  Call mo_Tools.LockScreen(Me, True)
  If mo_Tools.ReconnectSafe(mo_DbBaeurer, ms_BaeurerServer, ms_BaeurerDatabase, ms_BaeurerLoginName, ms_BaeurerPassword, ms_BaeurerSource) Then
    Set lo_BOM = SelectRawMaterial(eDPCBOMMaterial.bcInlay, False)
    If Not lo_BOM Is Nothing Then
      Call mo_PrdConfig.LoadInlayBOM(lo_BOM, mo_CurrentInlay)
      Call mo_CurrentInlay.CalcInlaySize(mo_PrdConfig)
      Call LoadInlayPrice(mo_CurrentInlay)
      Call DisplayInlayFrame(mo_CurrentInlay)
    End If
  End If
  Call mo_Tools.LockScreen(Me, False)
  mb_InternalInit = False
  Exit Sub
ErrHandler:
  Call ErrorMessage("btn_Inlay_Click")
End Sub


'Private Sub tvw_Inlay_NodeClick(ByVal Node As MSComctlLib.Node)
'On Error GoTo ErrHandler
'
'Dim lv_req As Variant
'Dim lo_Offer As DPC_OfferPos
'
'  If Node Is Nothing Then Exit Sub
'  If mb_InternalInit Then Exit Sub
'
'  mb_InternalInit = True
'  Call mo_Tools.LockScreen(Me, True)
'  Call LoadInlayGrid(Node)
'  Call mo_Tools.LockScreen(Me, False)
'  mb_InternalInit = False
'  Exit Sub
'ErrHandler:
'  Call ErrorMessage("tvw_Inlay_NodeClick")
'End Sub

Private Sub opt_InlayType_Click(Index As Integer)
On Error GoTo ErrHandler
  
  mb_InternalInit = True
  Call mo_Tools.LockScreen(Me, True)
  Call LoadInlayGrid
  Call mo_Tools.LockScreen(Me, False)
  mb_InternalInit = False
  Exit Sub
ErrHandler:
  Call ErrorMessage("opt_InlayType_Click")
End Sub

Private Sub tvw_Perforation_NodeClick(ByVal Node As MSComctlLib.Node)
On Error GoTo ErrHandler

  If Node Is Nothing Then Exit Sub
  If Node.Tag.ml_Level < tvw_Perforation.Levels - 1 Then Exit Sub
  
  If mb_InternalInit Then Exit Sub
  mb_InternalInit = True
  Call mo_Tools.LockScreen(Me, True)
  Call mo_PrdConfig.LoadPerforation(Node.Tag.IDValue)
  Call DisplayPerforation
  Call DisplayPerforationBorder
  Call LoadPerforationPrice
  Call LoadPanelPrice
  Call mo_Tools.LockScreen(Me, False)
  mb_InternalInit = False
  Exit Sub
ErrHandler:
  Call ErrorMessage("tvw_Perforation_NodeClick")
End Sub

Private Sub pct_Perforation_Click()
On Error GoTo ErrHandler
    
Dim lo_Frm As frmDPC_ImgSel
Dim ls_Class As String
Dim lv_Arrang As Variant
Dim lv_Shape As Variant
Dim ls_Request As String

  If mb_InternalInit Then Exit Sub
  mb_InternalInit = True
  Call mo_Tools.LockScreen(Me, True)
  Set lo_Frm = New frmDPC_ImgSel
  
  Load lo_Frm
  
  ls_Request = "SELECT PRF.PRF_Id,PRC.IMG_Id,PRD.PRD_Name,PRD.PRD_Desc  " & _
  "FROM DPC_Perforation PRF " & _
  "INNER JOIN DPC_PrdCommon PRC ON (PRF.PRF_Id=PRC.PRD_Id) " & _
  "INNER JOIN DPC_PrdDesc PRD ON (PRF.PRF_Id=PRD.PRD_Id AND PRD.Language_Code=$COF_Lang$) " & _
  "WHERE PRF.Drop_Flag='' ORDER BY PRF.PRF_Order"
  ls_Request = ReplaceCommonPlaceholders(ls_Request)
  
  lo_Frm.Request = ls_Request
  Set lo_Frm.Tools = mo_Tools
  Set lo_Frm.ArmDb = mo_Db
  lo_Frm.Language_Code = ms_Language_Code
  Call lo_Frm.Load_A_COM
  
  Call mo_Tools.LockScreen(Me, False)
  Call mo_Tools.ShowModalForm(lo_Frm)
  Call mo_Tools.LockScreen(Me, True)
  
  If lo_Frm.Result Then
    Call mo_PrdConfig.LoadPerforation(lo_Frm.SelectedId)
    Call LoadPerforationPrice
    Call LoadPanelPrice
    Call DisplayPerforation
    Call DisplayPerforationBorder
  End If
  Call lo_Frm.Unload_A_COM
  Unload lo_Frm
  Call mo_Tools.LockScreen(Me, False)
  mb_InternalInit = False
  Exit Sub
ErrHandler:
  Call ErrorMessage("pct_Perforation_Click")
End Sub

Private Sub grd_Inlay_Click()
On Error GoTo ErrHandler

Dim lo_Inlay As DPC_Inlay

  If mb_InternalInit Then Exit Sub
  mb_InternalInit = True
  Call mo_Tools.LockScreen(Me, True)
  If grd_Inlay.SelectedCount = 1 Then
    Set lo_Inlay = mo_PrdConfig.GetInlay(Val(grd_Inlay.SelectedLine(0, "Idx")))
    If lo_Inlay Is Nothing Then
      fra_Inlay.Visible = False
      me_InlayScreen = eDPCScreenMode.smList
    Else
      me_InlayScreen = eDPCScreenMode.smView
      Call DisplayInlayFrame(lo_Inlay)
      Call mo_Tools.EnableFrame(Controls, fra_Inlay, False)
      Call tlb_InlayDetail.DisplayFace("0")
      fra_Inlay.Visible = True
    End If
  End If
  Call mo_Tools.LockScreen(Me, False)
  mb_InternalInit = False
  Exit Sub
ErrHandler:
  Call ErrorMessage("grd_Inlay_Click")
End Sub

Private Sub grd_Cutout_Click(Index As Integer)
On Error GoTo ErrHandler

Dim lo_Cutout As DPC_Cutout

  If mb_InternalInit Then Exit Sub
  mb_InternalInit = True
  Call mo_Tools.LockScreen(Me, True)
  If grd_Cutout(Index).SelectedCount = 1 Then
    Set lo_Cutout = mo_PrdConfig.GetCutout(Val(grd_Cutout(Index).SelectedLine(0, "Idx")))
    If lo_Cutout Is Nothing Then
      fra_Cutout(Index).Visible = False
      me_CutoutScreen(Index) = eDPCScreenMode.smList
    Else
      Call DisplayGenericCutoutFrame(lo_Cutout, Index)
      Call mo_Tools.EnableFrame(Controls, fra_Cutout(Index), False)
      Call tlb_CutoutDetail(Index).DisplayFace("0")
      fra_Cutout(Index).Visible = True
      me_CutoutScreen(Index) = eDPCScreenMode.smView
    End If
  End If
  Call mo_Tools.LockScreen(Me, False)
  mb_InternalInit = False
  Exit Sub
ErrHandler:
  Call ErrorMessage("grd_Cutout_Click")
End Sub

Private Sub DisplayGenericCutoutFrame(ByVal ao_Cutout As DPC_Cutout, ByVal al_Index As Long)
On Error GoTo ErrHandler
  
  Select Case al_Index
  Case 0
    Call DisplayVentFrame(ao_Cutout)
  Case 1
    Call DisplayLoudFrame(ao_Cutout)
  Case 2
    Call DisplayCutoutFrame(ao_Cutout)
  End Select
  Exit Sub
ErrHandler:
  Call ErrorHandler("DisplayGenericCutoutFrame")
End Sub

Private Sub DisplayVentFrame(ByVal ao_Cutout As DPC_Cutout)
On Error GoTo ErrHandler

  If ao_Cutout.CUT_Id = "" Then
    Set cbo_Vent.SelectedItem = Nothing
  Else
    If Not cbo_Vent.SearchItem(ao_Cutout.CUT_Id) Then
      Call cbo_Vent.AddItem(Array(ao_Cutout.CUT_Id, ao_Cutout.CUT_Name), True)
    End If
  End If
  
  Call mo_Tools.SetTextBox(txt_Textbox, "VET_Desc", ao_Cutout.CUT_Desc, False)
  Call mo_Tools.DrawDPCImage(mo_Db, mo_FSO, ms_DPCImageCachePath, ao_Cutout.IMG_Id, pct_Vent, "")
  Call mo_Tools.DrawDPCImage(mo_Db, mo_FSO, ms_DPCImageCachePath, ao_Cutout.IMG_IdShp, pct_ShapeTypeV, "")
  
  chk_StandardVent.Value = IIf(ao_Cutout.PCT_Std, vbChecked, vbUnchecked)
  
  Call cbo_VentArea.Clear
  If ao_Cutout.PCT_Std Then
    If ao_Cutout.CUT_Shape = eDPCCutoutShape.eRectangular Then
      If (ao_Cutout.PCT_SizeJ > 0) Or (ao_Cutout.PCT_SizeK > 0) Then
        Call cbo_VentArea.AddItem(Array(0, mo_Tools.DblToScreen(ao_Cutout.PCT_SizeJ) & "x" & mo_Tools.DblToScreen(ao_Cutout.PCT_SizeK)), True)
      End If
    ElseIf ao_Cutout.CUT_Shape = eDPCCutoutShape.eRound Then
      If (ao_Cutout.PCT_SizeD > 0) Then
        Call cbo_VentArea.AddItem(Array(0, mo_Tools.DblToScreen(ao_Cutout.PCT_SizeD) & "x" & mo_Tools.DblToScreen(ao_Cutout.PCT_SizeD)), True)
      End If
    End If
  End If
  Call InitCutAreaCombo(cbo_VentArea, ao_Cutout.CUT_Id)
  
  Call cbo_VentPerf.Clear
  If ao_Cutout.PRF_Id = "" Then
    Set cbo_VentPerf.SelectedItem = Nothing
  Else
    'If Not cbo_VentPerf.SearchItem(ao_Cutout.PRF_Id) Then
    Call cbo_VentPerf.AddItem(Array(ao_Cutout.PRF_Id, ao_Cutout.PRF_Name), True)
    'End If
  End If
  
  cbo_VentArea.Visible = ao_Cutout.PCT_Std
  cbo_VentArea.Enabled = (ao_Cutout.CUT_Id <> "")
  lbl_VentArea.Visible = ao_Cutout.PCT_Std
  cbo_VentPerf.Enabled = Not ao_Cutout.PCT_Std
  
  lbl_VentDiameter.Visible = (ao_Cutout.CUT_Shape = eDPCCutoutShape.eRound)
  Call mo_Tools.SetTextBox(txt_Textbox, "PCT_SizeD_V", mo_Tools.DblToScreen(ao_Cutout.PCT_SizeD), Not ao_Cutout.PCT_Std, (ao_Cutout.CUT_Shape = eDPCCutoutShape.eRound))
  lbl_VentLength.Visible = (ao_Cutout.CUT_Shape = eDPCCutoutShape.eRectangular)
  Call mo_Tools.SetTextBox(txt_Textbox, "PCT_SizeJ_V", mo_Tools.DblToScreen(ao_Cutout.PCT_SizeJ), Not ao_Cutout.PCT_Std, (ao_Cutout.CUT_Shape = eDPCCutoutShape.eRectangular))
  lbl_VentWidth.Visible = (ao_Cutout.CUT_Shape = eDPCCutoutShape.eRectangular)
  Call mo_Tools.SetTextBox(txt_Textbox, "PCT_SizeK_V", mo_Tools.DblToScreen(ao_Cutout.PCT_SizeK), Not ao_Cutout.PCT_Std, (ao_Cutout.CUT_Shape = eDPCCutoutShape.eRectangular))
  
  Call mo_Tools.SetTextValue(txt_Textbox, "PCT_SizeL_V", mo_Tools.DblToScreen(ao_Cutout.PCT_SizeL))
  Call mo_Tools.SetTextValue(txt_Textbox, "PCT_SizeM_V", mo_Tools.DblToScreen(ao_Cutout.PCT_SizeM))
  
  Call mo_Tools.SetTextValue(txt_Textbox, "PCT_UBorC_V", mo_Tools.DblToScreen(ao_Cutout.PCT_UBor(eDPCSide.esSideC)))
  Call mo_Tools.SetTextValue(txt_Textbox, "PCT_UBorD_V", mo_Tools.DblToScreen(ao_Cutout.PCT_UBor(eDPCSide.esSideD)))
  Call mo_Tools.SetTextValue(txt_Textbox, "PCT_UBorE_V", mo_Tools.DblToScreen(ao_Cutout.PCT_UBor(eDPCSide.esSideE)))
  Call mo_Tools.SetTextValue(txt_Textbox, "PCT_UBorF_V", mo_Tools.DblToScreen(ao_Cutout.PCT_UBor(eDPCSide.esSideF)))
  Call mo_Tools.SetTextValue(txt_Textbox, "PCT_UBoWC_V", mo_Tools.DblToScreen(ao_Cutout.PCT_UBoW(eDPCSide.esSideC)))
  Call mo_Tools.SetTextValue(txt_Textbox, "PCT_UBoWD_V", mo_Tools.DblToScreen(ao_Cutout.PCT_UBoW(eDPCSide.esSideD)))
  Call mo_Tools.SetTextValue(txt_Textbox, "PCT_UBoWE_V", mo_Tools.DblToScreen(ao_Cutout.PCT_UBoW(eDPCSide.esSideE)))
  Call mo_Tools.SetTextValue(txt_Textbox, "PCT_UBoWF_V", mo_Tools.DblToScreen(ao_Cutout.PCT_UBoW(eDPCSide.esSideF)))
  
  chk_PerfBorderV(eDPCSide.esSideC).Value = IIf(ao_Cutout.PCT_UBoW(eDPCSide.esSideC) < 0, vbChecked, vbUnchecked)
  chk_PerfBorderV(eDPCSide.esSideD).Value = IIf(ao_Cutout.PCT_UBoW(eDPCSide.esSideD) < 0, vbChecked, vbUnchecked)
  chk_PerfBorderV(eDPCSide.esSideE).Value = IIf(ao_Cutout.PCT_UBoW(eDPCSide.esSideE) < 0, vbChecked, vbUnchecked)
  chk_PerfBorderV(eDPCSide.esSideF).Value = IIf(ao_Cutout.PCT_UBoW(eDPCSide.esSideF) < 0, vbChecked, vbUnchecked)
  
  chk_CorrectStepV.Value = IIf(ao_Cutout.PRF_IsCorrStep, vbChecked, vbUnchecked)
  chk_StandardPerfV.Value = IIf(ao_Cutout.PRF_IsStandard, vbChecked, vbUnchecked)
  
  Call DisplayPrice(eDPCScreen.psVentilation, ao_Cutout)
  Exit Sub
ErrHandler:
  Call ErrorHandler("DisplayVentFrame")
End Sub

Private Sub DisplayLoudFrame(ByVal ao_Cutout As DPC_Cutout)
On Error GoTo ErrHandler

  If ao_Cutout.CUT_Id = "" Then
    Set cbo_Loud.SelectedItem = Nothing
  Else
    If Not cbo_Loud.SearchItem(ao_Cutout.CUT_Id) Then
      Call cbo_Loud.AddItem(Array(ao_Cutout.CUT_Id, ao_Cutout.CUT_Name), True)
    End If
  End If
  
  Call mo_Tools.SetTextBox(txt_Textbox, "LSP_Desc", ao_Cutout.CUT_Desc, False)
  Call mo_Tools.DrawDPCImage(mo_Db, mo_FSO, ms_DPCImageCachePath, ao_Cutout.IMG_Id, pct_Loud, "")
  Call mo_Tools.DrawDPCImage(mo_Db, mo_FSO, ms_DPCImageCachePath, ao_Cutout.IMG_IdShp, pct_ShapeTypeL, "")
  
  chk_StandardLoud.Value = IIf(ao_Cutout.PCT_Std, vbChecked, vbUnchecked)
  
  Call cbo_LoudArea.Clear
  If ao_Cutout.PCT_Std Then
    If ao_Cutout.CUT_Shape = eDPCCutoutShape.eRectangular Then
      If (ao_Cutout.PCT_SizeJ > 0) Or (ao_Cutout.PCT_SizeK > 0) Then
        Call cbo_LoudArea.AddItem(Array(0, mo_Tools.DblToScreen(ao_Cutout.PCT_SizeJ) & "x" & mo_Tools.DblToScreen(ao_Cutout.PCT_SizeK)), True)
      End If
    ElseIf ao_Cutout.CUT_Shape = eDPCCutoutShape.eRound Then
      If (ao_Cutout.PCT_SizeD > 0) Then
        Call cbo_LoudArea.AddItem(Array(0, mo_Tools.DblToScreen(ao_Cutout.PCT_SizeD) & "x" & mo_Tools.DblToScreen(ao_Cutout.PCT_SizeD)), True)
      End If
    End If
  End If
  Call cbo_LoudPerf.Clear
  If ao_Cutout.PRF_Id = "" Then
    Set cbo_LoudPerf.SelectedItem = Nothing
  Else
    'If Not cbo_LoudPerf.SearchItem(ao_Cutout.PRF_Id) Then
    Call cbo_LoudPerf.AddItem(Array(ao_Cutout.PRF_Id, ao_Cutout.PRF_Name), True)
    'End If
  End If
  
  cbo_LoudArea.Visible = ao_Cutout.PCT_Std
  cbo_LoudArea.Enabled = (ao_Cutout.CUT_Id <> "")
  lbl_LoudArea.Visible = ao_Cutout.PCT_Std
  cbo_LoudPerf.Enabled = Not ao_Cutout.PCT_Std
  
  lbl_LoudDiameter.Visible = (ao_Cutout.CUT_Shape = eDPCCutoutShape.eRound)
  Call mo_Tools.SetTextBox(txt_Textbox, "PCT_SizeD_L", mo_Tools.DblToScreen(ao_Cutout.PCT_SizeD), Not ao_Cutout.PCT_Std, (ao_Cutout.CUT_Shape = eDPCCutoutShape.eRound))
  lbl_LoudLength.Visible = (ao_Cutout.CUT_Shape = eDPCCutoutShape.eRectangular)
  Call mo_Tools.SetTextBox(txt_Textbox, "PCT_SizeJ_L", mo_Tools.DblToScreen(ao_Cutout.PCT_SizeJ), Not ao_Cutout.PCT_Std, (ao_Cutout.CUT_Shape = eDPCCutoutShape.eRectangular))
  lbl_LoudWidth.Visible = (ao_Cutout.CUT_Shape = eDPCCutoutShape.eRectangular)
  Call mo_Tools.SetTextBox(txt_Textbox, "PCT_SizeK_L", mo_Tools.DblToScreen(ao_Cutout.PCT_SizeK), Not ao_Cutout.PCT_Std, (ao_Cutout.CUT_Shape = eDPCCutoutShape.eRectangular))
  
  Call mo_Tools.SetTextValue(txt_Textbox, "PCT_SizeL_L", mo_Tools.DblToScreen(ao_Cutout.PCT_SizeL))
  Call mo_Tools.SetTextValue(txt_Textbox, "PCT_SizeM_L", mo_Tools.DblToScreen(ao_Cutout.PCT_SizeM))
  
  Call mo_Tools.SetTextValue(txt_Textbox, "PCT_UBorC_L", mo_Tools.DblToScreen(ao_Cutout.PCT_UBor(eDPCSide.esSideC)))
  Call mo_Tools.SetTextValue(txt_Textbox, "PCT_UBorD_L", mo_Tools.DblToScreen(ao_Cutout.PCT_UBor(eDPCSide.esSideD)))
  Call mo_Tools.SetTextValue(txt_Textbox, "PCT_UBorE_L", mo_Tools.DblToScreen(ao_Cutout.PCT_UBor(eDPCSide.esSideE)))
  Call mo_Tools.SetTextValue(txt_Textbox, "PCT_UBorF_L", mo_Tools.DblToScreen(ao_Cutout.PCT_UBor(eDPCSide.esSideF)))
  Call mo_Tools.SetTextValue(txt_Textbox, "PCT_UBoWC_L", mo_Tools.DblToScreen(ao_Cutout.PCT_UBoW(eDPCSide.esSideC)))
  Call mo_Tools.SetTextValue(txt_Textbox, "PCT_UBoWD_L", mo_Tools.DblToScreen(ao_Cutout.PCT_UBoW(eDPCSide.esSideD)))
  Call mo_Tools.SetTextValue(txt_Textbox, "PCT_UBoWE_L", mo_Tools.DblToScreen(ao_Cutout.PCT_UBoW(eDPCSide.esSideE)))
  Call mo_Tools.SetTextValue(txt_Textbox, "PCT_UBoWF_L", mo_Tools.DblToScreen(ao_Cutout.PCT_UBoW(eDPCSide.esSideF)))
  
  chk_PerfBorderL(eDPCSide.esSideC).Value = IIf(ao_Cutout.PCT_UBoW(eDPCSide.esSideC) < 0, vbChecked, vbUnchecked)
  chk_PerfBorderL(eDPCSide.esSideD).Value = IIf(ao_Cutout.PCT_UBoW(eDPCSide.esSideD) < 0, vbChecked, vbUnchecked)
  chk_PerfBorderL(eDPCSide.esSideE).Value = IIf(ao_Cutout.PCT_UBoW(eDPCSide.esSideE) < 0, vbChecked, vbUnchecked)
  chk_PerfBorderL(eDPCSide.esSideF).Value = IIf(ao_Cutout.PCT_UBoW(eDPCSide.esSideF) < 0, vbChecked, vbUnchecked)
  
  chk_CorrectStepL.Value = IIf(ao_Cutout.PRF_IsCorrStep, vbChecked, vbUnchecked)
  chk_StandardPerfL.Value = IIf(ao_Cutout.PRF_IsStandard, vbChecked, vbUnchecked)
  
  Call DisplayPrice(eDPCScreen.psLoudspeaker, ao_Cutout)
  Exit Sub
ErrHandler:
  Call ErrorHandler("DisplayLoudFrame")
End Sub

Private Sub DisplayCutoutFrame(ByVal ao_Cutout As DPC_Cutout)
On Error GoTo ErrHandler

  Dim ll_Idx As Long
  Dim ll_SideIdx As Long
  
  If ao_Cutout.CUT_Id = "" Then
    Set cbo_Cutout.SelectedItem = Nothing
  Else
    If Not cbo_Cutout.SearchItem(ao_Cutout.CUT_Id) Then
      Call cbo_Cutout.AddItem(Array(ao_Cutout.CUT_Id, ao_Cutout.CUT_Name), True)
    End If
  End If
  
  Call mo_Tools.SetTextBox(txt_Textbox, "CUT_Desc", ao_Cutout.CUT_Desc, False)
  Call mo_Tools.DrawDPCImage(mo_Db, mo_FSO, ms_DPCImageCachePath, ao_Cutout.IMG_Id, pct_Cutout, "")
  Call mo_Tools.DrawDPCImage(mo_Db, mo_FSO, ms_DPCImageCachePath, ao_Cutout.IMG_IdShp, pct_ShapeTypeC, "")
  
  lbl_CutoutDiameter.Visible = (ao_Cutout.CUT_Shape = eDPCCutoutShape.eRound)
  Call mo_Tools.SetTextBox(txt_Textbox, "PCT_SizeD_C", mo_Tools.DblToScreen(ao_Cutout.PCT_SizeD), True, (ao_Cutout.CUT_Shape = eDPCCutoutShape.eRound))
  lbl_CutoutLength.Visible = (ao_Cutout.CUT_Shape = eDPCCutoutShape.eRectangular)
  Call mo_Tools.SetTextBox(txt_Textbox, "PCT_SizeJ_C", mo_Tools.DblToScreen(ao_Cutout.PCT_SizeJ), True, (ao_Cutout.CUT_Shape = eDPCCutoutShape.eRectangular))
  lbl_CutoutWidth.Visible = (ao_Cutout.CUT_Shape = eDPCCutoutShape.eRectangular)
  Call mo_Tools.SetTextBox(txt_Textbox, "PCT_SizeK_C", mo_Tools.DblToScreen(ao_Cutout.PCT_SizeK), True, (ao_Cutout.CUT_Shape = eDPCCutoutShape.eRectangular))
  
  Call mo_Tools.SetTextValue(txt_Textbox, "PCT_SizeL_C", mo_Tools.DblToScreen(ao_Cutout.PCT_SizeL))
  Call mo_Tools.SetTextValue(txt_Textbox, "PCT_SizeM_C", mo_Tools.DblToScreen(ao_Cutout.PCT_SizeM))
  
  For ll_SideIdx = eDPCSide.esSideC To eDPCSide.esSideF
  
    If ao_Cutout.PCT_UBoW(ll_SideIdx) >= 0 Then
      Call mo_Tools.SetTextBox(txt_Textbox, "PCT_UBor" & mv_Edge(ll_SideIdx) & "_C", mo_Tools.DblToScreen(ao_Cutout.PCT_UBor(ll_SideIdx)), False, True)
    Else
      Call mo_Tools.SetTextBox(txt_Textbox, "PCT_UBor" & mv_Edge(ll_SideIdx) & "_C", mo_Tools.DblToScreen(ao_Cutout.PCT_UBor(ll_SideIdx)), False, False)
    End If
    If ao_Cutout.PCT_UBoW(ll_SideIdx) >= 0 Then
      Call mo_Tools.SetTextBox(txt_Textbox, "PCT_UBoW" & mv_Edge(ll_SideIdx) & "_C", mo_Tools.DblToScreen(ao_Cutout.PCT_UBoW(ll_SideIdx)), True, True)
      chk_PerfBorderC(ll_SideIdx).Value = vbUnchecked
    Else
      Call mo_Tools.SetTextBox(txt_Textbox, "PCT_UBoW" & mv_Edge(ll_SideIdx) & "_C", mo_Tools.DblToScreen(ao_Cutout.PCT_UBor(ll_SideIdx)), False, False)
      chk_PerfBorderC(ll_SideIdx).Value = vbChecked
    End If
  Next
  
  chk_CorrectStepC.Value = IIf(ao_Cutout.PRF_IsCorrStep, vbChecked, vbUnchecked)
  chk_StandardPerfC.Value = IIf(ao_Cutout.PRF_IsStandard, vbChecked, vbUnchecked)
  Call DisplayPrice(eDPCScreen.psCutout, ao_Cutout)
  Exit Sub
ErrHandler:
  Call ErrorHandler("DisplayCutoutFrame")
End Sub

Private Sub FrameToCutout(ByVal ao_Cutout As DPC_Cutout, ByVal al_Index As Long)
On Error GoTo ErrHandler
  
  Select Case al_Index
  Case 0
    Call FrameVentToCutout(ao_Cutout)
  Case 1
    Call FrameLoudToCutout(ao_Cutout)
  Case 2
    Call FrameCutoutToCutout(ao_Cutout)
  End Select
  Exit Sub
ErrHandler:
  Call ErrorHandler("FrameToCutout")
End Sub

Private Sub FrameCutoutToCutout(ByVal ao_Cutout As DPC_Cutout)
On Error GoTo ErrHandler

Dim lo_Offer As DPC_OfferPos
Dim le_SideIdx As eDPCSide
  
  Call ao_Cutout.LoadCutType(mo_Tools.GetComboKey(cbo_Cutout))
  
  ao_Cutout.PCT_Type = eDPCCutoutType.eCutout
  ao_Cutout.PCT_SizeD = mo_Tools.ScreenToDbl(mo_Tools.GetTextValue(txt_Textbox, "PCT_SizeD_C"))
  ao_Cutout.PCT_SizeJ = mo_Tools.ScreenToDbl(mo_Tools.GetTextValue(txt_Textbox, "PCT_SizeJ_C"))
  ao_Cutout.PCT_SizeK = mo_Tools.ScreenToDbl(mo_Tools.GetTextValue(txt_Textbox, "PCT_SizeK_C"))
  ao_Cutout.PCT_SizeL = mo_Tools.ScreenToDbl(mo_Tools.GetTextValue(txt_Textbox, "PCT_SizeL_C"))
  ao_Cutout.PCT_SizeM = mo_Tools.ScreenToDbl(mo_Tools.GetTextValue(txt_Textbox, "PCT_SizeM_C"))
  
  For le_SideIdx = eDPCSide.esSideC To eDPCSide.esSideF
    ao_Cutout.PCT_UBor(le_SideIdx) = mo_Tools.ScreenToDbl(mo_Tools.GetTextValue(txt_Textbox, "PCT_UBor" & mv_Edge(le_SideIdx) & "_C"))
    ao_Cutout.PCT_UBoW(le_SideIdx) = mo_Tools.ScreenToDbl(mo_Tools.GetTextValue(txt_Textbox, "PCT_UBoW" & mv_Edge(le_SideIdx) & "_C"))
  Next
  
  ao_Cutout.PRF_IsCorrStep = (chk_CorrectStepC.Value = vbChecked)
  ao_Cutout.PRF_IsStandard = (chk_StandardPerfC.Value = vbChecked)
  Set lo_Offer = ao_Cutout.GetOfferPos(eDPCOfferDetail.odCutoutCost)
  lo_Offer.OFD_PriceA = mo_Tools.ScreenToDbl(mo_Tools.GetTextValue(txt_Price, "txt_CutoutPrice_A"))
  lo_Offer.OFD_Price = mo_Tools.ScreenToDbl(mo_Tools.GetTextValue(txt_Price, "txt_CutoutPrice_M"))
  Set lo_Offer = ao_Cutout.GetOfferPos(eDPCOfferDetail.odCutoutAddChangeCost)
  lo_Offer.OFD_PriceA = mo_Tools.ScreenToDbl(mo_Tools.GetTextValue(txt_Price, "txt_CutoutAddChange_A"))
  lo_Offer.OFD_Price = mo_Tools.ScreenToDbl(mo_Tools.GetTextValue(txt_Price, "txt_CutoutAddChange_M"))
  Set lo_Offer = ao_Cutout.GetOfferPos(eDPCOfferDetail.odCutoutSetupCharge)
  lo_Offer.OFD_PriceA = mo_Tools.ScreenToDbl(mo_Tools.GetTextValue(txt_Price, "txt_CutoutSetupCharge_A"))
  lo_Offer.OFD_Price = mo_Tools.ScreenToDbl(mo_Tools.GetTextValue(txt_Price, "txt_CutoutSetupCharge_M"))
  Set lo_Offer = ao_Cutout.GetOfferPos(eDPCOfferDetail.odCutoutSurcharge)
  lo_Offer.OFD_PriceA = mo_Tools.ScreenToDbl(mo_Tools.GetTextValue(txt_Price, "txt_CutoutSurcharge_A"))
  lo_Offer.OFD_Price = mo_Tools.ScreenToDbl(mo_Tools.GetTextValue(txt_Price, "txt_CutoutSurcharge_M"))
  Exit Sub
ErrHandler:
  Call ErrorHandler("FrameCutoutToCutout")
End Sub

Private Sub FrameLoudToCutout(ByVal ao_Cutout As DPC_Cutout)
On Error GoTo ErrHandler

Dim lo_Offer As DPC_OfferPos
Dim le_SideIdx As eDPCSide
 
  Call ao_Cutout.LoadCutType(mo_Tools.GetComboKey(cbo_Loud))
  
  ao_Cutout.PCT_Type = eDPCCutoutType.eLoudspeaker
  ao_Cutout.PCT_Std = (chk_StandardLoud.Value = vbChecked)
  ao_Cutout.PRF_Id = mo_Tools.GetComboKey(cbo_LoudPerf)
  ao_Cutout.PRF_Name = cbo_LoudPerf.Text
  
  ao_Cutout.PCT_SizeD = mo_Tools.ScreenToDbl(mo_Tools.GetTextValue(txt_Textbox, "PCT_SizeD_L"))
  ao_Cutout.PCT_SizeJ = mo_Tools.ScreenToDbl(mo_Tools.GetTextValue(txt_Textbox, "PCT_SizeJ_L"))
  ao_Cutout.PCT_SizeK = mo_Tools.ScreenToDbl(mo_Tools.GetTextValue(txt_Textbox, "PCT_SizeK_L"))
  ao_Cutout.PCT_SizeL = mo_Tools.ScreenToDbl(mo_Tools.GetTextValue(txt_Textbox, "PCT_SizeL_L"))
  ao_Cutout.PCT_SizeM = mo_Tools.ScreenToDbl(mo_Tools.GetTextValue(txt_Textbox, "PCT_SizeM_L"))
  
  For le_SideIdx = eDPCSide.esSideC To eDPCSide.esSideF
    ao_Cutout.PCT_UBor(le_SideIdx) = mo_Tools.ScreenToDbl(mo_Tools.GetTextValue(txt_Textbox, "PCT_UBor" & mv_Edge(le_SideIdx) & "_L"))
    ao_Cutout.PCT_UBoW(le_SideIdx) = mo_Tools.ScreenToDbl(mo_Tools.GetTextValue(txt_Textbox, "PCT_UBoW" & mv_Edge(le_SideIdx) & "_L"))
  Next
  
  ao_Cutout.PRF_IsCorrStep = (chk_CorrectStepL.Value = vbChecked)
  ao_Cutout.PRF_IsStandard = (chk_StandardPerfL.Value = vbChecked)
  
  Set lo_Offer = ao_Cutout.GetOfferPos(eDPCOfferDetail.odLoudspeakerCost)
  lo_Offer.OFD_PriceA = mo_Tools.ScreenToDbl(mo_Tools.GetTextValue(txt_Price, "txt_LoudPrice_A"))
  lo_Offer.OFD_Price = mo_Tools.ScreenToDbl(mo_Tools.GetTextValue(txt_Price, "txt_LoudPrice_M"))
  Set lo_Offer = ao_Cutout.GetOfferPos(eDPCOfferDetail.odLoudspeakerAddChangeCost)
  lo_Offer.OFD_PriceA = mo_Tools.ScreenToDbl(mo_Tools.GetTextValue(txt_Price, "txt_LoudAddChange_A"))
  lo_Offer.OFD_Price = mo_Tools.ScreenToDbl(mo_Tools.GetTextValue(txt_Price, "txt_LoudAddChange_M"))
  Set lo_Offer = ao_Cutout.GetOfferPos(eDPCOfferDetail.odLoudspeakerSetupCharge)
  lo_Offer.OFD_PriceA = mo_Tools.ScreenToDbl(mo_Tools.GetTextValue(txt_Price, "txt_LoudSetupCharge_A"))
  lo_Offer.OFD_Price = mo_Tools.ScreenToDbl(mo_Tools.GetTextValue(txt_Price, "txt_LoudSetupCharge_M"))
  Exit Sub
ErrHandler:
  Call ErrorHandler("FrameLoudToCutout")
End Sub

Private Sub FrameVentToCutout(ByVal ao_Cutout As DPC_Cutout)
On Error GoTo ErrHandler

Dim lo_Offer As DPC_OfferPos
Dim le_SideIdx As eDPCSide
 
  Call ao_Cutout.LoadCutType(mo_Tools.GetComboKey(cbo_Vent))
  
  ao_Cutout.PCT_Type = eDPCCutoutType.eVentilation
  ao_Cutout.PCT_Std = chk_StandardVent.Value = vbChecked
  ao_Cutout.PRF_Id = mo_Tools.GetComboKey(cbo_VentPerf)
  ao_Cutout.PRF_Name = cbo_VentPerf.Text
  ao_Cutout.PCT_SizeD = mo_Tools.ScreenToDbl(mo_Tools.GetTextValue(txt_Textbox, "PCT_SizeD_V"))
  ao_Cutout.PCT_SizeJ = mo_Tools.ScreenToDbl(mo_Tools.GetTextValue(txt_Textbox, "PCT_SizeJ_V"))
  ao_Cutout.PCT_SizeK = mo_Tools.ScreenToDbl(mo_Tools.GetTextValue(txt_Textbox, "PCT_SizeK_V"))
  ao_Cutout.PCT_SizeL = mo_Tools.ScreenToDbl(mo_Tools.GetTextValue(txt_Textbox, "PCT_SizeL_V"))
  ao_Cutout.PCT_SizeM = mo_Tools.ScreenToDbl(mo_Tools.GetTextValue(txt_Textbox, "PCT_SizeM_V"))
   
  For le_SideIdx = eDPCSide.esSideC To eDPCSide.esSideF
    ao_Cutout.PCT_UBor(le_SideIdx) = mo_Tools.ScreenToDbl(mo_Tools.GetTextValue(txt_Textbox, "PCT_UBor" & mv_Edge(le_SideIdx) & "_V"))
    ao_Cutout.PCT_UBoW(le_SideIdx) = mo_Tools.ScreenToDbl(mo_Tools.GetTextValue(txt_Textbox, "PCT_UBoW" & mv_Edge(le_SideIdx) & "_V"))
  Next
  
  ao_Cutout.PRF_IsCorrStep = (chk_CorrectStepV.Value = vbChecked)
  ao_Cutout.PRF_IsStandard = (chk_StandardPerfV.Value = vbChecked)
  
  Set lo_Offer = ao_Cutout.GetOfferPos(eDPCOfferDetail.odVentilationCost)
  lo_Offer.OFD_PriceA = mo_Tools.ScreenToDbl(mo_Tools.GetTextValue(txt_Price, "txt_VentPrice_A"))
  lo_Offer.OFD_Price = mo_Tools.ScreenToDbl(mo_Tools.GetTextValue(txt_Price, "txt_VentPrice_M"))
  Set lo_Offer = ao_Cutout.GetOfferPos(eDPCOfferDetail.odVentilationAddChangeCost)
  lo_Offer.OFD_PriceA = mo_Tools.ScreenToDbl(mo_Tools.GetTextValue(txt_Price, "txt_VentAddChange_A"))
  lo_Offer.OFD_Price = mo_Tools.ScreenToDbl(mo_Tools.GetTextValue(txt_Price, "txt_VentAddChange_M"))
  Set lo_Offer = ao_Cutout.GetOfferPos(eDPCOfferDetail.odVentilationSetupCharge)
  lo_Offer.OFD_PriceA = mo_Tools.ScreenToDbl(mo_Tools.GetTextValue(txt_Price, "txt_VentSetupCharge_A"))
  lo_Offer.OFD_Price = mo_Tools.ScreenToDbl(mo_Tools.GetTextValue(txt_Price, "txt_VentSetupCharge_M"))
  Exit Sub
ErrHandler:
  Call ErrorHandler("FrameVentToCutout")
End Sub

Private Sub CutoutObjToGrid(ByVal ao_Cutout As DPC_Cutout, ByVal ao_grid As ArmGrid, ByVal al_Idx As Long)
On Error GoTo ErrHandler

Dim lo_Offer As DPC_OfferPos

  ao_grid.Data(al_Idx, "Idx") = ao_Cutout.Idx
  ao_grid.Data(al_Idx, "PCT_Id") = ao_Cutout.PCT_Id
  ao_grid.Data(al_Idx, "PCT_Type") = ao_Cutout.PCT_Type
  ao_grid.Data(al_Idx, "PCT_Std") = IIf(ao_Cutout.PCT_Std, "X", "")
  ao_grid.Data(al_Idx, "CUT_Id") = ao_Cutout.CUT_Id
  ao_grid.Data(al_Idx, "CUT_Code") = ao_Cutout.CUT_Code
  ao_grid.Data(al_Idx, "CUT_Name") = ao_Cutout.CUT_Name
  ao_grid.Data(al_Idx, "CUT_Desc") = ao_Cutout.CUT_Desc
  ao_grid.Data(al_Idx, "CUT_Shape") = ao_Cutout.CUT_Shape
  ao_grid.Data(al_Idx, "PRF_Id") = ao_Cutout.PRF_Id
  ao_grid.Data(al_Idx, "PRF_Name") = ao_Cutout.PRF_Name
  ao_grid.Data(al_Idx, "PCT_SizeD") = ao_Cutout.PCT_SizeD
  ao_grid.Data(al_Idx, "PCT_SizeJ") = ao_Cutout.PCT_SizeJ
  ao_grid.Data(al_Idx, "PCT_SizeK") = ao_Cutout.PCT_SizeK
  ao_grid.Data(al_Idx, "PCT_SizeL") = ao_Cutout.PCT_SizeL
  ao_grid.Data(al_Idx, "PCT_SizeM") = ao_Cutout.PCT_SizeM
  ao_grid.Data(al_Idx, "IMG_Id") = ao_Cutout.IMG_Id
  ao_grid.Data(al_Idx, "IMG_IdShp") = ao_Cutout.IMG_IdShp
  ao_grid.Data(al_Idx, "PCT_UBorC") = ao_Cutout.PCT_UBor(eDPCSide.esSideC)
  ao_grid.Data(al_Idx, "PCT_UBorD") = ao_Cutout.PCT_UBor(eDPCSide.esSideD)
  ao_grid.Data(al_Idx, "PCT_UBorE") = ao_Cutout.PCT_UBor(eDPCSide.esSideE)
  ao_grid.Data(al_Idx, "PCT_UBorF") = ao_Cutout.PCT_UBor(eDPCSide.esSideF)
  ao_grid.Data(al_Idx, "PCT_UBoWC") = ao_Cutout.PCT_UBoW(eDPCSide.esSideC)
  ao_grid.Data(al_Idx, "PCT_UBoWD") = ao_Cutout.PCT_UBoW(eDPCSide.esSideD)
  ao_grid.Data(al_Idx, "PCT_UBoWE") = ao_Cutout.PCT_UBoW(eDPCSide.esSideE)
  ao_grid.Data(al_Idx, "PCT_UBoWF") = ao_Cutout.PCT_UBoW(eDPCSide.esSideF)
  
  If ao_Cutout.PCT_Type = eDPCCutoutType.eVentilation Then
    Set lo_Offer = ao_Cutout.GetOfferPos(eDPCOfferDetail.odVentilationCost)
    ao_grid.Data(al_Idx, "PRC_Cost") = lo_Offer.OFD_Price
    Set lo_Offer = ao_Cutout.GetOfferPos(eDPCOfferDetail.odVentilationAddChangeCost)
    ao_grid.Data(al_Idx, "PRC_ACost") = lo_Offer.OFD_Price
    Set lo_Offer = ao_Cutout.GetOfferPos(eDPCOfferDetail.odVentilationSetupCharge)
    ao_grid.Data(al_Idx, "PRC_SCost") = lo_Offer.OFD_Price
  ElseIf ao_Cutout.PCT_Type = eDPCCutoutType.eLoudspeaker Then
    Set lo_Offer = ao_Cutout.GetOfferPos(eDPCOfferDetail.odLoudspeakerCost)
    ao_grid.Data(al_Idx, "PRC_Cost") = lo_Offer.OFD_Price
    Set lo_Offer = ao_Cutout.GetOfferPos(eDPCOfferDetail.odLoudspeakerAddChangeCost)
    ao_grid.Data(al_Idx, "PRC_ACost") = lo_Offer.OFD_Price
    Set lo_Offer = ao_Cutout.GetOfferPos(eDPCOfferDetail.odLoudspeakerSetupCharge)
    ao_grid.Data(al_Idx, "PRC_SCost") = lo_Offer.OFD_Price
  ElseIf ao_Cutout.PCT_Type = eDPCCutoutType.eCutout Then
    Set lo_Offer = ao_Cutout.GetOfferPos(eDPCOfferDetail.odCutoutCost)
    ao_grid.Data(al_Idx, "PRC_Cost") = lo_Offer.OFD_Price
    Set lo_Offer = ao_Cutout.GetOfferPos(eDPCOfferDetail.odCutoutAddChangeCost)
    ao_grid.Data(al_Idx, "PRC_ACost") = lo_Offer.OFD_Price
    Set lo_Offer = ao_Cutout.GetOfferPos(eDPCOfferDetail.odCutoutSetupCharge)
    ao_grid.Data(al_Idx, "PRC_SCost") = lo_Offer.OFD_Price
    Set lo_Offer = ao_Cutout.GetOfferPos(eDPCOfferDetail.odCutoutSurcharge)
    ao_grid.Data(al_Idx, "PRC_UCost") = lo_Offer.OFD_Price
  End If
  Exit Sub
ErrHandler:
  Call ErrorHandler("CutoutObjToGrid")
End Sub

Private Sub FrameToInlay(ByVal ao_Inlay As DPC_Inlay)
On Error GoTo ErrHandler

Dim lo_Offer As DPC_OfferPos

  ao_Inlay.INL_Code = mo_Tools.GetTextValue(txt_Textbox, "INL_Code")
  ao_Inlay.INL_Name = mo_Tools.GetTextValue(txt_Textbox, "INL_Name")
  ao_Inlay.INL_Desc = mo_Tools.GetTextValue(txt_Textbox, "INL_Desc")
  ao_Inlay.INL_Vend = mo_Tools.GetTextValue(txt_Textbox, "INL_Vend")
  
  ao_Inlay.PIN_SizeA = mo_Tools.ScreenToDbl(mo_Tools.GetTextValue(txt_Textbox, "PIN_SizeA"))
  ao_Inlay.PIN_SizeB = mo_Tools.ScreenToDbl(mo_Tools.GetTextValue(txt_Textbox, "PIN_SizeB"))
  
  ao_Inlay.PIN_Purch = mo_Tools.GetComboKey(cbo_InlayPurchase)
  ao_Inlay.PIN_PurchDesc = cbo_InlayPurchase.Text
  ao_Inlay.PIN_Deliv = mo_Tools.GetComboKey(cbo_InlayDelivery)
  ao_Inlay.PIN_DelivDesc = cbo_InlayDelivery.Text
  
  Set lo_Offer = ao_Inlay.GetOfferPos(eDPCOfferDetail.odInlayCost)
  lo_Offer.OFD_Price = mo_Tools.ScreenToDbl(mo_Tools.GetTextValue(txt_Price, "txt_InlayPrice_M"))
  Set lo_Offer = ao_Inlay.GetOfferPos(eDPCOfferDetail.odInlaySetupCharge)
  lo_Offer.OFD_Price = mo_Tools.ScreenToDbl(mo_Tools.GetTextValue(txt_Price, "txt_InlaySetupCharge_M"))
  Exit Sub
ErrHandler:
  Call ErrorHandler("FrameToInlay")
End Sub

Private Sub InlayObjToGrid(ByVal ao_Inlay As DPC_Inlay, ByVal al_Idx As Long)
On Error GoTo ErrHandler

Dim lo_Offer As DPC_OfferPos

  grd_Inlay.Data(al_Idx, "Idx") = ao_Inlay.Idx
  grd_Inlay.Data(al_Idx, "PIN_Id") = ao_Inlay.PIN_Id
  grd_Inlay.Data(al_Idx, "INL_Id") = ao_Inlay.INL_Id
  grd_Inlay.Data(al_Idx, "INL_Code") = ao_Inlay.INL_Code
  grd_Inlay.Data(al_Idx, "INL_Name") = ao_Inlay.INL_Name
  grd_Inlay.Data(al_Idx, "INL_Desc") = ao_Inlay.INL_Desc
  grd_Inlay.Data(al_Idx, "PIN_Order") = ao_Inlay.PIN_Order
  grd_Inlay.Data(al_Idx, "PIN_Std") = IIf(ao_Inlay.PIN_Std, "X", "")
  grd_Inlay.Data(al_Idx, "PIN_SizeA") = ao_Inlay.PIN_SizeA
  grd_Inlay.Data(al_Idx, "PIN_SizeB") = ao_Inlay.PIN_SizeB
  grd_Inlay.Data(al_Idx, "INL_Type") = ao_Inlay.INL_Type
  grd_Inlay.Data(al_Idx, "INL_TypeDesc") = ao_Inlay.INL_TypeDesc
  grd_Inlay.Data(al_Idx, "INL_Vend") = ao_Inlay.INL_Vend
  grd_Inlay.Data(al_Idx, "INL_IsCus") = IIf(ao_Inlay.INL_IsCus, "X", "")
  grd_Inlay.Data(al_Idx, "INL_Text") = ao_Inlay.INL_Text
  grd_Inlay.Data(al_Idx, "UM_CodeC") = DPC_UOM_M2
  grd_Inlay.Data(al_Idx, "UM_Name") = DPC_UOM_M2
  
  Set lo_Offer = ao_Inlay.GetOfferPos(eDPCOfferDetail.odInlayCost)
  grd_Inlay.Data(al_Idx, "PRC_Cost") = lo_Offer.OFD_Price
  Set lo_Offer = ao_Inlay.GetOfferPos(eDPCOfferDetail.odInlaySetupCharge)
  grd_Inlay.Data(al_Idx, "PRC_SCost") = lo_Offer.OFD_Price
  Exit Sub
ErrHandler:
  Call ErrorHandler("InlayObjToGrid")
End Sub

Private Sub UpdateInlayOrder()
On Error GoTo ErrHandler

Dim ll_RowIdx As Long
Dim ll_Order As Long
Dim lo_Inlay As DPC_Inlay

  ll_Order = 0
  For ll_RowIdx = 0 To grd_Inlay.Rows - 1
    ll_Order = ll_Order + 1
    If Val(grd_Inlay.Data(ll_RowIdx, "PIN_Order")) <> ll_Order Then
      Set lo_Inlay = mo_PrdConfig.GetInlay(grd_Inlay.Data(ll_RowIdx, "Idx"))
      If Not lo_Inlay Is Nothing Then
        grd_Inlay.Data(ll_RowIdx, "PIN_Order") = ll_Order
        lo_Inlay.PIN_Order = ll_Order
        If lo_Inlay.RowStatus = eDPCRowStatus.rsNone Then
          lo_Inlay.RowStatus = eDPCRowStatus.rsUpdate
        End If
      End If
    End If
  Next
  Exit Sub
ErrHandler:
  Call ErrorHandler("UpdateInlayOrder")
End Sub

Private Sub tlb_CutoutMain_action(Index As Integer, ByVal as_Role As String, as_Language As String)
On Error GoTo ErrHandler

Dim lo_Cutout As DPC_Cutout

  If mb_InternalInit Then Exit Sub
  mb_InternalInit = True
  Call mo_Tools.LockScreen(Me, True)
  Select Case as_Role
  Case "A"
    Call mo_Tools.ClearFrame(Controls, fra_Cutout(Index))
    Call mo_Tools.EnableFrame(Controls, fra_Cutout(Index), True)
    Set mo_CurrentCutout = New DPC_Cutout
    Select Case Index
    Case 0
      Call mo_PrdConfig.InitCutout(mo_CurrentCutout, eDPCCutoutType.eVentilation, eDPCRowStatus.rsAdd)
    Case 1
      Call mo_PrdConfig.InitCutout(mo_CurrentCutout, eDPCCutoutType.eLoudspeaker, eDPCRowStatus.rsAdd)
    Case 2
      Call mo_PrdConfig.InitCutout(mo_CurrentCutout, eDPCCutoutType.eCutout, eDPCRowStatus.rsAdd)
    End Select
    Call DisplayGenericCutoutFrame(mo_CurrentCutout, Index)
    me_CutoutScreen(Index) = eDPCScreenMode.smAdd
    Call tlb_CutoutDetail(Index).DisplayFace("1")
    Call EnableCutoutNavigation(False, Index)
    Call EnableNavigation(False)
  Case "B"
    If grd_Cutout(Index).SelectedCount <> 1 Then
      Call mo_Tools.ShowMsg(mo_Db, ms_Language_Code, 9723, "#Please, select one row")
      Call mo_Tools.LockScreen(Me, False)
      mb_InternalInit = False
      Exit Sub
    End If
    Call mo_Tools.ClearFrame(Controls, fra_Cutout(Index))
    Set lo_Cutout = mo_PrdConfig.GetCutout(Val(grd_Cutout(Index).SelectedLine(0, "Idx")))
    If Not lo_Cutout Is Nothing Then
      Set mo_CurrentCutout = New DPC_Cutout
      Select Case Index
      Case 0
        Call mo_PrdConfig.InitCutout(mo_CurrentCutout, eDPCCutoutType.eVentilation, eDPCRowStatus.rsUpdate)
      Case 1
        Call mo_PrdConfig.InitCutout(mo_CurrentCutout, eDPCCutoutType.eLoudspeaker, eDPCRowStatus.rsUpdate)
      Case 2
        Call mo_PrdConfig.InitCutout(mo_CurrentCutout, eDPCCutoutType.eCutout, eDPCRowStatus.rsUpdate)
      End Select
      Call mo_CurrentCutout.CopyFrom(lo_Cutout)
      Call mo_Tools.EnableFrame(Controls, fra_Cutout(Index), True)
      Call DisplayGenericCutoutFrame(mo_CurrentCutout, Index)
      me_CutoutScreen(Index) = eDPCScreenMode.smUpdate
      Call tlb_CutoutDetail(Index).DisplayFace("2")
      Call EnableCutoutNavigation(False, Index)
      Call EnableNavigation(False)
    End If
  Case "C"
    If grd_Cutout(Index).SelectedCount <> 1 Then
      Call mo_Tools.ShowMsg(mo_Db, ms_Language_Code, 9723, "#Please, select one row")
      Call mo_Tools.LockScreen(Me, False)
      mb_InternalInit = False
      Exit Sub
    End If
    Set mo_CurrentCutout = mo_PrdConfig.GetCutout(Val(grd_Cutout(Index).SelectedLine(0, "Idx")))
    If Not mo_CurrentCutout Is Nothing Then
      Call mo_Tools.ClearFrame(Controls, fra_Cutout(Index))
      Call DisplayGenericCutoutFrame(mo_CurrentCutout, Index)
      Call mo_Tools.EnableFrame(Controls, fra_Cutout(Index), False)
      me_CutoutScreen(Index) = eDPCScreenMode.smDelete
      Call tlb_CutoutDetail(Index).DisplayFace("3")
      Call EnableCutoutNavigation(False, Index)
      Call EnableNavigation(False)
    End If
  End Select
  Call mo_Tools.LockScreen(Me, False)
  mb_InternalInit = False
  Exit Sub
ErrHandler:
  Call ErrorMessage("tlb_CutoutMain_action")
End Sub

Private Sub tlb_CutoutDetail_action(Index As Integer, ByVal as_Role As String, as_Language As String)
On Error GoTo ErrHandler

Dim lo_Cutout As DPC_Cutout
  
  If mo_CurrentCutout Is Nothing Then Exit Sub
  
  If mb_InternalInit Then Exit Sub
  mb_InternalInit = True
  Call mo_Tools.LockScreen(Me, True)
  Select Case as_Role
  Case "H"
    Select Case me_CutoutScreen(Index)
    Case eDPCScreenMode.smAdd
      Call FrameToCutout(mo_CurrentCutout, Index)
      Select Case Index
      Case 0
        If Not CheckStepCutoutItem(eDPCScreen.psVentilation, mo_CurrentCutout) Then
          Call mo_Tools.LockScreen(Me, False)
          mb_InternalInit = False
          Exit Sub
        End If
        mo_PrdConfig.NoVentilation = False
      Case 1
        If Not CheckStepCutoutItem(eDPCScreen.psLoudspeaker, mo_CurrentCutout) Then
          Call mo_Tools.LockScreen(Me, False)
          mb_InternalInit = False
          Exit Sub
        End If
        mo_PrdConfig.NoLoudspeaker = False
      Case 2
        If Not CheckStepCutoutItem(eDPCScreen.psCutout, mo_CurrentCutout) Then
          Call mo_Tools.LockScreen(Me, False)
          mb_InternalInit = False
          Exit Sub
        End If
        mo_PrdConfig.NoCutout = False
      Case Else
        Err.Raise ArmErr.InvalidArgument, "emAdd", "Invalid index: " & Index
      End Select
      Call mo_PrdConfig.CutoutAdd(mo_CurrentCutout)
    Case eDPCScreenMode.smUpdate
      Call FrameToCutout(mo_CurrentCutout, Index)
      Select Case Index
      Case 0
        If Not CheckStepCutoutItem(eDPCScreen.psVentilation, mo_CurrentCutout) Then
          Call mo_Tools.LockScreen(Me, False)
          mb_InternalInit = False
          Exit Sub
        End If
        mo_PrdConfig.NoVentilation = False
      Case 1
        If Not CheckStepCutoutItem(eDPCScreen.psLoudspeaker, mo_CurrentCutout) Then
          Call mo_Tools.LockScreen(Me, False)
          mb_InternalInit = False
          Exit Sub
        End If
        mo_PrdConfig.NoLoudspeaker = False
      Case 2
        If Not CheckStepCutoutItem(eDPCScreen.psCutout, mo_CurrentCutout) Then
          Call mo_Tools.LockScreen(Me, False)
          mb_InternalInit = False
          Exit Sub
        End If
        mo_PrdConfig.NoCutout = False
      Case Else
        Err.Raise ArmErr.InvalidArgument, "emUpdate", "Invalid index: " & Index
      End Select
      Set lo_Cutout = mo_PrdConfig.GetCutout(mo_CurrentCutout.Idx)
      If Not lo_Cutout Is Nothing Then
        Call lo_Cutout.CopyFrom(mo_CurrentCutout)
        Call mo_PrdConfig.CutoutUpdate(lo_Cutout)
      End If
    Case eDPCScreenMode.smDelete
      Call mo_PrdConfig.CutoutDrop(mo_CurrentCutout)
    Case Else
      Err.Raise 0, "tlb_CutoutDetail_action", "Invalid screen mode"
    End Select
    
    Select Case Index
    Case 0
      Call DisplayVentilation
    Case 1
      Call DisplayLoudspeaker
    Case 2
      Call DisplayCutout
    Case Else
      Err.Raise ArmErr.InvalidArgument, "Index", "Invalid index: " & Index
    End Select
    
    Call EnableCutoutNavigation(True, Index)
    Call EnableNavigation(True)
    Set mo_CurrentCutout = Nothing
  Case "I"
    Select Case me_CutoutScreen(Index)
    Case eDPCScreenMode.smAdd
      Select Case Index
      Case 0
        Call mo_PrdConfig.InitCutout(mo_CurrentCutout, eDPCCutoutType.eVentilation, eDPCRowStatus.rsAdd)
      Case 1
        Call mo_PrdConfig.InitCutout(mo_CurrentCutout, eDPCCutoutType.eLoudspeaker, eDPCRowStatus.rsAdd)
      Case 2
        Call mo_PrdConfig.InitCutout(mo_CurrentCutout, eDPCCutoutType.eCutout, eDPCRowStatus.rsAdd)
      Case Else
        Err.Raise ArmErr.InvalidArgument, "Index", "Invalid index: " & Index
      End Select
      Call DisplayGenericCutoutFrame(mo_CurrentCutout, Index)
    Case eDPCScreenMode.smUpdate
      Set lo_Cutout = mo_PrdConfig.GetCutout(mo_CurrentCutout.Idx)
      If Not lo_Cutout Is Nothing Then
        Call mo_CurrentCutout.CopyFrom(lo_Cutout)
        Call DisplayGenericCutoutFrame(mo_CurrentCutout, Index)
      End If
    End Select
  Case "T"
    Call EnableCutoutNavigation(True, Index)
    Call EnableNavigation(True)
    Set mo_CurrentCutout = Nothing
  End Select
  Call mo_Tools.LockScreen(Me, False)
  mb_InternalInit = False
  Exit Sub
ErrHandler:
  Call ErrorMessage("tlb_CutoutDetail_action")
End Sub

Private Sub cbo_Cutout_ComboItemSelected()
On Error GoTo ErrHandler

  If mb_InternalInit Then Exit Sub
  mb_InternalInit = True
  Call mo_Tools.LockScreen(Me, True)
  Call FrameCutoutToCutout(mo_CurrentCutout)
  Call mo_CurrentCutout.LoadCutType(mo_Tools.GetComboKey(cbo_Cutout))
  Call LoadCutoutPrice(mo_CurrentCutout)
  Call DisplayCutoutFrame(mo_CurrentCutout)
  Call mo_Tools.LockScreen(Me, False)
  mb_InternalInit = False
  Exit Sub
ErrHandler:
  Call ErrorMessage("cbo_cutout_ComboItemSelected")
End Sub

Private Sub cbo_Loud_ComboItemSelected()
On Error GoTo ErrHandler

Dim ls_Request As String

  If mb_InternalInit Then Exit Sub
  mb_InternalInit = True
  Call mo_Tools.LockScreen(Me, True)
  Call FrameLoudToCutout(mo_CurrentCutout)
  Call mo_CurrentCutout.LoadCutType(mo_Tools.GetComboKey(cbo_Loud))
  mo_CurrentCutout.PCT_Std = True
  
  Call InitCutAreaCombo(cbo_LoudArea, mo_Tools.GetComboKey(cbo_Loud))
  Call cbo_LoudArea.Load
  
  If cbo_LoudArea.Count = 1 Then
    Call mo_CurrentCutout.LoadCutArea(cbo_LoudArea.ComboItems(1).Key)
  End If
  
  Call LoadLoudPrice(mo_CurrentCutout)
  Call DisplayLoudFrame(mo_CurrentCutout)
  Call mo_Tools.LockScreen(Me, False)
  mb_InternalInit = False
  Exit Sub
ErrHandler:
  Call ErrorMessage("cbo_Loud_ComboItemSelected")
End Sub

Private Sub cbo_Vent_ComboItemSelected()
On Error GoTo ErrHandler

  If mb_InternalInit Then Exit Sub
  mb_InternalInit = True
  Call mo_Tools.LockScreen(Me, True)
  Call FrameVentToCutout(mo_CurrentCutout)
  Call mo_CurrentCutout.LoadCutType(mo_Tools.GetComboKey(cbo_Vent))
  mo_CurrentCutout.PCT_Std = True
  
  Call InitCutAreaCombo(cbo_VentArea, mo_Tools.GetComboKey(cbo_Vent))
  Call cbo_VentArea.Load
  
  If cbo_VentArea.Count = 1 Then
    Call mo_CurrentCutout.LoadCutArea(cbo_VentArea.ComboItems(1).Key)
  End If
  
  Call LoadVentPrice(mo_CurrentCutout)
  Call DisplayVentFrame(mo_CurrentCutout)
  Call mo_Tools.LockScreen(Me, False)
  mb_InternalInit = False
  Exit Sub
ErrHandler:
  Call ErrorMessage("cbo_Vent_ComboItemSelected")
End Sub

Private Sub cbo_VentArea_ComboItemSelected()
On Error GoTo ErrHandler

  If mb_InternalInit Then Exit Sub
  mb_InternalInit = True
  Call mo_Tools.LockScreen(Me, True)
  Call mo_CurrentCutout.LoadCutArea(mo_Tools.GetComboKey(cbo_VentArea))
  Call LoadVentPrice(mo_CurrentCutout)
  Call DisplayVentFrame(mo_CurrentCutout)
  Call mo_Tools.LockScreen(Me, False)
  mb_InternalInit = False
  Exit Sub
ErrHandler:
  Call ErrorMessage("cbo_VentArea_ComboItemSelected")
End Sub

Private Sub cbo_LoudArea_ComboItemSelected()
On Error GoTo ErrHandler

  If mb_InternalInit Then Exit Sub
  mb_InternalInit = True
  Call mo_Tools.LockScreen(Me, True)
  Call mo_CurrentCutout.LoadCutArea(mo_Tools.GetComboKey(cbo_LoudArea))
  Call LoadLoudPrice(mo_CurrentCutout)
  Call DisplayLoudFrame(mo_CurrentCutout)
  Call mo_Tools.LockScreen(Me, False)
  mb_InternalInit = False
  Exit Sub
ErrHandler:
  Call ErrorMessage("cbo_LoudArea_ComboItemSelected")
End Sub

Private Sub chk_StandardVent_Click()
On Error GoTo ErrHandler
 
  If mb_InternalInit Then Exit Sub
  mb_InternalInit = True
  Call mo_Tools.LockScreen(Me, True)
  mo_CurrentCutout.PCT_Std = (chk_StandardVent.Value = vbChecked)
  
  If mo_CurrentCutout.PCT_Std Then
    Call mo_CurrentCutout.LoadCutType(mo_Tools.GetComboKey(cbo_Vent))
    Call mo_CurrentCutout.LoadCutArea(mo_Tools.GetComboKey(cbo_VentArea))
    Call LoadVentPrice(mo_CurrentCutout)
  End If
  
  Call DisplayVentFrame(mo_CurrentCutout)
  Call mo_Tools.LockScreen(Me, False)
  mb_InternalInit = False
  Exit Sub
ErrHandler:
  Call ErrorMessage("chk_StandardVent_Click")
End Sub

Private Sub chk_StandardLoud_Click()
On Error GoTo ErrHandler
  
  If mb_InternalInit Then Exit Sub
  mb_InternalInit = True
  Call mo_Tools.LockScreen(Me, True)
  mo_CurrentCutout.PCT_Std = (chk_StandardLoud.Value = vbChecked)
  
  If mo_CurrentCutout.PCT_Std Then
    Call mo_CurrentCutout.LoadCutType(mo_Tools.GetComboKey(cbo_Loud))
    Call mo_CurrentCutout.LoadCutArea(mo_Tools.GetComboKey(cbo_LoudArea))
    Call LoadLoudPrice(mo_CurrentCutout)
  End If
  
  Call DisplayLoudFrame(mo_CurrentCutout)
  Call mo_Tools.LockScreen(Me, False)
  mb_InternalInit = False
  Exit Sub
ErrHandler:
  Call ErrorMessage("chk_StandardLoud_Click")
End Sub

Private Sub chk_StandardPerf_Click()
On Error GoTo ErrHandler

Dim ll_SideIdx As Long
  
  If mb_InternalInit Then Exit Sub
  mb_InternalInit = True
  Call mo_Tools.LockScreen(Me, True)
  mo_PrdConfig.PRF_IsStandard = (chk_StandardPerf.Value = vbChecked)
  If mo_PrdConfig.PRF_IsStandard Then
    For ll_SideIdx = eDPCSide.esSideC To eDPCSide.esSideF
      If chk_PerfBorder(ll_SideIdx).Value = vbChecked Then
        Call mo_PrdConfig.SetDefaultOverperforatedBorder(ll_SideIdx)
      Else
        Call mo_PrdConfig.SetDefaultUnperforatedBorder(ll_SideIdx)
      End If
    Next
  End If
  Call mo_PrdConfig.CalcPerfBorder
  Call DisplayPerforationBorder
  Call mo_Tools.LockScreen(Me, False)
  mb_InternalInit = False
  Exit Sub
ErrHandler:
  Call ErrorMessage("chk_StandardPerf_Click")
End Sub

Private Sub chk_StandardPerfC_Click()
On Error GoTo ErrHandler

Dim ll_SideIdx As eDPCSide
  
  If mb_InternalInit Then Exit Sub
  mb_InternalInit = True
  Call mo_Tools.LockScreen(Me, True)
  mo_CurrentCutout.PCT_Std = (chk_StandardPerfC.Value = vbChecked)
  If mo_CurrentCutout.PCT_Std Then
    mo_CurrentCutout.PRF_IsCorrStep = True
    For ll_SideIdx = eDPCSide.esSideC To eDPCSide.esSideF
      If chk_PerfBorderC(ll_SideIdx).Value = vbChecked Then
        mo_CurrentCutout.PCT_UBoW(ll_SideIdx) = -1
      Else
        mo_CurrentCutout.PCT_UBoW(ll_SideIdx) = mo_PrdConfig.SYS_UnperfBorder(ll_SideIdx)
      End If
    Next
  End If
  Call mo_CurrentCutout.CalcPerfBorder
  Call DisplayCutoutFrame(mo_CurrentCutout)
  Call mo_Tools.LockScreen(Me, False)
  mb_InternalInit = False
  Exit Sub
ErrHandler:
  Call ErrorMessage("chk_StandardPerfC_Click")
End Sub

Private Sub chk_StandardPerfL_Click()
On Error GoTo ErrHandler

Dim ll_SideIdx As eDPCSide
  
  If mb_InternalInit Then Exit Sub
  mb_InternalInit = True
  Call mo_Tools.LockScreen(Me, True)
  mo_CurrentCutout.PCT_Std = (chk_StandardPerfL.Value = vbChecked)
  If mo_CurrentCutout.PCT_Std Then
    mo_CurrentCutout.PRF_IsCorrStep = True
    For ll_SideIdx = eDPCSide.esSideC To eDPCSide.esSideF
      If chk_PerfBorderL(ll_SideIdx).Value = vbChecked Then
        mo_CurrentCutout.PCT_UBoW(ll_SideIdx) = -1
      Else
        mo_CurrentCutout.PCT_UBoW(ll_SideIdx) = mo_PrdConfig.SYS_UnperfBorder(ll_SideIdx)
      End If
    Next
  End If
  Call mo_CurrentCutout.CalcPerfBorder
  Call DisplayLoudFrame(mo_CurrentCutout)
  Call mo_Tools.LockScreen(Me, False)
  mb_InternalInit = False
  Exit Sub
ErrHandler:
  Call ErrorMessage("chk_StandardPerfL_Click")
End Sub

Private Sub chk_StandardPerfV_Click()
On Error GoTo ErrHandler

Dim ll_SideIdx As eDPCSide
  
  If mb_InternalInit Then Exit Sub
  mb_InternalInit = True
  Call mo_Tools.LockScreen(Me, True)
  mo_CurrentCutout.PCT_Std = (chk_StandardPerfV.Value = vbChecked)
  If mo_CurrentCutout.PCT_Std Then
    mo_CurrentCutout.PRF_IsCorrStep = True
    For ll_SideIdx = eDPCSide.esSideC To eDPCSide.esSideF
      If chk_PerfBorderV(ll_SideIdx).Value = vbChecked Then
        mo_CurrentCutout.PCT_UBoW(ll_SideIdx) = -1
      Else
        mo_CurrentCutout.PCT_UBoW(ll_SideIdx) = mo_PrdConfig.SYS_UnperfBorder(ll_SideIdx)
      End If
    Next
  End If
  Call mo_CurrentCutout.CalcPerfBorder
  Call DisplayVentFrame(mo_CurrentCutout)
  Call mo_Tools.LockScreen(Me, False)
  mb_InternalInit = False
  Exit Sub
ErrHandler:
  Call ErrorMessage("chk_StandardPerfV_Click")
End Sub

Private Sub chk_CorrectStep_Click()
On Error GoTo ErrHandler

  If mb_InternalInit Then Exit Sub
  mb_InternalInit = True
  Call mo_Tools.LockScreen(Me, True)
  mo_PrdConfig.PRF_IsCorrStep = (chk_CorrectStep.Value = vbChecked)
  Call mo_PrdConfig.CalcPerfBorder
  Call DisplayPerforationBorder
  Call mo_Tools.LockScreen(Me, False)
  mb_InternalInit = False
  Exit Sub
ErrHandler:
  Call ErrorMessage("chk_CorrectStep_Click")
End Sub

Private Sub AddTab(ByVal al_Idx As Long)
On Error GoTo ErrHandler

Dim lo_Tab As MSComctlLib.Tab
Dim ls_Caption As String

  Select Case al_Idx
  Case DPC_TAB_STEP_IDX_PANEL
    ls_Caption = "#Panel"
  Case DPC_TAB_STEP_IDX_BENDING
    ls_Caption = "#Bending"
  Case DPC_TAB_STEP_IDX_GASKET
    ls_Caption = "#Gasket"
  Case DPC_TAB_STEP_IDX_PERFORATION
    ls_Caption = "#Perforation"
  Case DPC_TAB_STEP_IDX_PACKING
    ls_Caption = "#Packing"
  Case DPC_TAB_STEP_IDX_INLAY
    ls_Caption = "#Inlay"
  Case DPC_TAB_STEP_IDX_COATING
    ls_Caption = "#Coating"
  Case DPC_TAB_STEP_IDX_VENTILATION
    ls_Caption = "#Ventilation"
  Case DPC_TAB_STEP_IDX_LOUDSPEAKER
    ls_Caption = "#Loudspeaker"
  Case DPC_TAB_STEP_IDX_CUTOUT
    ls_Caption = "#Cutout"
  Case DPC_TAB_STEP_IDX_SHAPE
    ls_Caption = "#Shape"
  Case DPC_TAB_STEP_IDX_OPTIONAL
    ls_Caption = "#Optional surcharge"
  Case DPC_TAB_STEP_IDX_SUMMARY
    ls_Caption = "#Summary"
  Case Else
    ls_Caption = "#Unknown"
  End Select
  
  If tbs_Step.Tabs(1).Key = "" Then
    Set lo_Tab = tbs_Step.Tabs(1)
  Else
    Set lo_Tab = tbs_Step.Tabs.Add
  End If
  
  lo_Tab.Key = fra_Step(al_Idx).Tag
  lo_Tab.Tag = lo_Tab.Key
  lo_Tab.Caption = ls_Caption
  Exit Sub
ErrHandler:
  Call ErrorHandler("AddTab")
End Sub

Private Sub UpdateStepTab()
On Error GoTo ErrHandler

'  If (mo_PrdConfig.CAT_Id = eDPCCategory.cgMetalEngRectPanel) Or (mo_PrdConfig.CAT_Id = eDPCCategory.cgMetalEngPanelTemplate) Then
'    Call AddTab(DPC_TAB_STEP_IDX_SHAPE)
'  End If

  If IsProduction Then
    Call AddTab(DPC_TAB_STEP_IDX_PANEL)
    Call AddTab(DPC_TAB_STEP_IDX_BENDING)
    Call AddTab(DPC_TAB_STEP_IDX_PERFORATION)
    Call AddTab(DPC_TAB_STEP_IDX_COATING)
    Call AddTab(DPC_TAB_STEP_IDX_GASKET)
    Call AddTab(DPC_TAB_STEP_IDX_INLAY)
    
    Call AddTab(DPC_TAB_STEP_IDX_CUTOUT)
    Call AddTab(DPC_TAB_STEP_IDX_LOUDSPEAKER)
    Call AddTab(DPC_TAB_STEP_IDX_VENTILATION)
    
    chk_NoCutout.Value = vbChecked
    chk_NoVentilation.Value = vbChecked
    chk_NoLoudspeaker.Value = vbChecked
    mo_PrdConfig.NoCutout = True
    mo_PrdConfig.NoLoudspeaker = True
    mo_PrdConfig.NoVentilation = True
    
    Call AddTab(DPC_TAB_STEP_IDX_PACKING)
    If Not IsStandard Then
      Call AddTab(DPC_TAB_STEP_IDX_OPTIONAL)
    End If
    Call AddTab(DPC_TAB_STEP_IDX_SUMMARY)
  Else
    Call AddTab(DPC_TAB_STEP_IDX_PANEL)
    Call AddTab(DPC_TAB_STEP_IDX_BENDING)
    Call AddTab(DPC_TAB_STEP_IDX_PERFORATION)
    
    Call AddTab(DPC_TAB_STEP_IDX_CUTOUT)
    Call AddTab(DPC_TAB_STEP_IDX_LOUDSPEAKER)
    Call AddTab(DPC_TAB_STEP_IDX_VENTILATION)
    
    chk_NoCutout.Value = vbChecked
    chk_NoVentilation.Value = vbChecked
    chk_NoLoudspeaker.Value = vbChecked
    mo_PrdConfig.NoCutout = True
    mo_PrdConfig.NoLoudspeaker = True
    mo_PrdConfig.NoVentilation = True
    
    Call AddTab(DPC_TAB_STEP_IDX_COATING)
    Call AddTab(DPC_TAB_STEP_IDX_GASKET)
    Call AddTab(DPC_TAB_STEP_IDX_INLAY)
    Call AddTab(DPC_TAB_STEP_IDX_PACKING)
    If Not IsStandard Then
      Call AddTab(DPC_TAB_STEP_IDX_OPTIONAL)
    End If
    Call AddTab(DPC_TAB_STEP_IDX_SUMMARY)
  End If
  Call mo_Tools.LoadTabStripLabels(mo_Db, mc_ScreenLabels, tbs_Step)
  Exit Sub
ErrHandler:
  Call ErrorHandler("UpdateStepTab")
End Sub

Private Sub SetPriceLabel(ByVal as_CURR_Code As String)
On Error GoTo ErrHandler

Dim ll_Idx As Long
Dim ls_CurrUMCaption As String

  If mo_PrdConfig.QtyType = eDPCQtyType.qtM2 Then
    ls_CurrUMCaption = as_CURR_Code & "/" & DPC_UOM_M2
  Else
    ls_CurrUMCaption = as_CURR_Code & "/" & DPC_UOM_PCS
  End If
  
  For ll_Idx = 0 To lbl_Price.Count - 1
    If lbl_Price(ll_Idx).Tag = "_lbl_CURR_GasketSurcharge" Then
      lbl_Price(ll_Idx).Caption = ls_CurrUMCaption
    ElseIf lbl_Price(ll_Idx).Tag = "_lbl_CURR_GasketSurcharge2" Then
      lbl_Price(ll_Idx).Caption = ls_CurrUMCaption
    ElseIf lbl_Price(ll_Idx).Tag = "_lbl_CURR_PerfPrice" Then
      lbl_Price(ll_Idx).Caption = ls_CurrUMCaption
    ElseIf lbl_Price(ll_Idx).Tag = "_lbl_CURR_PackingPrice" Then
      lbl_Price(ll_Idx).Caption = ls_CurrUMCaption
    ElseIf lbl_Price(ll_Idx).Tag = "_lbl_CURR_InlayPrice" Then
      lbl_Price(ll_Idx).Caption = ls_CurrUMCaption
    ElseIf lbl_Price(ll_Idx).Tag = "_lbl_CURR_CoatingPrice" Then
      lbl_Price(ll_Idx).Caption = ls_CurrUMCaption
    ElseIf lbl_Price(ll_Idx).Tag = "_lbl_CURR_LabelingPrice" Then
      lbl_Price(ll_Idx).Caption = ls_CurrUMCaption
    Else
      lbl_Price(ll_Idx).Caption = as_CURR_Code
    End If
  Next
  Exit Sub
ErrHandler:
  Call ErrorHandler("SetPriceLabel")
End Sub

'Public Function FindControlByTag(ByRef ao_Controls As Object, ByRef ao_Frame As Frame, ByVal as_Tag As String) As VB.Control
'On Error GoTo errorHandler
'
'    Dim lo_Control As Object
'
'    Set FindControlByTag = Nothing
'
'    For Each lo_Control In ao_Controls
'      If (ao_Frame Is Nothing) Or mo_Tools.HasContainer(lo_Control, ao_Frame) Then
'        If StrComp(Trim(lo_Control.Tag), as_Tag, vbTextCompare) = 0 Then
'            Set FindControlByTag = lo_Control
'            Exit Function
'        End If
'      End If
'    Next
'    Exit Function
'errorHandler:
'    Call errorHandler("FindControlByTag")
'End Function

Private Sub btn_next_Click()
On Error GoTo ErrHandler

  mb_InternalInit = True
  Call mo_Tools.LockScreen(Me, True)
  If StrComp(StepName, "fra_Panel", vbTextCompare) = 0 Then
    If Not CheckStep(eDPCScreen.psPanel) Then
      Call mo_Tools.LockScreen(Me, False)
      mb_InternalInit = False
      Exit Sub
    End If
 ElseIf StrComp(StepName, "fra_Bending", vbTextCompare) = 0 Then
    If Not CheckStep(eDPCScreen.psBending) Then
      Call mo_Tools.LockScreen(Me, False)
      mb_InternalInit = False
      Exit Sub
    End If
  ElseIf StrComp(StepName, "fra_Perforation", vbTextCompare) = 0 Then
    If Not CheckStep(eDPCScreen.psPerforation) Then
      Call mo_Tools.LockScreen(Me, False)
      mb_InternalInit = False
      Exit Sub
    End If
    Call DrawInlaySketch(pct_Inlay)
  ElseIf StrComp(StepName, "fra_Gasket", vbTextCompare) = 0 Then
    If Not CheckStep(eDPCScreen.psGasket) Then
      Call mo_Tools.LockScreen(Me, False)
      mb_InternalInit = False
      Exit Sub
    End If
  ElseIf StrComp(StepName, "fra_Packing", vbTextCompare) = 0 Then
    If Not CheckStep(eDPCScreen.psPacking) Then
      Call mo_Tools.LockScreen(Me, False)
      mb_InternalInit = False
      Exit Sub
    End If
  ElseIf StrComp(StepName, "fra_Inlay", vbTextCompare) = 0 Then
    If Not CheckStep(eDPCScreen.psInlay) Then
      Call mo_Tools.LockScreen(Me, False)
      mb_InternalInit = False
      Exit Sub
    End If
  ElseIf StrComp(StepName, "fra_Coating", vbTextCompare) = 0 Then
    If Not CheckStep(eDPCScreen.psCoating) Then
      Call mo_Tools.LockScreen(Me, False)
      mb_InternalInit = False
      Exit Sub
    End If
  ElseIf StrComp(StepName, "fra_Ventilation", vbTextCompare) = 0 Then
    If Not CheckStep(eDPCScreen.psVentilation) Then
      Call mo_Tools.LockScreen(Me, False)
      mb_InternalInit = False
      Exit Sub
    End If
  ElseIf StrComp(StepName, "fra_Loudspeaker", vbTextCompare) = 0 Then
    If Not CheckStep(eDPCScreen.psLoudspeaker) Then
      Call mo_Tools.LockScreen(Me, False)
      mb_InternalInit = False
      Exit Sub
    End If
  ElseIf StrComp(StepName, "fra_Cutout", vbTextCompare) = 0 Then
    If Not CheckStep(eDPCScreen.psCutout) Then
      Call mo_Tools.LockScreen(Me, False)
      mb_InternalInit = False
      Exit Sub
    End If
  ElseIf StrComp(StepName, "fra_Summary", vbTextCompare) = 0 Then
  End If
  Call mo_PrdConfig.CalcPositionPrice
  Call SetTechBackground
  Call NextStep
  Call mo_Tools.LockScreen(Me, False)
  mb_InternalInit = False
  Exit Sub
ErrHandler:
  Call ErrorMessage("btn_next_Click")
End Sub

Private Sub btn_Back_Click()
On Error GoTo ErrHandler
  
  mb_InternalInit = True
  Call mo_Tools.LockScreen(Me, True)
  Call PreviousStep
  Call mo_Tools.LockScreen(Me, False)
  mb_InternalInit = False
  Exit Sub
ErrHandler:
  Call ErrorMessage("btn_Back_Click")
End Sub

Private Sub btn_Default_Click()
On Error GoTo ErrHandler
  
  mb_InternalInit = True
  Call mo_Tools.LockScreen(Me, True)
  Call DefaultStep
  Call mo_Tools.LockScreen(Me, False)
  mb_InternalInit = False
  Exit Sub
ErrHandler:
  Call ErrorMessage("btn_Default_Click")
End Sub

Private Sub btn_Validate_Click()
On Error GoTo ErrHandler
  
  mb_InternalInit = True
  Call mo_Tools.LockScreen(Me, True)
  If Not CheckStep(eDPCScreen.psPanelSummary) Then
    Call mo_Tools.LockScreen(Me, False)
    mb_InternalInit = False
    Exit Sub
  End If
  Call mo_PrdConfig.CalcPositionPrice
  Result = True
  RaiseEvent quit
  Call mo_Tools.LockScreen(Me, False)
  mb_InternalInit = False
  Exit Sub
ErrHandler:
  Call ErrorMessage("btn_Validate_Click")
End Sub

Private Sub btn_Error_Click()
On Error GoTo ErrHandler

Dim lo_ErrCol As Collection

  mb_InternalInit = True
  Call mo_Tools.LockScreen(Me, True)
  
  Call ClearAllScreenErrorType
  Set lo_ErrCol = mo_PrdConfig.CheckAllScreen
  Call ApplyScreenError(lo_ErrCol)
  Call UserControl.Refresh
  
  If lo_ErrCol.Count = 0 Then
    Call mo_Tools.ShowMsg(mo_Db, ms_Language_Code, 9732, "#No error or level 2 messsages")
  Else
    Call ConfirmCheckList(lo_ErrCol)
  End If
  Call mo_Tools.LockScreen(Me, False)
  mb_InternalInit = False
  Exit Sub
ErrHandler:
  Call ErrorMessage("btn_Error_Click")
End Sub

Private Sub btn_Quit_Click()
On Error GoTo ErrHandler
  
  mb_InternalInit = True
  Call mo_Tools.LockScreen(Me, True)
  Result = False
  RaiseEvent quit
  Call mo_Tools.LockScreen(Me, False)
  mb_InternalInit = False
  Exit Sub
ErrHandler:
  Call ErrorMessage("btn_Quit_Click")
End Sub

Private Sub SetTabErrorType(ByVal as_TabKey As String, ByVal ae_ERR_Type As eDPCErrorType)
On Error GoTo ErrHandler

Dim lo_Tab As MSComctlLib.Tab

  Set lo_Tab = GetTab(tbs_Step, as_TabKey)
  If Not lo_Tab Is Nothing Then
    lo_Tab.Image = ae_ERR_Type
  End If
  Exit Sub
ErrHandler:
  Call ErrorHandler("SetTabErrorType")
End Sub

Private Function GetTabErrorType(ByVal as_TabKey As String) As eDPCErrorType
On Error GoTo ErrHandler

Dim lo_Tab As MSComctlLib.Tab

  Set lo_Tab = GetTab(tbs_Step, as_TabKey)
  If lo_Tab Is Nothing Then
    GetTabErrorType = eDPCErrorType.etNone
  Else
    GetTabErrorType = lo_Tab.Image
  End If
  Exit Function
ErrHandler:
  Call ErrorHandler("GetTabErrorType")
End Function

Private Sub SetStepTabErrorType(ByVal ao_Control As Control, ByVal ae_ERR_Type As eDPCErrorType)
On Error GoTo ErrHandler

Dim lo_Frame As VB.Frame
Dim le_ErrorType As eDPCErrorType

  For Each lo_Frame In fra_Step
    If mo_Tools.HasContainer(ao_Control, lo_Frame) Then
      If GetTabErrorType(lo_Frame.Tag) < ae_ERR_Type Then
        Call SetTabErrorType(lo_Frame.Tag, ae_ERR_Type)
      End If
    End If
  Next
  Exit Sub
ErrHandler:
  Call ErrorHandler("SetStepTabErrorType")
End Sub

Private Sub SetControlErrorColor(ByVal ao_Control As Object, ByVal ae_ERR_Type As eDPCErrorType)
On Error GoTo ErrHandler

Dim ll_Color As Long

  If Not ao_Control Is Nothing Then
    If ae_ERR_Type = eDPCErrorType.etStop Then
      ll_Color = RGB(255, 75, 75) 'vbRed
    ElseIf ae_ERR_Type = eDPCErrorType.etNeedApproval Then
      ll_Color = RGB(255, 225, 75) 'vbYellow
    ElseIf ae_ERR_Type = eDPCErrorType.etInfo Then
      ll_Color = RGB(0, 225, 255) 'vbBlue
    Else
      If TypeOf ao_Control Is VB.Frame Then
        ll_Color = vbWindowText
      Else
        ll_Color = vbButtonFace
      End If
    End If
    Select Case UCase(TypeName(ao_Control))
    Case UCase("Label"), UCase("CheckBox"), UCase("OptionButton")
      ao_Control.BackColor = ll_Color
    Case UCase("Frame")
      If ae_ERR_Type = eDPCErrorType.etNone Then
        ao_Control.Font.Bold = False
      Else
        ao_Control.Font.Bold = True
      End If
      ao_Control.ForeColor = ll_Color
    Case UCase("Tabstrip")
    End Select
  End If
  Exit Sub
ErrHandler:
  Call ErrorHandler("SetControlErrorColor")
End Sub

Private Sub ClearAllScreenErrorType()
On Error GoTo ErrHandler

Dim lo_Frame As VB.Frame
  
  For Each lo_Frame In fra_Step
    Call ClearScreenErrorType(GetScreenFromFrameName(lo_Frame.Tag))
  Next
  Exit Sub
ErrHandler:
  Call ErrorHandler("ClearAllScreenErrorType")
End Sub

Private Sub ClearScreenErrorType(ByVal ae_Screen As eDPCScreen)
On Error GoTo ErrHandler

Dim lo_Control As VB.Control
Dim lo_Frame As VB.Frame
  
  Set lo_Frame = mo_Tools.GetControl(fra_Step, GetFrameNameFromScreen(ae_Screen))
  If lo_Frame Is Nothing Then
    Err.Raise ArmErr.InvalidArgument, "ae_Screen", "Unknown frame for screen: " & ae_Screen
  End If
  Call SetTabErrorType(lo_Frame.Tag, eDPCErrorType.etNone)
  Call SetControlErrorColor(lo_Frame, eDPCErrorType.etNone)
  For Each lo_Control In UserControl.Controls
    If mo_Tools.HasContainer(lo_Control, lo_Frame) Then
      Call SetControlErrorColor(lo_Control, eDPCErrorType.etNone)
    End If
  Next
  Exit Sub
ErrHandler:
  Call ErrorHandler("ClearScreenErrorType")
End Sub

Private Sub ApplyScreenError(ByVal ao_ErrCol As Collection)
On Error GoTo ErrHandler

Dim lo_Error As DPC_Error
Dim lsa_ControlTags() As String
Dim lv_Tag As Variant
Dim lo_Control As VB.Control
Dim le_ERR_Type As eDPCErrorType

  For le_ERR_Type = eDPCErrorType.etInfo To eDPCErrorType.etStop
    For Each lo_Error In ao_ErrCol
      If le_ERR_Type = lo_Error.ERR_Type Then
        If Trim(lo_Error.ERR_Ctrl) <> "" Then
          lsa_ControlTags = Split(lo_Error.ERR_Ctrl, SEP)
          For Each lv_Tag In lsa_ControlTags
            Set lo_Control = mo_Tools.GetControl(UserControl.Controls, lv_Tag)
            If Not lo_Control Is Nothing Then
              Call SetControlErrorColor(lo_Control, le_ERR_Type)
              Call SetStepTabErrorType(lo_Control, le_ERR_Type)
            End If
          Next
        End If
      End If
    Next
  Next
  Exit Sub
ErrHandler:
  Call ErrorHandler("ApplyScreenError")
End Sub

'Private Function GetStepFrameName(ByVal ae_Category As eDPCCategory) As String
'On Error GoTo ErrHandler
'
'  Select Case ae_Category
'  Case eDPCScreen.psAll
'    GetStepFrameName = "fra_Summary"
'  Case eDPCScreen.psPanel
'    GetStepFrameName = "fra_Panel"
'  Case eDPCScreen.psPerforation
'    GetStepFrameName = "fra_Perforation"
'  Case eDPCScreen.psGasket
'    GetStepFrameName = "fra_Gasket"
'  Case eDPCScreen.psPacking
'    GetStepFrameName = "fra_Packing"
'  Case eDPCScreen.psInlay
'    GetStepFrameName = "fra_Inlay"
'  Case eDPCScreen.psCoating
'    GetStepFrameName = "fra_Coating"
'  Case eDPCScreen.psVentilation
'    GetStepFrameName = "fra_Ventilation"
'  Case eDPCScreen.psLoudspeaker
'    GetStepFrameName = "fra_Loudspeaker"
'  Case eDPCScreen.psCutout
'    GetStepFrameName = "fra_Cutout"
'  Case eDPCScreen.psBending
'    GetStepFrameName = "fra_Bending"
'  Case Else
'    Err.Raise ArmErr.InvalidArgument, "ae_Category", "Unkown category: " & ae_Category
'  End Select
'  Exit Function
'ErrHandler:
'  Call ErrorHandler("GetStepFrameName")
'End Function

Private Function GetFrameNameFromScreen(ByVal ae_Screen As eDPCScreen) As String
On Error GoTo ErrHandler

  Select Case ae_Screen
  Case eDPCScreen.psPanelSummary
    GetFrameNameFromScreen = "fra_Summary"
  Case eDPCScreen.psPanel
    GetFrameNameFromScreen = "fra_Panel"
  Case eDPCScreen.psPerforation
    GetFrameNameFromScreen = "fra_Perforation"
  Case eDPCScreen.psGasket
    GetFrameNameFromScreen = "fra_Gasket"
  Case eDPCScreen.psPacking
    GetFrameNameFromScreen = "fra_Packing"
  Case eDPCScreen.psInlay
    GetFrameNameFromScreen = "fra_Inlay"
  Case eDPCScreen.psCoating
    GetFrameNameFromScreen = "fra_Coating"
  Case eDPCScreen.psVentilation
    GetFrameNameFromScreen = "fra_Ventilation"
  Case eDPCScreen.psLoudspeaker
    GetFrameNameFromScreen = "fra_Loudspeaker"
  Case eDPCScreen.psCutout
    GetFrameNameFromScreen = "fra_Cutout"
  Case eDPCScreen.psBending
    GetFrameNameFromScreen = "fra_Bending"
  Case eDPCScreen.psOption
    GetFrameNameFromScreen = "fra_OptSurcharge"
  Case eDPCScreen.psPanelShape
    GetFrameNameFromScreen = "fra_Shape"
  Case Else
    Err.Raise ArmErr.InvalidArgument, "ae_Screen", "Unkown screen: " & ae_Screen
  End Select
  Exit Function
ErrHandler:
  Call ErrorHandler("GetFrameNameFromScreen")
End Function

Private Function GetScreenFromFrameName(ByVal as_FrameName As String) As eDPCScreen
On Error GoTo ErrHandler

  Select Case as_FrameName
  Case "fra_Summary"
    GetScreenFromFrameName = eDPCScreen.psPanelSummary
  Case "fra_Panel"
    GetScreenFromFrameName = eDPCScreen.psPanel
  Case "fra_Perforation"
    GetScreenFromFrameName = eDPCScreen.psPerforation
  Case "fra_Gasket"
    GetScreenFromFrameName = eDPCScreen.psGasket
  Case "fra_Packing"
    GetScreenFromFrameName = eDPCScreen.psPacking
  Case "fra_Inlay"
    GetScreenFromFrameName = eDPCScreen.psInlay
  Case "fra_Coating"
    GetScreenFromFrameName = eDPCScreen.psCoating
  Case "fra_Ventilation"
    GetScreenFromFrameName = eDPCScreen.psVentilation
  Case "fra_Loudspeaker"
    GetScreenFromFrameName = eDPCScreen.psLoudspeaker
  Case "fra_Cutout"
    GetScreenFromFrameName = eDPCScreen.psCutout
  Case "fra_Bending"
    GetScreenFromFrameName = eDPCScreen.psBending
  Case "fra_OptSurcharge"
    GetScreenFromFrameName = eDPCScreen.psOption
  Case "fra_Shape"
    GetScreenFromFrameName = eDPCScreen.psPanelShape
  Case Else
    Err.Raise ArmErr.InvalidArgument, "as_FrameName", "Unkown frame name: " & as_FrameName
  End Select
  Exit Function
ErrHandler:
  Call ErrorHandler("GetScreenFromFrameName")
End Function

Private Sub EnableNavigation(ByVal ab_Enable As Boolean)
On Error GoTo ErrHandler

  btn_Back.Enabled = (tbs_Step.SelectedItem.Index > 1) And ab_Enable
  btn_Next.Enabled = (tbs_Step.SelectedItem.Index < tbs_Step.Tabs.Count) And ab_Enable
  btn_Default.Enabled = (tbs_Step.SelectedItem.Index < tbs_Step.Tabs.Count) And (Not IsStandard) And (Not IsTemplate) And (me_PrdScreen = eDPCScreenMode.smAdd) And ab_Enable
  btn_Validate.Enabled = ((tbs_Step.SelectedItem.Index = tbs_Step.Tabs.Count) Or IsStandard) And ab_Enable
  btn_Quit.Enabled = ab_Enable
  btn_Image.Enabled = ab_Enable
  btn_Error.Enabled = ab_Enable
  tbs_Step.Enabled = ab_Enable
  Exit Sub
ErrHandler:
  Call ErrorHandler("EnableNavigation")
End Sub

Private Sub EnableInlayNavigation(ByVal ab_Enable As Boolean)
On Error GoTo ErrHandler

  fra_Inlay.Visible = Not ab_Enable
  tlb_InlayMain.Enabled = ab_Enable
  tlb_InlayDetail.Enabled = Not ab_Enable
  grd_Inlay.Enabled = ab_Enable
  Exit Sub
ErrHandler:
  Call ErrorHandler("EnableInlayNavigation")
End Sub

Private Sub EnableCutoutNavigation(ByVal ab_Enable As Boolean, ByVal al_Index As Long)
On Error GoTo ErrHandler

  fra_Cutout(al_Index).Visible = Not ab_Enable
  tlb_CutoutMain(al_Index).Enabled = ab_Enable
  tlb_CutoutDetail(al_Index).Enabled = Not ab_Enable
  grd_Cutout(al_Index).Enabled = ab_Enable
  Exit Sub
ErrHandler:
  Call ErrorHandler("EnableCutoutNavigation")
End Sub

Private Sub InitStep()
On Error GoTo ErrHandler
  
Dim lo_Frame As VB.Frame
  
  If mo_PrdConfig.IsTemplate Then
    Call InitProductTemplate
  Else
    If mo_PrdConfig.IsStandard Then
      Call InitProductSKU
    Else
      Call InitProductCustom
    End If
  End If
    
  For Each lo_Frame In fra_Technical
    lo_Frame.Visible = IsProduction
  Next
  Call GotoStep(tbs_Step.Tabs(1).Key)
  Exit Sub
ErrHandler:
  Call ErrorHandler("InitStep")
End Sub

Private Sub GotoStep(ByVal as_TabKey As String)
On Error GoTo ErrHandler
Dim ll_Idx As Long
Dim lo_SelTab As MSComctlLib.Tab
Dim lo_HighTab As MSComctlLib.Tab

  Set lo_SelTab = GetTab(tbs_Step, as_TabKey)
  For Each lo_HighTab In tbs_Step.Tabs
    lo_HighTab.HighLighted = False
  Next
  lo_SelTab.HighLighted = True
  Set tbs_Step.SelectedItem = lo_SelTab
  Call tbs_Step.Refresh
  Call DisplayStep(tbs_Step.SelectedItem.Key)
  Call EnableNavigation(True)
  Exit Sub
ErrHandler:
  Call ErrorHandler("GotoStep")
End Sub

Private Sub SetStepDefaultValues()
On Error GoTo ErrHandler
   
  If IsStandard Then Exit Sub
  Call mo_PrdConfig.SetDefaultValues
  Call LoadPrice
  Exit Sub
ErrHandler:
  Call ErrorHandler("SetStepDefaultValues")
End Sub

Private Sub DefaultStep()
On Error GoTo ErrHandler

  If GetStepIndex = DPC_TAB_STEP_IDX_PANEL Then
    If Not CheckStep(eDPCScreen.psPanel) Then
      Exit Sub
    End If
  End If
  Call SetStepDefaultValues
  If CheckStep(eDPCScreen.psPanelSummary) Then
    Call mo_PrdConfig.CalcPositionPrice
    Call GotoStep(tbs_Step.Tabs(tbs_Step.Tabs.Count).Key)
  End If
  Exit Sub
ErrHandler:
  Call ErrorHandler("DefaultStep")
End Sub

Private Sub NextStep()
On Error GoTo ErrHandler

  If tbs_Step.SelectedItem.Index = tbs_Step.Tabs.Count Then
    Exit Sub
  End If
  Call GotoStep(tbs_Step.Tabs(tbs_Step.SelectedItem.Index + 1).Key)
  Exit Sub
ErrHandler:
  Call ErrorHandler("NextStep")
End Sub

Private Sub PreviousStep()
On Error GoTo ErrHandler

Dim ll_Idx As Long
Dim lo_Tab As MSComctlLib.Tab
Dim ll_NextIdx As Long

  If tbs_Step.SelectedItem.Index <= 1 Then
    Exit Sub
  End If
  Call GotoStep(tbs_Step.Tabs(tbs_Step.SelectedItem.Index - 1).Key)
  Exit Sub
ErrHandler:
  Call ErrorHandler("PreviousStep")
End Sub

'Private Sub RemoveStep(ByVal as_StepName As String)
'On Error GoTo ErrHandler
'
'Dim ll_Idx As Long
'Dim lo_Tab As MSComctlLib.Tab
'
'  Set lo_Tab = GetTab(tbs_Step, as_StepName)
'  Call tbs_Step.Tabs.Remove(lo_Tab.Index)
'  Exit Sub
'ErrHandler:
'  Call ErrorHandler("RemoveStep")
'End Sub

Private Function GetStepIndex() As Long
On Error GoTo ErrHandler

Dim lo_Frame As VB.Frame

  Set lo_Frame = mo_Tools.GetControl(fra_Step, tbs_Step.SelectedItem.Key)
  If lo_Frame Is Nothing Then
    Err.Raise ArmErr.InvalidArgument, "as_StepName", "Invalid step: " & tbs_Step.SelectedItem.Key
  Else
    GetStepIndex = lo_Frame.Index
  End If
  Exit Function
ErrHandler:
  Call ErrorHandler("GetStepIndex")
End Function

Private Sub DisplayStep(ByVal as_StepName As String)
On Error GoTo ErrHandler

Dim lo_Frame As VB.Frame
Dim lo_Control As Object
Dim ll_SideIdx As Long

  Select Case StepName
  Case "fra_Panel"
    Call DisplayPanelData
    Call DisplayPerimeter
    Call DisplayPanelQtySize
    Call DisplayPanelMaterial
  Case "fra_Gasket"
    Call DisplayGasket
    Call DisplaySpacer
    
  Case "fra_Bending"
    For ll_SideIdx = eDPCSide.esSideC To eDPCSide.esSideF
      Call DisplayBendingSide(ll_SideIdx)
    Next
    Call DisplayBending
    
  Case "fra_Coating"
    Call LoadCoatingTreeview
    Call DisplayCoating
    
  Case "fra_Inlay"
    'Call LoadInlayTreeview
    Call SetInlayModeList
    Call DisplayInlay
    Call DisplayInlayGrid
    
  Case "fra_Perforation"
    Call LoadPerforationTreeview
    Call LoadCboPerfIcon
    Call DisplayTvwPerfIcon
    Call DisplayPerforation
    Call DisplayPerforationBorder
       
  Case "fra_Ventilation"
    Call DisplayVentilation
  Case "fra_Loudspeaker"
    Call DisplayLoudspeaker
  Case "ra_Cutout"
    Call DisplayCutout
  Case "fra_OptSurcharge"
    Call LoadOptSurcharge
    Call DisplayOptSurcharge
  Case "fra_Packing"
    Call DisplayPacking
    Call DisplayLabeling
    
  Case "fra_Summary"
    Call DisplaySummary
  End Select
  
  Call DisplayPrice
  
  For Each lo_Control In UserControl.Controls
    If TypeOf lo_Control Is Frame Then
      If (lo_Control.Container Is UserControl) And (Not lo_Control Is fra_PriceSummary) Then
          lo_Control.Visible = False
      End If
    End If
  Next
  
  Set lo_Frame = mo_Tools.GetControl(fra_Step, as_StepName)
  If lo_Frame Is Nothing Then
    Err.Raise ArmErr.CPTNotInitialized, "fra_Step", "Frame not found: " & as_StepName
  Else
    lo_Frame.Visible = True
  End If
  
  Call SetFrameFocus
  Exit Sub
ErrHandler:
  Call ErrorHandler("DisplayStep")
End Sub

Public Sub SetFrameFocus()
On Error GoTo ErrHandler

  Dim lo_Frame As VB.Frame
  
  If (mo_Tools Is Nothing) Then Exit Sub
  
  Set lo_Frame = mo_Tools.GetControl(fra_Step, StepName)

  Select Case UCase(lo_Frame.Tag)
  Case UCase("fra_Panel")
    If mo_PrdConfig.QtyType = eDPCQtyType.qtPCS Then
      Call mo_Tools.SetTextFocus(txt_Textbox, "PanelQtyPCS")
    Else
      Call mo_Tools.SetTextFocus(txt_Textbox, "PanelQtyM2")
    End If
  Case UCase("fra_Gasket")
  Case UCase("fra_Bending")
  Case UCase("fra_Coating")
  Case UCase("fra_Inlay")
  Case UCase("fra_Perforation")
  Case UCase("fra_Ventilation")
  Case UCase("fra_Loudspeaker")
  Case UCase("fra_Cutout")
  Case UCase("fra_Summary")
  End Select
  Exit Sub
ErrHandler:
  Call ErrorHandler("SetFrameFocus")
End Sub

Private Function GetFrame(ByVal as_Tag As String) As VB.Frame
On Error GoTo ErrHandler

Dim lo_Control As Object

  Set GetFrame = Nothing
  For Each lo_Control In UserControl.Controls
    If TypeOf lo_Control Is VB.Frame Then
      If StrComp(as_Tag, lo_Control.Tag, vbTextCompare) = 0 Then
        Set GetFrame = lo_Control
        Exit For
      End If
    End If
  Next
  Exit Function
ErrHandler:
  Call ErrorHandler("GetFrame")
End Function

Private Sub Resize()
On Error GoTo ErrHandler

Dim lo_Control As Control
Dim lo_Frame As VB.Frame

  Call tbs_Step.Move(0, 0, UserControl.Width)
  For Each lo_Control In fra_Step
    Call lo_Control.Move(0, tbs_Step.Height, UserControl.Width, UserControl.Height - (btn_Validate.Height + tbs_Step.Height + 100))
  Next
  
  fra_PriceSummary.Top = UserControl.Height - fra_PriceSummary.Height
  
  btn_Error.Top = UserControl.Height - btn_Error.Height
  btn_Image.Top = UserControl.Height - btn_Image.Height
  btn_Back.Top = UserControl.Height - btn_Back.Height
  btn_Next.Top = UserControl.Height - btn_Next.Height
  btn_Default.Top = UserControl.Height - btn_Default.Height
  btn_Validate.Top = UserControl.Height - btn_Validate.Height
  btn_Quit.Top = UserControl.Height - btn_Quit.Height
  
  Set lo_Frame = mo_Tools.GetControl(fra_Step, "fra_summary")
  Call tbs_Summary.Move(0, 0, lo_Frame.Width)
  
  Call fra_OptAttributes.Move(0, 0, lo_Frame.Width)
  Call tbs_Summary.Move(0, fra_OptAttributes.Height, lo_Frame.Width)
  Call fra_PanelSummary.Move(0, tbs_Summary.Top + tbs_Summary.Height, lo_Frame.Width, lo_Frame.Height - fra_OptAttributes.Height - tbs_Summary.Height)
  Call tbs_Summary_Click
  
  Call grd_Summary.Move(0, 200, fra_PanelSummary.Width, fra_PanelSummary.Height - 200)
  Exit Sub
ErrHandler:
  Call ErrorHandler("Resize")
End Sub

Private Sub chk_PerfBorder_Click(Index As Integer)
On Error GoTo ErrHandler
  
  If mb_InternalInit Then Exit Sub
  mb_InternalInit = True
  Call mo_Tools.LockScreen(Me, True)
  If chk_PerfBorder(Index).Value = vbUnchecked Then
    Call mo_PrdConfig.SetDefaultUnperforatedBorder(Index)
  Else
    Call mo_PrdConfig.SetDefaultOverperforatedBorder(Index)
  End If
  Call mo_PrdConfig.CalcPerfBorder
  Call DisplayPerforationBorder
  Call mo_Tools.LockScreen(Me, False)
  mb_InternalInit = False
  Exit Sub
ErrHandler:
  Call ErrorMessage("chk_PerfBorder_Click")
End Sub

Private Sub pct_Cutout_Click()
On Error GoTo ErrHandler
    
Dim lo_Frm As frmDPC_ImgSel
Dim ls_Request As String
    
  If mb_InternalInit Then Exit Sub
  mb_InternalInit = True
  Call mo_Tools.LockScreen(Me, True)
  Set lo_Frm = New frmDPC_ImgSel
  Load lo_Frm
  ls_Request = _
    "SELECT CUT.CUT_Id,PRDC.IMG_Id,PRD.PRD_Name,PRD.PRD_Desc " & _
    "FROM DPC_CutType CUT " & _
    "LEFT JOIN DPC_PrdCommon as PRDC ON (CUT.CUT_Id=PRDC.PRD_Id) " & _
    "LEFT JOIN DPC_PrdDesc as PRD ON (CUT.CUT_Id=PRD.PRD_Id AND PRD.Language_Code=$COF_Lang$) " & _
    "WHERE CUT.CUT_Type=$CUT_Type$ AND " & _
    "CUT.Drop_Flag='' " & _
    "ORDER BY CUT.CUT_Order"
    
  ls_Request = Replace(ls_Request, "$CUT_Type$", mo_Tools.SqlInt(eDPCCutoutType.eCutout), , , vbTextCompare)
  ls_Request = ReplaceCommonPlaceholders(ls_Request)
  lo_Frm.Request = ls_Request
  Set lo_Frm.Tools = mo_Tools
  Set lo_Frm.ArmDb = mo_Db
  Call lo_Frm.Load_A_COM
  
  Call mo_Tools.LockScreen(Me, False)
  Call mo_Tools.ShowModalForm(lo_Frm)
  Call mo_Tools.LockScreen(Me, True)
  
  If lo_Frm.Result Then
    Call FrameCutoutToCutout(mo_CurrentCutout)
    Call mo_CurrentCutout.LoadCutType(lo_Frm.SelectedId)
    Call DisplayCutoutFrame(mo_CurrentCutout)
  End If
  Call lo_Frm.Unload_A_COM
  Unload lo_Frm
  Call mo_Tools.LockScreen(Me, False)
  mb_InternalInit = False
  Exit Sub
ErrHandler:
  Call ErrorMessage("pct_Cutout_Click")
End Sub

Private Sub pct_LoudPerforation_Click()
On Error GoTo ErrHandler
    
Dim lo_Frm As frmDPC_ImgSel
Dim lc_Cursor As Long
Dim ld_AreaLength As Double
Dim ld_AreaWidth As Double
Dim ls_Perf As String
Dim ls_Request As String
    
  If mb_InternalInit Then Exit Sub
  mb_InternalInit = True
  Call mo_Tools.LockScreen(Me, True)
  Set lo_Frm = New frmDPC_ImgSel
  
  Load lo_Frm
  ls_Request = _
    "SELECT CUT.CUT_Id,PRDC.IMG_Id,PRD.PRD_Name,PRD.PRD_Desc " & _
    "FROM DPC_CutType CUT " & _
    "LEFT JOIN DPC_PrdCommon as PRDC ON (CUT.CUT_Id=PRDC.PRD_Id) " & _
    "LEFT JOIN DPC_PrdDesc as PRD ON (CUT.CUT_Id=PRD.PRD_Id AND PRD.Language_Code=$COF_Lang$) " & _
    "LEFT JOIN DPC_Perforation PRF ON (CUT.PRF_Id=PRF.PRF_Id) " & _
    "LEFT JOIN DPC_PrdDesc as PRDF ON (CUT.PRF_Id=PRDF.PRD_Id AND PRDF.Language_Code=$COF_Lang$) " & _
    "WHERE CUT.CUT_Type=$CUT_Type$ AND " & _
    "CUT.Drop_Flag='' " & _
    "ORDER BY CUT.CUT_Order"
  
  ls_Request = Replace(ls_Request, "$CUT_Type$", mo_Tools.SqlInt(eDPCCutoutType.eLoudspeaker), , , vbTextCompare)
  ls_Request = ReplaceCommonPlaceholders(ls_Request)
  lo_Frm.Request = ls_Request
  
  Set lo_Frm.Tools = mo_Tools
  Set lo_Frm.ArmDb = mo_Db
  Call lo_Frm.Load_A_COM
  
  Call mo_Tools.LockScreen(Me, False)
  Call mo_Tools.ShowModalForm(lo_Frm)
  Call mo_Tools.LockScreen(Me, True)
  
  If lo_Frm.Result Then
    Call FrameLoudToCutout(mo_CurrentCutout)
    Call mo_CurrentCutout.LoadCutType(lo_Frm.SelectedId)
    Call DisplayLoudFrame(mo_CurrentCutout)
  End If
  Call lo_Frm.Unload_A_COM
  Unload lo_Frm
  Call mo_Tools.LockScreen(Me, False)
  mb_InternalInit = False
  Exit Sub
ErrHandler:
  Call ErrorMessage("pct_LoudPerforation_Click")
End Sub

Private Sub pct_VentType_Click()
On Error GoTo ErrHandler
    
Dim lo_Frm As frmDPC_ImgSel
Dim ls_Request As String

  If mb_InternalInit Then Exit Sub
  mb_InternalInit = True
  Call mo_Tools.LockScreen(Me, True)
  Set lo_Frm = New frmDPC_ImgSel
  
  Load lo_Frm
  
  ls_Request = _
    "SELECT CUT.CUT_Id,PRDC.IMG_Id,PRD.PRD_Name,PRD.PRD_Desc " & _
    "FROM DPC_CutType CUT " & _
    "LEFT JOIN DPC_PrdCommon as PRDC ON (CUT.CUT_Id=PRDC.PRD_Id) " & _
    "LEFT JOIN DPC_PrdDesc as PRD ON (CUT.CUT_Id=PRD.PRD_Id AND PRD.Language_Code=$COF_Lang$) " & _
    "LEFT JOIN DPC_Perforation PRF ON (CUT.PRF_Id=PRF.PRF_Id) " & _
    "LEFT JOIN DPC_PrdDesc as PRDF ON (CUT.PRF_Id=PRDF.PRD_Id AND PRDF.Language_Code=$COF_Lang$) " & _
    "WHERE CUT.CUT_Type=$CUT_Type$ AND " & _
    "CUT.Drop_Flag='' " & _
    "ORDER BY CUT.CUT_Order"
  
  ls_Request = Replace(ls_Request, "$CUT_Type$", mo_Tools.SqlInt(eDPCCutoutType.eVentilation), , , vbTextCompare)
  ls_Request = ReplaceCommonPlaceholders(ls_Request)
  lo_Frm.Request = ls_Request
  
  Set lo_Frm.Tools = mo_Tools
  Set lo_Frm.ArmDb = mo_Db
  Call lo_Frm.Load_A_COM
  
  Call mo_Tools.LockScreen(Me, False)
  Call mo_Tools.ShowModalForm(lo_Frm)
  Call mo_Tools.LockScreen(Me, True)
  
  If lo_Frm.Result Then
    Call FrameVentToCutout(mo_CurrentCutout)
    Call mo_CurrentCutout.LoadCutType(lo_Frm.SelectedId)
    Call DisplayVentFrame(mo_CurrentCutout)
  End If
  Call lo_Frm.Unload_A_COM
  Unload lo_Frm
  Call mo_Tools.LockScreen(Me, False)
  mb_InternalInit = False
  Exit Sub
ErrHandler:
  Call ErrorMessage("pct_VentType_Click")
End Sub

Private Sub pct_Bending_Click(Index As Integer)
On Error GoTo ErrHandler
    
Dim lo_Frm As frmDPC_ImgSel
Dim ls_Request As String
Dim ls_Field As String
    
  If mb_InternalInit Then Exit Sub
  mb_InternalInit = True
  Call mo_Tools.LockScreen(Me, True)
  ls_Field = GetIMG_IdBNDField(Index)
  Set lo_Frm = New frmDPC_ImgSel
  
  Load lo_Frm
  ls_Request = "SELECT BND.BND_Id,BND." & ls_Field & ",PRD.PRD_Name,PRD.PRD_Desc " & _
  "FROM DPC_Bending BND " & _
  "INNER JOIN DPC_PrdDesc PRD ON (BND.BND_Id=PRD.PRD_Id AND PRD.Language_Code=$COF_Lang$) " & _
  "WHERE BND.BND_IsShr=$BND_IsShr$ AND BND.Drop_Flag='' ORDER BY BND.BND_Order"
  Select Case Index
  Case eDPCSide.esSideC, eDPCSide.esSideD
    ls_Request = Replace(ls_Request, "$BND_IsShr$", mo_Tools.SQLStr(""), , , vbTextCompare)
  Case eDPCSide.esSideE, eDPCSide.esSideF
    ls_Request = Replace(ls_Request, "$BND_IsShr$", mo_Tools.SQLStr("X"), , , vbTextCompare)
  End Select
  ls_Request = ReplaceCommonPlaceholders(ls_Request)
  lo_Frm.Request = ls_Request
  
  Set lo_Frm.Tools = mo_Tools
  Set lo_Frm.ArmDb = mo_Db
  lo_Frm.Language_Code = Language_Code
  Call lo_Frm.Load_A_COM
  
  Call mo_Tools.LockScreen(Me, False)
  Call mo_Tools.ShowModalForm(lo_Frm)
  Call mo_Tools.LockScreen(Me, True)
  
  If lo_Frm.Result Then
    Call mo_PrdConfig.LoadBending(Index, lo_Frm.SelectedId)
    Call mo_PrdConfig.SetStandardPanelUZS(Index)
    If (Index = eDPCSide.esSideC) Or (Index = eDPCSide.esSideD) Then
      Call mo_PrdConfig.LoadThicknessHeight(True, False, False)
    Else
      Call mo_PrdConfig.LoadThicknessHeight(False, True, False)
    End If
    Call DisplayBendingSide(Index)
    Call DisplayBending
  End If
  Call lo_Frm.Unload_A_COM
  Unload lo_Frm
  Call mo_Tools.LockScreen(Me, False)
  mb_InternalInit = False
  Exit Sub
ErrHandler:
  Call ErrorMessage("pct_Bending_Click")
End Sub

Private Sub tbs_Step_Click()
On Error GoTo ErrHandler
  
  If mb_InternalInit Then Exit Sub
  mb_InternalInit = True
  Call mo_Tools.LockScreen(Me, True)
  Call DisplayStep(tbs_Step.SelectedItem.Key)
  Call mo_Tools.LockScreen(Me, False)
  mb_InternalInit = False
  Exit Sub
ErrHandler:
  mb_InternalInit = False
  Call ErrorMessage("tbs_Step_Click")
End Sub

Private Sub tbs_Summary_Click()
On Error GoTo ErrHandler
  
  If mb_InternalInit Then Exit Sub
  mb_InternalInit = True
  Call mo_Tools.LockScreen(Me, True)
  Call DisplaySummary
  Call mo_Tools.LockScreen(Me, False)
  mb_InternalInit = False
  Exit Sub
ErrHandler:
  Call ErrorMessage("tbs_Summary_Click")
End Sub

Private Sub tvw_Perforation_TreeNodesLoaded(ByVal LoadType As TreeLoadType, ByVal NodeInfo As NodeInfo, ByVal Level As Long, Request As Variant)
On Error GoTo ErrHandler

  If mb_InternalInit Then Exit Sub
  mb_InternalInit = True
  Call mo_Tools.LockScreen(Me, True)
  Call DisplayTvwPerfIcon
  Call mo_Tools.LockScreen(Me, False)
  mb_InternalInit = False
  Exit Sub
ErrHandler:
  Call ErrorMessage("tvw_Perforation_TreeNodesLoaded")
End Sub

Private Sub txt_Price_GotFocus(Index As Integer)
On Error GoTo ErrHandler
  
  mb_CurrentTextBoxChanged = False
  Exit Sub
ErrHandler:
  Call ErrorMessage("txt_Price_GotFocus")
End Sub

Private Sub txt_Price_Change(Index As Integer)
On Error GoTo ErrHandler
  
  If mb_InternalInit Then Exit Sub
  mb_CurrentTextBoxChanged = True
  Exit Sub
ErrHandler:
  Call ErrorMessage("txt_Price_Change")
End Sub

Private Sub txt_Tech_GotFocus(Index As Integer)
On Error GoTo ErrHandler
  
  mb_CurrentTextBoxChanged = False
  txt_Tech(Index).SelStart = 0
  txt_Tech(Index).SelLength = Len(txt_Tech(Index).Text)
  Exit Sub
ErrHandler:
  Call ErrorMessage("txt_Tech_GotFocus")
End Sub

Private Sub txt_TextBox_GotFocus(Index As Integer)
On Error GoTo ErrHandler
  
  mb_CurrentTextBoxChanged = False
  txt_Textbox(Index).SelStart = 0
  txt_Textbox(Index).SelLength = Len(txt_Textbox(Index).Text)
  Exit Sub
ErrHandler:
  Call ErrorMessage("txt_TextBox_GotFocus")
End Sub

Private Sub txt_Tech_Validate(Index As Integer, Cancel As Boolean)
On Error GoTo ErrHandler

Dim ll_SideIdx As Long

  If mb_InternalInit Then Exit Sub
  If Not mb_CurrentTextBoxChanged Then Exit Sub
  mb_InternalInit = True
  Call mo_Tools.LockScreen(Me, True)
  ll_SideIdx = GetSideIndex(right(txt_Tech(Index).Tag, 1))
  Select Case txt_Tech(Index).Tag
  Case "RPL_CoWMin"
    mo_PrdConfig.RPL_CoWMin = mo_Tools.ScreenToDbl(txt_Tech(Index).Text)
  Case "RPL_CoWMax"
    mo_PrdConfig.RPL_CoWMax = mo_Tools.ScreenToDbl(txt_Tech(Index).Text)
  Case "RPL_CoilW"
    mo_PrdConfig.RPL_CoilW = mo_Tools.ScreenToDbl(txt_Tech(Index).Text)
  Case "RPL_CutA"
    mo_PrdConfig.RPL_CutA = mo_Tools.ScreenToDbl(txt_Tech(Index).Text)
  Case "RPL_CutB"
    mo_PrdConfig.RPL_CutB = mo_Tools.ScreenToDbl(txt_Tech(Index).Text)
  Case Else
    Err.Raise 0, "txt_Tech(" & Index & ").Tag", "Unknown textbox tag:" & txt_Tech(Index).Tag
  End Select
  Call mo_Tools.LockScreen(Me, False)
  mb_CurrentTextBoxChanged = False
  mb_InternalInit = False
  Exit Sub
ErrHandler:
  Call ErrorMessage("txt_Tech_Validate " & txt_Tech(Index).Tag & ":" & txt_Tech(Index).Text)
End Sub

Private Sub txt_Textbox_Change(Index As Integer)
On Error GoTo ErrHandler
  
  If mb_InternalInit Then Exit Sub
  mb_CurrentTextBoxChanged = True
  Exit Sub
ErrHandler:
  Call ErrorMessage("txt_TextBox_Change")
End Sub

Private Sub txt_Tech_Change(Index As Integer)
On Error GoTo ErrHandler
  
  If mb_InternalInit Then Exit Sub
  mb_CurrentTextBoxChanged = True
  Exit Sub
ErrHandler:
  Call ErrorMessage("txt_Tech_Change")
End Sub

Private Sub txt_Textbox_Validate(Index As Integer, Cancel As Boolean)
On Error GoTo ErrHandler

Dim ll_SideIdx As Long

  If mb_InternalInit Then Exit Sub
  If Not mb_CurrentTextBoxChanged Then Exit Sub
  mb_InternalInit = True
  Call mo_Tools.LockScreen(Me, True)
  ll_SideIdx = GetSideIndex(right(txt_Textbox(Index).Tag, 1))
  Select Case txt_Textbox(Index).Tag
  Case "PRD_Name"
    mo_PrdConfig.PRD_Name = Trim(txt_Textbox(Index).Text)
  Case "PRD_Code"
    mo_PrdConfig.PRD_Code = Trim(txt_Textbox(Index).Text)
    mo_PrdConfig.PRD_CodeAMC = mo_PrdConfig.PRD_Code
  Case "BI_SAP_Code"
    mo_PrdConfig.BI_SAP_Code = Trim(txt_Textbox(Index).Text)
  Case "PanelQtyM2"
    mo_PrdConfig.PanelQtyM2 = mo_Tools.ScreenToDbl(txt_Textbox(Index).Text, 4)
    If IsStandard And (Not mo_PrdConfig.IsQtyMatchingPU) Then
      If mo_Tools.ShowMsg(mo_Db, ms_Language_Code, 9733, "#Panel quantity does not represent correct packing unit. Do you want to update quantity automatically ?", , vbYesNo) = vbYes Then
        mo_PrdConfig.PanelQtyM2 = mo_PrdConfig.GetCorrectPUQtyForM2
      End If
    End If
    Call LoadPrice
    Call grd_Coating.ClearGrid
    Call DisplayPanelQtySize
  Case "PanelQtyPCS"
    mo_PrdConfig.PanelQtyPCS = mo_Tools.ScreenToDbl(txt_Textbox(Index).Text)
    If IsStandard And (Not mo_PrdConfig.IsQtyMatchingPU) Then
      If mo_Tools.ShowMsg(mo_Db, ms_Language_Code, 9733, "#Panel quantity does not represent correct packing unit. Do you want to update quantity automatically ?", , vbYesNo) = vbYes Then
        mo_PrdConfig.PanelQtyPCS = mo_PrdConfig.GetCorrectPUQtyForPCS
      End If
    End If
    Call LoadPrice
    Call grd_Coating.ClearGrid
    Call DisplayPanelQtySize
  Case "PRD_OfferComment"
    Call mo_PrdConfig.SetErrorText(eDPCError.erOfferComment, txt_Textbox(Index).Text, Nothing)
  Case "PRD_InternalComment"
    Call mo_PrdConfig.SetErrorText(eDPCError.erInternalComment, txt_Textbox(Index).Text, Nothing)
  Case "PanelQtyPU"
  Case "RPL_PU"
    mo_PrdConfig.RPL_PU = mo_Tools.ScreenToLong(txt_Textbox(Index).Text)
  Case "RPL_CorG1"
    'mo_PrdConfig.RPL_CorG1 = mo_Tools.ScreenToDbl(txt_TextBox(Index).Text)
  Case "RPL_CorG2"
    'mo_PrdConfig.RPL_CorG2 = mo_Tools.ScreenToDbl(txt_TextBox(Index).Text)
  Case "RPL_PanA"
    mo_PrdConfig.RPL_PanA = mo_Tools.ScreenToDbl(txt_Textbox(Index).Text)
    Call DisplayPanelQtySize
  Case "RPL_PanB"
    mo_PrdConfig.RPL_PanB = mo_Tools.ScreenToDbl(txt_Textbox(Index).Text)
    Call DisplayPanelQtySize
  Case "RPL_ModA"
    mo_PrdConfig.RPL_ModA = mo_Tools.ScreenToDbl(txt_Textbox(Index).Text)
    Call LoadStandardMaterial
    'Call mo_PrdConfig.CalculateCoWMinMax
    'Call mo_PrdConfig.CalculateCutAB
    Call LoadPrice
    Call DisplayPanelMaterial
    Call DisplayPanelQtySize
  Case "RPL_ModB"
    mo_PrdConfig.RPL_ModB = mo_Tools.ScreenToDbl(txt_Textbox(Index).Text)
    Call LoadStandardMaterial
    'Call mo_PrdConfig.CalculateCoWMinMax
    'Call mo_PrdConfig.CalculateCutAB
    Call LoadPrice
    Call DisplayPanelMaterial
    Call DisplayPanelQtySize
  Case "RPL_GapC", "RPL_GapD", "RPL_GapE", "RPL_GapF"
    mo_PrdConfig.RPL_Gap(ll_SideIdx) = mo_Tools.ScreenToDbl(txt_Textbox(Index).Text)
    Call mo_Tools.SetTextBox(txt_Textbox, "RPL_Gap" & mv_Edge(ll_SideIdx) & "_", mo_Tools.DblToScreen(mo_PrdConfig.RPL_Gap(ll_SideIdx)), False)
    Call LoadStandardMaterial
    'Call mo_PrdConfig.CalculateCoWMinMax
    'Call mo_PrdConfig.CalculateCutAB
    Call LoadPrice
    Call DisplayPanelMaterial
    Call DisplayPanelQtySize
  Case "PCT_SizeD_V", "PCT_SizeJ_V", "PCT_SizeK_V", "PCT_SizeL_V", "PCT_SizeM_V"
    Call FrameVentToCutout(mo_CurrentCutout)
    Call LoadVentPrice(mo_CurrentCutout)
  Case "PCT_SizeD_L", "PCT_SizeJ_L", "PCT_SizeK_L", "PCT_SizeL_L", "PCT_SizeM_L"
    Call FrameLoudToCutout(mo_CurrentCutout)
    Call LoadLoudPrice(mo_CurrentCutout)
  Case "PCT_SizeD_C", "PCT_SizeJ_C", "PCT_SizeK_C", "PCT_SizeL_C", "PCT_SizeM_C"
    Call FrameCutoutToCutout(mo_CurrentCutout)
    Call LoadCutoutPrice(mo_CurrentCutout)
  Case "RPL_UBoWC", "RPL_UBoWD", "RPL_UBoWE", "RPL_UBoWF"
    mo_PrdConfig.RPL_UBoW(ll_SideIdx) = mo_Tools.ScreenToDbl(txt_Textbox(Index).Text)
    Call mo_PrdConfig.CalcPerfBorder
    Call DisplayPerforationBorder
  Case "RPL_UBorC", "RPL_UBorD", "RPL_UBorE", "RPL_UBorF"
  Case "PCT_UBoWC_V", "PCT_UBoWD_V", "PCT_UBoWE_V", "PCT_UBoWF_V"
  Case "PCT_UBoWC_L", "PCT_UBoWD_L", "PCT_UBoWE_L", "PCT_UBoWF_L"
  Case "PCT_UBoWC_C", "PCT_UBoWD_C", "PCT_UBoWE_C", "PCT_UBoWF_C"
  Case "PCT_UBorC_V", "PCT_UBorD_V", "PCT_UBorE_V", "PCT_UBorF_V"
  Case "PCT_UBorC_L", "PCT_UBorD_L", "PCT_UBorE_L", "PCT_UBorF_L"
  Case "PCT_UBorC_C", "PCT_UBorD_C", "PCT_UBorE_C", "PCT_UBorF_C"
  Case "INL_SizeA", "INL_SizeB", "INL_Name", "INL_Desc", "INL_Code"
  Case "COA_Code"
    mo_PrdConfig.COA_Code = txt_Textbox(Index).Text
  Case "COA_Desc"
    Call mo_PrdConfig.SetErrorText(eDPCError.erCoatingDesc, txt_Textbox(Index).Text, Nothing)
    mo_PrdConfig.COA_Desc = txt_Textbox(Index).Text
  Case "COA_Name"
    Call mo_PrdConfig.SetErrorText(eDPCError.erCoatingName, txt_Textbox(Index).Text, Nothing)
    mo_PrdConfig.COA_Name = txt_Textbox(Index).Text
  Case "RPL_PlCnt"
    mo_PrdConfig.RPL_PlCnt = mo_Tools.ScreenToLong(txt_Textbox(Index).Text)
    Call DisplayInlay
  Case "RPL_SwGap"
    mo_PrdConfig.RPL_SwGap = mo_Tools.ScreenToDbl(txt_Textbox(Index).Text)
    Call DisplayPerimeter
'  Case "OFD_Pos"
'    OFD_Pos = mo_Tools.ScreenToDbl(txt_Textbox(Index).Text)
  Case "OFD_PosCus"
    mo_PrdConfig.OFD_PosCus = Trim(txt_Textbox(Index).Text)
  Case "RPL_HC", "RPL_HD", "RPL_HE", "RPL_HF"
    mo_PrdConfig.RPL_H(ll_SideIdx) = mo_Tools.ScreenToDbl(txt_Textbox(Index).Text)
    'Call mo_PrdConfig.CalculateCoWMinMax
    'Call mo_PrdConfig.CalculateCutAB
    Call DisplayBendingSide(ll_SideIdx)
    Call DisplayBending
  Case "RPL_UC", "RPL_UD", "RPL_UE", "RPL_UF"
    mo_PrdConfig.RPL_U(ll_SideIdx) = mo_Tools.ScreenToDbl(txt_Textbox(Index).Text)
    'Call mo_PrdConfig.CalculateCoWMinMax
    'Call mo_PrdConfig.CalculateCutAB
    Call DisplayBendingSide(ll_SideIdx)
    Call DisplayBending
  Case "RPL_UMinC", "RPL_UMinD"
    mo_PrdConfig.RPL_UMin(ll_SideIdx) = mo_Tools.ScreenToDbl(txt_Textbox(Index).Text)
    'Call mo_PrdConfig.CalculateCoWMinMax
    'Call mo_PrdConfig.CalculateCutAB
    Call DisplayBendingSide(ll_SideIdx)
    Call DisplayBending
  Case "RPL_UMaxC", "RPL_UMaxD"
    mo_PrdConfig.RPL_UMax(ll_SideIdx) = mo_Tools.ScreenToDbl(txt_Textbox(Index).Text)
    'Call mo_PrdConfig.CalculateCoWMinMax
    'Call mo_PrdConfig.CalculateCutAB
    Call DisplayBendingSide(ll_SideIdx)
    Call DisplayBending
  Case "RPL_SC", "RPL_SD", "RPL_SE", "RPL_SF"
    mo_PrdConfig.RPL_S(ll_SideIdx) = mo_Tools.ScreenToDbl(txt_Textbox(Index).Text)
    'Call mo_PrdConfig.CalculateCoWMinMax
    'Call mo_PrdConfig.CalculateCutAB
    Call DisplayBendingSide(ll_SideIdx)
    Call DisplayBending
'  Case "BOM_Pos"
'    mo_CurrentBOM.BOM_Pos = mo_Tools.ScreenToLong(txt_Textbox(Index).Text)
'  Case "BOM_Qty"
'    mo_CurrentBOM.BOM_Qty = mo_Tools.ScreenToDbl(txt_Textbox(Index).Text)
'  Case "BOM_Cost"
'    mo_CurrentBOM.BOM_Cost = mo_Tools.ScreenToDbl(txt_Textbox(Index).Text)
  Case "PIN_SizeA", "PIN_SizeB"
  Case "RPL_LabTxt"
    mo_PrdConfig.RPL_LabTxt = txt_Textbox(Index).Text
  Case "RPL_BaeType"
    mo_PrdConfig.RPL_BaeType = mo_Tools.ScreenToLong(txt_Textbox(Index).Text)
  Case Else
    Err.Raise 0, "txt_TextBox(" & Index & ").Tag", "Unknown textbox tag:" & txt_Textbox(Index).Tag
  End Select
  Call mo_Tools.LockScreen(Me, False)
  mb_CurrentTextBoxChanged = False
  mb_InternalInit = False
  Exit Sub
ErrHandler:
  Call ErrorMessage("txt_Textbox_Validate " & txt_Textbox(Index).Tag & ":" & txt_Textbox(Index).Text)
End Sub

Private Sub txt_Price_Validate(Index As Integer, Cancel As Boolean)
On Error GoTo ErrHandler

Dim lo_Offer As DPC_OfferPos

  If mb_InternalInit Then Exit Sub
  If Not mb_CurrentTextBoxChanged Then Exit Sub
  If StrComp("_A", right(txt_Price(Index).Tag, 2), vbTextCompare) = 0 Then Exit Sub
  
  mb_InternalInit = True
  Call mo_Tools.LockScreen(Me, True)
  
  Select Case UCase(txt_Price(Index).Tag)
  Case UCase("txt_PanelPriceM2_M")
    Set lo_Offer = mo_PrdConfig.GetOfferPos(eDPCOfferDetail.odPanelCost)
    Call lo_Offer.SetPrice(DPC_UOM_M2, mo_Tools.ScreenToDbl(txt_Price(Index).Text))
  Case UCase("txt_PanelPricePCS_M")
    Set lo_Offer = mo_PrdConfig.GetOfferPos(eDPCOfferDetail.odPanelCost)
    Call lo_Offer.SetPrice(DPC_UOM_PCS, mo_Tools.ScreenToDbl(txt_Price(Index).Text))
  Case UCase("txt_PanelSetupChargeUNP_M")
    Set lo_Offer = mo_PrdConfig.GetOfferPos(eDPCOfferDetail.odPanelSetupChargeUnp)
    lo_Offer.OFD_Price = mo_Tools.ScreenToDbl(txt_Price(Index).Text)
  Case UCase("txt_PanelSetupChargePRF_M")
    Set lo_Offer = mo_PrdConfig.GetOfferPos(eDPCOfferDetail.odPanelSetupChargePrf)
    lo_Offer.OFD_Price = mo_Tools.ScreenToDbl(txt_Price(Index).Text)
  Case UCase("txt_PanelChangeAUNP_M")
    Set lo_Offer = mo_PrdConfig.GetOfferPos(eDPCOfferDetail.odPanelChangeLengthCostUnp)
    lo_Offer.OFD_Price = mo_Tools.ScreenToDbl(txt_Price(Index).Text)
  Case UCase("txt_PanelChangeAPRF_M")
    Set lo_Offer = mo_PrdConfig.GetOfferPos(eDPCOfferDetail.odPanelChangeLengthCostPrf)
    lo_Offer.OFD_Price = mo_Tools.ScreenToDbl(txt_Price(Index).Text)
  Case UCase("txt_PanelChangeBUNP_M")
    Set lo_Offer = mo_PrdConfig.GetOfferPos(eDPCOfferDetail.odPanelChangeWidthCostUnp)
    lo_Offer.OFD_Price = mo_Tools.ScreenToDbl(txt_Price(Index).Text)
  Case UCase("txt_PanelChangeBPRF_M")
    Set lo_Offer = mo_PrdConfig.GetOfferPos(eDPCOfferDetail.odPanelChangeWidthCostPrf)
    lo_Offer.OFD_Price = mo_Tools.ScreenToDbl(txt_Price(Index).Text)
  Case UCase("txt_GasketSurcharge_M")
    Set lo_Offer = mo_PrdConfig.GetOfferPos(eDPCOfferDetail.odGasketSurcharge)
    lo_Offer.OFD_Price = mo_Tools.ScreenToDbl(txt_Price(Index).Text)
  Case UCase("txt_GasketSurcharge2_M")
    Set lo_Offer = mo_PrdConfig.GetOfferPos(eDPCOfferDetail.odSpacerSurcharge)
    lo_Offer.OFD_Price = mo_Tools.ScreenToDbl(txt_Price(Index).Text)
  Case UCase("txt_CoatingPrice_M")
    Set lo_Offer = mo_PrdConfig.GetOfferPos(eDPCOfferDetail.odCoatingCost)
    lo_Offer.OFD_Price = mo_Tools.ScreenToDbl(txt_Price(Index).Text)
  Case UCase("txt_CoatingSetupCharge_M")
    Set lo_Offer = mo_PrdConfig.GetOfferPos(eDPCOfferDetail.odCoatingSetupCharge)
    lo_Offer.OFD_Price = mo_Tools.ScreenToDbl(txt_Price(Index).Text)
  Case UCase("txt_PerfPrice_M")
    Set lo_Offer = mo_PrdConfig.GetOfferPos(eDPCOfferDetail.odPerforationCost)
    lo_Offer.OFD_Price = mo_Tools.ScreenToDbl(txt_Price(Index).Text)
  Case UCase("txt_InlayPrice_M")
    Set lo_Offer = mo_CurrentInlay.GetOfferPos(eDPCOfferDetail.odInlayCost)
    lo_Offer.OFD_Price = mo_Tools.ScreenToDbl(txt_Price(Index).Text)
  Case UCase("txt_InlaySetupCharge_M")
    Set lo_Offer = mo_CurrentInlay.GetOfferPos(eDPCOfferDetail.odInlaySetupCharge)
    lo_Offer.OFD_Price = mo_Tools.ScreenToDbl(txt_Price(Index).Text)
  Case UCase("txt_VentPrice_M")
    Set lo_Offer = mo_CurrentCutout.GetOfferPos(eDPCOfferDetail.odVentilationCost)
    lo_Offer.OFD_Price = mo_Tools.ScreenToDbl(txt_Price(Index).Text)
  Case UCase("txt_VentSetupCharge_M")
    Set lo_Offer = mo_CurrentCutout.GetOfferPos(eDPCOfferDetail.odVentilationSetupCharge)
    lo_Offer.OFD_Price = mo_Tools.ScreenToDbl(txt_Price(Index).Text)
  Case UCase("txt_VentAddChange_M")
    Set lo_Offer = mo_CurrentCutout.GetOfferPos(eDPCOfferDetail.odVentilationAddChangeCost)
    lo_Offer.OFD_Price = mo_Tools.ScreenToDbl(txt_Price(Index).Text)
  Case UCase("txt_LoudPrice_M")
    Set lo_Offer = mo_CurrentCutout.GetOfferPos(eDPCOfferDetail.odLoudspeakerCost)
    lo_Offer.OFD_Price = mo_Tools.ScreenToDbl(txt_Price(Index).Text)
  Case UCase("txt_LoudSetupCharge_M")
    Set lo_Offer = mo_CurrentCutout.GetOfferPos(eDPCOfferDetail.odLoudspeakerSetupCharge)
    lo_Offer.OFD_Price = mo_Tools.ScreenToDbl(txt_Price(Index).Text)
  Case UCase("txt_LoudAddChange_M")
    Set lo_Offer = mo_CurrentCutout.GetOfferPos(eDPCOfferDetail.odLoudspeakerAddChangeCost)
    lo_Offer.OFD_Price = mo_Tools.ScreenToDbl(txt_Price(Index).Text)
  Case UCase("txt_CutoutPrice_M")
    Set lo_Offer = mo_CurrentCutout.GetOfferPos(eDPCOfferDetail.odCutoutCost)
    lo_Offer.OFD_Price = mo_Tools.ScreenToDbl(txt_Price(Index).Text)
  Case UCase("txt_CutoutSetupCharge_M")
    Set lo_Offer = mo_CurrentCutout.GetOfferPos(eDPCOfferDetail.odCutoutSetupCharge)
    lo_Offer.OFD_Price = mo_Tools.ScreenToDbl(txt_Price(Index).Text)
  Case UCase("txt_CutoutAddChange_M")
    Set lo_Offer = mo_CurrentCutout.GetOfferPos(eDPCOfferDetail.odCutoutAddChangeCost)
    lo_Offer.OFD_Price = mo_Tools.ScreenToDbl(txt_Price(Index).Text)
  Case UCase("txt_CutoutSurcharge_M")
    Set lo_Offer = mo_CurrentCutout.GetOfferPos(eDPCOfferDetail.odCutoutSurcharge)
    lo_Offer.OFD_Price = mo_Tools.ScreenToDbl(txt_Price(Index).Text)
  Case UCase("txt_PackingPrice_M")
    Set lo_Offer = mo_CurrentCutout.GetOfferPos(eDPCOfferDetail.odPackingCost)
    lo_Offer.OFD_Price = mo_Tools.ScreenToDbl(txt_Price(Index).Text)
  Case UCase("txt_LabelingPrice_M")
    Set lo_Offer = mo_CurrentCutout.GetOfferPos(eDPCOfferDetail.odLabelingCost)
    lo_Offer.OFD_Price = mo_Tools.ScreenToDbl(txt_Price(Index).Text)
  Case Else
    Err.Raise 0, "txt_Price(" & Index & ").Tag", "Unknown price textbox tag:" & txt_Price(Index).Tag
  End Select
  
  Call mo_PrdConfig.CalcPositionPrice
  Call DisplayPrice
  Call mo_Tools.LockScreen(Me, False)
  mb_CurrentTextBoxChanged = False
  mb_InternalInit = False
  Exit Sub
ErrHandler:
  Call ErrorMessage("txt_Price_LostFocus")
End Sub

Private Function GetSideIndex(ByVal as_Side As String) As eDPCSide
On Error GoTo ErrHandler

  Dim le_SideIdx As eDPCSide
  
  GetSideIndex = -1
  For le_SideIdx = eDPCSide.esSideC To eDPCSide.esSideF
    If StrComp(as_Side, mv_Edge(le_SideIdx), vbTextCompare) = 0 Then
      GetSideIndex = le_SideIdx
      Exit For
    End If
  Next
  Exit Function
ErrHandler:
  Call ErrorHandler("GetSideIndex")
End Function

Private Sub LoadStandardMaterial()
On Error GoTo ErrHandler
  
  If IsTemplate Then Exit Sub
  If IsStandard Then Exit Sub
  
  If mo_PrdConfig.RPL_StdMa Then
    If mo_PrdTemp Is Nothing Then
      Call mo_PrdConfig.LoadMaterial(Val(mo_Tools.GetAConfigData("DPC_Default_MAT1")))
    Else
      Call mo_PrdConfig.LoadMaterial(mo_PrdTemp.MAT_Id)
    End If
    Call mo_PrdConfig.LoadThicknessHeight(True, False, True)
  End If
  Exit Sub
ErrHandler:
  Call ErrorHandler("LoadStandardMaterial")
End Sub

Private Sub DisplayPanelQtySize()
On Error GoTo ErrHandler

Dim ll_SideIdx As Long
Dim ls_Value As String

  If mo_PrdConfig.QtyType = eDPCQtyType.qtM2 Then
    opt_QtyType(0).Value = True
  ElseIf mo_PrdConfig.QtyType = eDPCQtyType.qtPCS Then
    opt_QtyType(1).Value = True
  End If
  
  Call mo_Tools.SetTextBox(txt_Textbox, "PanelQtyM2", mo_Tools.DblToScreen(mo_PrdConfig.PanelQtyM2), Not (mo_PrdConfig.QtyType = eDPCQtyType.qtPCS), Not IsTemplate)
  Call mo_Tools.SetTextBox(txt_Textbox, "PanelQtyPCS", mo_Tools.LongToScreen(mo_PrdConfig.PanelQtyPCS), Not (mo_PrdConfig.QtyType = eDPCQtyType.qtM2), Not IsTemplate)
  Call mo_Tools.SetTextBox(txt_Textbox, "PanelQtyPU", mo_Tools.LongToScreen(mo_PrdConfig.PanelQtyPU), False, Not IsTemplate)
  
  Call mo_Tools.SetTextBox(txt_Textbox, "RPL_PU", mo_Tools.LongToScreen(mo_PrdConfig.RPL_PU), IsTemplate)
  
  Call mo_Tools.SetTextBox(txt_Textbox, "RPL_ModA", mo_Tools.DblToScreen(mo_PrdConfig.RPL_ModA), (Not IsStandard) And (mo_PrdTemp.RPL_ModA = 0) Or IsTemplate)
  Call mo_Tools.SetTextBox(txt_Textbox, "RPL_ModB", mo_Tools.DblToScreen(mo_PrdConfig.RPL_ModB), (Not IsStandard) And (mo_PrdTemp.RPL_ModB = 0) Or IsTemplate)
  Call mo_Tools.SetTextBox(txt_Textbox, "RPL_ModA_", mo_Tools.DblToScreen(mo_PrdConfig.RPL_ModA), False)
  Call mo_Tools.SetTextBox(txt_Textbox, "RPL_ModB_", mo_Tools.DblToScreen(mo_PrdConfig.RPL_ModB), False)
  
  ls_Value = IIf(mo_PrdConfig.RPL_PanA >= 0, mo_Tools.DblToScreen(mo_PrdConfig.RPL_PanA), "")
  Call mo_Tools.SetTextBox(txt_Textbox, "RPL_PanA", ls_Value, IsTemplate)
  Call mo_Tools.SetTextBox(txt_Textbox, "RPL_PanA_", ls_Value, False)
  ls_Value = IIf(mo_PrdConfig.RPL_PanB >= 0, mo_Tools.DblToScreen(mo_PrdConfig.RPL_PanB), "")
  Call mo_Tools.SetTextBox(txt_Textbox, "RPL_PanB", ls_Value, IsTemplate)
  Call mo_Tools.SetTextBox(txt_Textbox, "RPL_PanB_", ls_Value, False)
  
  chk_StandardGap.Value = IIf(mo_PrdConfig.RPL_StdGa, vbChecked, vbUnchecked)
  chk_StandardGap.Enabled = (mo_PrdTemp.RPL_ModA = 0) And (Not IsTemplate)
  For ll_SideIdx = eDPCSide.esSideC To eDPCSide.esSideF
    Call mo_Tools.SetTextBox(txt_Textbox, "RPL_Gap" & mv_Edge(ll_SideIdx), mo_Tools.DblToScreen(mo_PrdConfig.RPL_Gap(ll_SideIdx)), (Not mo_PrdConfig.RPL_StdGa) Or IsTemplate)
    Call mo_Tools.SetTextBox(txt_Textbox, "RPL_Gap" & mv_Edge(ll_SideIdx) & "_", mo_Tools.DblToScreen(mo_PrdConfig.RPL_Gap(ll_SideIdx)), False)
  Next
  Call SetPriceLabel(mo_PrdConfig.CURR_Code)
  Call DisplayPanelImage
  Exit Sub
ErrHandler:
  Call ErrorHandler("DisplayPanelQtySize")
End Sub

Private Sub DisplayPanelMaterial()
On Error GoTo ErrHandler

  chk_StandardMaterial.Value = IIf(mo_PrdConfig.RPL_StdMa, vbChecked, vbUnchecked)
  Call mo_Tools.EnableControl(chk_StandardMaterial, (Not IsTemplate) And (Not IsStandard))

  Call mo_Tools.EnableControl(cbo_Material, (Not mo_PrdConfig.RPL_StdMa) Or IsTemplate)
  Call mo_Tools.EnableControl(cbo_Thickness, (Not mo_PrdConfig.RPL_StdMa) Or IsTemplate)
  
  If mo_PrdConfig.MAT_Id = 0 Then
    Set cbo_Material.SelectedItem = Nothing
  Else
    If Not cbo_Material.SearchItem(mo_PrdConfig.MAT_Id) Then
      Call cbo_Material.AddItem(Array(mo_PrdConfig.MAT_Id, mo_PrdConfig.MAT_Name), True)
    End If
  End If
  Call InitThicknessCombo
  If Not cbo_Thickness.SearchItem(mo_PrdConfig.RPL_Thick) Then
    Call cbo_Thickness.AddItem(Array(mo_PrdConfig.RPL_Thick, mo_Tools.DblToScreen(mo_PrdConfig.RPL_Thick)), True)
  End If
  Exit Sub
ErrHandler:
  Call ErrorHandler("DisplayPanelMaterial")
End Sub

Private Sub DisplayPanelData()
On Error GoTo ErrHandler

Dim lsa_PRD_Code() As String
Dim ll_Idx As Long

  Call mo_Tools.SetTextValue(txt_Textbox, "PRD_Id", mo_PrdConfig.PRD_Id)
  Call mo_Tools.SetTextValue(txt_Textbox, "PRD_Name", mo_PrdConfig.PRD_Name)
  Call mo_Tools.SetTextBox(txt_Textbox, "OFD_Pos", OFD_Pos, False, Not IsTemplate)
  Call mo_Tools.SetTextValue(txt_Textbox, "OFD_PosCus", mo_PrdConfig.OFD_PosCus)
  Call mo_Tools.SetTextBox(txt_Textbox, "PRD_Code", mo_PrdConfig.PRD_Code, IsTemplate)
  Call mo_Tools.SetTextBox(txt_Textbox, "BI_SAP_Code", mo_PrdConfig.BI_SAP_Code, IsTemplate)
  Call mo_Tools.SetCalendarDate(cal_WishDate, mo_PrdConfig.OFD_WshDat)
  Call mo_Tools.SetCalendarDate(cal_ShipDate, mo_PrdConfig.OFD_ShpDat)
  Call mo_Tools.SetCalendarDate(cal_DeliveryDate, mo_PrdConfig.OFD_DelDat)
  
  Call InitVendorCombo(cbo_Vendor)
  Call InitShipPointCombo(cbo_ShipPoint)
  Call InitToolSetupCombo
  
  If IsTemplate Then
    If Not cbo_Vendor.SearchItem(mo_PrdConfig.Vendor_Id) Then
      Call cbo_Vendor.AddItem(Array(mo_PrdConfig.Vendor_Id, mo_PrdConfig.Vendor_Name), True)
    End If
  Else
    If Not cbo_Vendor.SearchItem(mo_PrdConfig.VEN_Id) Then
      Call cbo_Vendor.AddItem(Array(mo_PrdConfig.VEN_Id, mo_PrdConfig.VEN_Name), True)
    End If
  End If
  If Not cbo_ShipPoint.SearchItem(mo_PrdConfig.SHP_Id) Then
    Call cbo_ShipPoint.AddItem(Array(mo_PrdConfig.SHP_Id, mo_PrdConfig.SHP_Name), True)
  End If
  
  Call mo_Tools.SetTextBox(txt_Textbox, "PRD_OfferComment", mo_PrdConfig.GetErrorText(eDPCError.erOfferComment, Nothing))
  Call mo_Tools.SetTextBox(txt_Textbox, "PRD_InternalComment", mo_PrdConfig.GetErrorText(eDPCError.erInternalComment, Nothing))
  Call mo_Tools.SetTextBox(txt_Textbox, "PanelPerMod", mo_PrdConfig.PanelPerMod, False)
  chk_ASFlag.Value = IIf(mo_PrdConfig.OFD_IsAsItem, vbChecked, vbUnchecked)
  chk_FreeOfCharge.Value = IIf(mo_PrdConfig.OFD_IsFree, vbChecked, vbUnchecked)
  Call mo_Tools.SetTextValue(txt_Textbox, "RPL_CorW", mo_Tools.DblToScreen(mo_PrdConfig.RPL_CorW))
  For ll_Idx = 0 To fra_SpecAttrib.Count - 1
    fra_SpecAttrib(ll_Idx).Visible = (StrComp(fra_SpecAttrib(ll_Idx).Tag, "fra_SpecAttrib" & mo_PrdConfig.SYS_Frame, vbTextCompare) = 0)
  Next
  
  If Not cbo_ToolSetup.SearchItem(mo_PrdConfig.RPL_ToolSetup) Then
    Call cbo_ToolSetup.AddItem(Array(mo_PrdConfig.RPL_ToolSetup, mo_PrdConfig.RPL_ToolSetup), True)
  End If
  Call mo_Tools.SetTextValue(txt_Textbox, "RPL_BaeType", mo_Tools.LongToScreen(mo_PrdConfig.RPL_BaeType))
  
  Call mo_Tools.EnableControl(cbo_Material, (Not mo_PrdConfig.RPL_StdMa) Or IsTemplate)

  Call DisplayPanelImage
  Exit Sub
ErrHandler:
  Call ErrorHandler("DisplayPanelData")
End Sub

Private Sub InitVendorCombo(ByVal ao_Combo As ArmCombobox)
On Error GoTo ErrHandler

  Dim ls_Request As String
  ls_Request = "exec DPC_Vendor_SAP_View_lst $LEN_Id$, $COF_Lang$"
  ls_Request = Replace(ls_Request, "$LEN_Id$", mo_Tools.SqlInt(mo_PrdConfig.LEN_Id), , , vbTextCompare)
  ls_Request = ReplaceCommonPlaceholders(ls_Request)
  ao_Combo.Request = ls_Request
  Exit Sub
ErrHandler:
  Call ErrorHandler("InitVendorCombo")
End Sub

Private Sub InitShipPointCombo(ByVal ao_Combo As ArmCombobox)
On Error GoTo ErrHandler

  Dim ls_Request As String
  ls_Request = "exec DPC_ShipPoint_SAP_View_lst $LEN_Id$, $VEN_Id$, $COF_Lang$"
  ls_Request = Replace(ls_Request, "$LEN_Id$", mo_Tools.SqlInt(mo_PrdConfig.LEN_Id), , , vbTextCompare)
  ls_Request = Replace(ls_Request, "$VEN_Id$", mo_Tools.SQLStr(mo_PrdConfig.VEN_Id), , , vbTextCompare)
  ls_Request = ReplaceCommonPlaceholders(ls_Request)
  ao_Combo.Request = ls_Request
  Exit Sub
ErrHandler:
  Call ErrorHandler("InitShipPointCombo")
End Sub

Private Sub InitCutoutCombo(ByVal ao_Combo As ArmCombobox, ByVal ae_CutoutType As eDPCCutoutType)
On Error GoTo ErrHandler

  Dim ls_Request As String
  ls_Request = "exec DPC_CutType_cbo $CUT_Type$, $COF_Lang$"
  ls_Request = Replace(ls_Request, "$CUT_Type$", mo_Tools.SqlInt(ae_CutoutType), , , vbTextCompare)
  ls_Request = ReplaceCommonPlaceholders(ls_Request)
  ao_Combo.Request = ls_Request
  Exit Sub
ErrHandler:
  Call ErrorHandler("InitCutoutCombo")
End Sub
     
Private Sub InitBendingCombo(ByVal ao_Combo As ArmCombobox, ByVal ae_Side As eDPCSide)
On Error GoTo ErrHandler
  
Dim ls_Request As String

  ls_Request = "exec DPC_Bending_lst $COF_Lang$, $BND_IsShr$, $BND_IsLng$, $BND_IsCus$"
  If (ae_Side = eDPCSide.esSideC) Or (ae_Side = eDPCSide.esSideD) Then
    ls_Request = Replace(ls_Request, "$BND_IsLng$", mo_Tools.SqlBool(True), , , vbTextCompare)
    ls_Request = Replace(ls_Request, "$BND_IsShr$", "NULL", , , vbTextCompare)
  Else
    ls_Request = Replace(ls_Request, "$BND_IsLng$", "NULL", , , vbTextCompare)
    ls_Request = Replace(ls_Request, "$BND_IsShr$", mo_Tools.SqlBool(True), , , vbTextCompare)
  End If
  ls_Request = Replace(ls_Request, "$BND_IsCus$", IIf(IsTemplate, "NULL", mo_Tools.SqlBool(False)), , , vbTextCompare)
  ls_Request = ReplaceCommonPlaceholders(ls_Request)
  ao_Combo.Request = ls_Request
  Exit Sub
ErrHandler:
  Call ErrorHandler("InitBendingCombo")
End Sub

Private Sub InitPerforationCombo(ByVal ao_Combo As ArmCombobox, ByVal ae_CutoutType As eDPCCutoutType)
On Error GoTo ErrHandler
  
Dim ls_Request As String

  ls_Request = "exec DPC_Perforation_lst2 $COF_Lang$, $PRF_AllowVent$, $PRF_AllowLoud$"
  If ae_CutoutType = eDPCCutoutType.eVentilation Then
    ls_Request = Replace(ls_Request, "$PRF_AllowVent$", "X", , , vbTextCompare)
    ls_Request = Replace(ls_Request, "$PRF_AllowLoud$", "NULL", , , vbTextCompare)
  ElseIf ae_CutoutType = eDPCCutoutType.eLoudspeaker Then
    ls_Request = Replace(ls_Request, "$PRF_AllowVent$", "NULL", , , vbTextCompare)
    ls_Request = Replace(ls_Request, "$PRF_AllowLoud$", "X", , , vbTextCompare)
  Else
    ls_Request = Replace(ls_Request, "$PRF_AllowVent$", "NULL", , , vbTextCompare)
    ls_Request = Replace(ls_Request, "$PRF_AllowLoud$", "NULL", , , vbTextCompare)
  End If
  ls_Request = ReplaceCommonPlaceholders(ls_Request)
  ao_Combo.Request = ls_Request
  Exit Sub
ErrHandler:
  Call ErrorHandler("InitPerforationCombo")
End Sub
   
Private Sub InitReferencesCombo(ByVal ao_Combo As ArmCombobox, ByVal ae_GR_Code As eDPCReferenceML)
On Error GoTo ErrHandler
  
Dim ls_Request As String

  ls_Request = "exec A_References_ML_Lst $GR_Code$, $COF_Lang$"
  ls_Request = Replace(ls_Request, "$GR_Code$", mo_Tools.SqlInt(ae_GR_Code), , , vbTextCompare)
  ls_Request = ReplaceCommonPlaceholders(ls_Request)
  ao_Combo.Request = ls_Request
  Exit Sub
ErrHandler:
  Call ErrorHandler("InitReferencesCombo")
End Sub

Private Sub InitCutAreaCombo(ByVal ao_Combo As ArmCombobox, ByVal as_CUT_Id As String)
On Error GoTo ErrHandler

  Dim ls_Request As String
  
  ls_Request = "exec DPC_CutArea_lst2 $CUT_Id$"
  ls_Request = Replace(ls_Request, "$CUT_Id$", mo_Tools.SqlStrKey(as_CUT_Id), , , vbTextCompare)
  ls_Request = ReplaceCommonPlaceholders(ls_Request)
  ao_Combo.Request = ls_Request
  Exit Sub
ErrHandler:
  Call ErrorHandler("InitLoudAreaCombo")
End Sub

Private Sub InitThicknessCombo()
On Error GoTo ErrHandler
  
Dim ls_Request As String

  Call cbo_Thickness.Clear
  ls_Request = "exec DPC_Coil_lst2 $MAT_Id$, $COF_Lang$"
  ls_Request = Replace(ls_Request, "$MAT_Id$", mo_Tools.SqlInt(mo_PrdConfig.MAT_Id), , , vbTextCompare)
  ls_Request = ReplaceCommonPlaceholders(ls_Request)
  cbo_Thickness.Request = ls_Request
  cbo_Thickness.FirstBlankItem = IsTemplate
  Exit Sub
ErrHandler:
  Call ErrorHandler("InitThicknessCombo")
End Sub

Private Sub InitMaterialCombo()
On Error GoTo ErrHandler
  
Dim ls_Request As String

  ls_Request = "exec DPC_Material_lst2 $COF_Lang$"
  ls_Request = ReplaceCommonPlaceholders(ls_Request)
  cbo_Material.Request = ls_Request
  Exit Sub
ErrHandler:
  Call ErrorHandler("InitMaterialCombo")
End Sub

Private Sub InitToolSetupCombo()
On Error GoTo ErrHandler
  
Dim ls_Request As String

  ls_Request = "SELECT RF_Desc AS Code, RF_Desc FROM A_References WHERE GR_Code=4000 AND Z_Status=1 ORDER BY RF_Desc"
  ls_Request = ReplaceCommonPlaceholders(ls_Request)
  cbo_ToolSetup.Request = ls_Request
  cbo_ToolSetup.FirstBlankItem = True
  Exit Sub
ErrHandler:
  Call ErrorHandler("InitToolSetupCombo")
End Sub

Private Sub InitGasketCombo(ByVal ao_Combo As ArmCombobox, ByVal ae_GSK_Type As eDPCGasketType, ByVal ad_Gap As Double)
On Error GoTo ErrHandler
  
Dim ls_Request As String

  ls_Request = "exec DPC_Gasket_lst2 $GSK_Type$, $GSK_Gap$, $COF_Lang$"
    
  ls_Request = Replace(ls_Request, "$GSK_Type$", mo_Tools.SqlInt(ae_GSK_Type), , , vbTextCompare)
  ls_Request = Replace(ls_Request, "$GSK_Gap$", mo_Tools.SqlDbl(ad_Gap), , , vbTextCompare)
  ls_Request = ReplaceCommonPlaceholders(ls_Request)
  ao_Combo.Request = ls_Request
  Exit Sub
ErrHandler:
  Call ErrorHandler("InitGasketCombo")
End Sub

Private Sub InitPackingCombo()
On Error GoTo ErrHandler
  
Dim ls_Request As String
    
  ls_Request = "exec DPC_Packing_lst3 $SYS_Id$, $COF_Lang$"
  
  ls_Request = Replace(ls_Request, "$SYS_Id$", mo_Tools.SqlInt(mo_PrdConfig.SYS_Id), , , vbTextCompare)
  ls_Request = ReplaceCommonPlaceholders(ls_Request)
  cbo_Packing.Request = ls_Request
  Exit Sub
ErrHandler:
  Call ErrorHandler("InitPackingCombo")
End Sub

Private Sub InitLabelingCombo()
On Error GoTo ErrHandler
  
Dim ls_Request As String
    
  ls_Request = "exec DPC_Labeling_lst3 $SYS_Id$, $COF_Lang$"
  ls_Request = Replace(ls_Request, "$SYS_Id$", mo_Tools.SqlInt(mo_PrdConfig.SYS_Id), , , vbTextCompare)
  ls_Request = ReplaceCommonPlaceholders(ls_Request)
  cbo_Labeling.Request = ls_Request
  Exit Sub
ErrHandler:
  Call ErrorHandler("InitLabelingCombo")
End Sub

Private Sub InitLabelLanguageCombo()
On Error GoTo ErrHandler
  
Dim ls_Request As String
    
  ls_Request = "exec DPC_LabelLang_cbo $COF_Lang$"
  ls_Request = ReplaceCommonPlaceholders(ls_Request)
  cbo_LabelLanguage.Request = ls_Request
  Exit Sub
ErrHandler:
  Call ErrorHandler("InitLabelLanguageCombo")
End Sub

Private Sub InitCEClassCombo(ByVal ao_Combo As ArmCombobox, ByVal ae_CEClass As eDPCCEClass)
On Error GoTo ErrHandler
  
Dim ls_Request As String

  ao_Combo.FirstBlankItem = False
  
  ls_Request = "exec DPC_CEClass_lst2 $CEClass$, $COF_Lang$"
  ls_Request = Replace(ls_Request, "$CEClass$", mo_Tools.SqlInt(ae_CEClass), , , vbTextCompare)
  ls_Request = ReplaceCommonPlaceholders(ls_Request)
  ao_Combo.Request = ls_Request
  Exit Sub
ErrHandler:
  Call ErrorHandler("InitCEClassCombo")
End Sub

Private Sub cbo_Vendor_ComboItemSelected()
On Error GoTo ErrHandler

  If mb_InternalInit Then Exit Sub
  mb_InternalInit = True
  If IsTemplate Then
    mo_PrdConfig.Vendor_Id = mo_Tools.GetComboKey(cbo_Vendor)
    mo_PrdConfig.Vendor_Name = cbo_Vendor.Text
  Else
    mo_PrdConfig.VEN_Id = mo_Tools.GetComboKey(cbo_Vendor)
    mo_PrdConfig.VEN_Name = cbo_Vendor.Text
  End If
  Call cbo_ShipPoint.Clear
  mo_PrdConfig.SHP_Id = 0
  mo_PrdConfig.SHP_Name = ""
  Call InitShipPointCombo(cbo_ShipPoint)
  mb_InternalInit = False
  Exit Sub
ErrHandler:
  Call ErrorMessage("cbo_Vendor_ComboItemSelected")
End Sub

Private Sub cbo_ShipPoint_ComboItemSelected()
On Error GoTo ErrHandler
  
  If mb_InternalInit Then Exit Sub
  mo_PrdConfig.SHP_Id = mo_Tools.GetComboKey(cbo_ShipPoint)
  mo_PrdConfig.SHP_Name = cbo_ShipPoint.Text
  Exit Sub
ErrHandler:
  Call ErrorMessage("cbo_ShipPoint_ComboItemSelected")
End Sub

Private Sub cbo_Material_ComboItemSelected()
On Error GoTo ErrHandler

Dim ls_Request As String
  
  If mb_InternalInit Then Exit Sub
  mb_InternalInit = True
  Call mo_Tools.LockScreen(Me, True)
  Call mo_PrdConfig.LoadMaterial(mo_Tools.GetComboKey(cbo_Material))
  mo_PrdConfig.RPL_Thick = 0
  Call InitThicknessCombo
  Call LoadPanelPrice
  Call mo_Tools.LockScreen(Me, False)
  mb_InternalInit = False
  Exit Sub
ErrHandler:
  Call ErrorMessage("cbo_Material_ComboItemSelected")
End Sub

Private Sub cbo_ToolSetup_ComboItemSelected()
On Error GoTo ErrHandler
  
  If mb_InternalInit Then Exit Sub
  mo_PrdConfig.RPL_ToolSetup = cbo_ToolSetup.Text
  Exit Sub
ErrHandler:
  Call ErrorMessage("cbo_ToolSetup_ComboItemSelected")
End Sub

Private Sub cbo_Thickness_ComboItemSelected()
On Error GoTo ErrHandler
  
  If mb_InternalInit Then Exit Sub
  mb_InternalInit = True
  Call mo_Tools.LockScreen(Me, True)
  mo_PrdConfig.RPL_Thick = mo_Tools.GetComboKey(cbo_Thickness)
  Call LoadPanelPrice
  Call mo_Tools.LockScreen(Me, False)
  mb_InternalInit = False
  Exit Sub
ErrHandler:
  Call ErrorMessage("cbo_Thickness_ComboItemSelected")
End Sub

Private Sub InitOfferPrice(ByVal ao_OfferPos As DPC_OfferPos, ByRef ad_Price As Double, ByRef ad_PriceA As Double, ByVal ae_UM_Code As String)
On Error GoTo ErrHandler

  If ao_OfferPos Is Nothing Then
    ad_Price = 0
    ad_PriceA = 0
  Else
    ad_Price = ao_OfferPos.OFD_PricePCS
    ad_PriceA = ao_OfferPos.OFD_PriceAPCS
  End If
  Exit Sub
ErrHandler:
  Call ErrorHandler("InitOfferPrice")
End Sub

Private Sub DisplayPrice(Optional ByVal ae_Screen As eDPCScreen = eDPCScreen.psPanelSummary, Optional ao_Cutout As DPC_Cutout = Nothing, Optional ao_SubArt As DPC_SubArt = Nothing, Optional ao_Inlay As DPC_Inlay = Nothing)
On Error GoTo ErrHandler

Dim ll_Idx As Long
Dim lo_TextBox As TextBox
Dim ls_TextName As String
Dim lo_Offer As DPC_OfferPos
Dim ld_Price As Double
Dim ld_PriceA As Double

    If (ae_Screen = eDPCScreen.psPanel) Or (ae_Screen = eDPCScreen.psPanelSummary) Then
    
      Set lo_Offer = mo_PrdConfig.GetOfferPos(eDPCOfferDetail.odPanelCost, "")
      Call mo_Tools.SetTextValue(txt_Price, "txt_PanelPriceM2_A", mo_Tools.DblToScreen(lo_Offer.OFD_PriceAM2))
      Call mo_Tools.SetTextEnabled(txt_Price, "txt_PanelPriceM2_A", False)
      
      Call mo_Tools.SetTextValue(txt_Price, "txt_PanelPricePU_A", mo_Tools.DblToScreen(lo_Offer.OFD_PriceAPU))
      Call mo_Tools.SetTextEnabled(txt_Price, "txt_PanelPricePU_A", False)
      
      Call mo_Tools.SetTextValue(txt_Price, "txt_PanelPricePCS_A", mo_Tools.DblToScreen(lo_Offer.OFD_PriceAPCS))
      Call mo_Tools.SetTextEnabled(txt_Price, "txt_PanelPricePCS_A", False)
      
      Call mo_Tools.SetTextValue(txt_Price, "txt_PanelPriceM2_M", mo_Tools.DblToScreen(lo_Offer.OFD_PriceM2))
      Call mo_Tools.SetTextEnabled(txt_Price, "txt_PanelPriceM2_M", CanChangeManualPrice)
      
      Call mo_Tools.SetTextValue(txt_Price, "txt_PanelPricePU_M", mo_Tools.DblToScreen(lo_Offer.OFD_PricePU))
      Call mo_Tools.SetTextEnabled(txt_Price, "txt_PanelPricePU_M", False)
      
      Call mo_Tools.SetTextValue(txt_Price, "txt_PanelPricePCS_M", mo_Tools.DblToScreen(lo_Offer.OFD_PricePCS))
      Call mo_Tools.SetTextEnabled(txt_Price, "txt_PanelPricePCS_M", CanChangeManualPrice)
      
      Set lo_Offer = mo_PrdConfig.GetOfferPos(eDPCOfferDetail.odPanelSetupChargeUnp, "")
      Call InitOfferPrice(lo_Offer, ld_Price, ld_PriceA, DPC_UOM_PCS)
      Call mo_Tools.SetTextValue(txt_Price, "txt_PanelSetupChargeUNP_A", mo_Tools.DblToScreen(ld_PriceA))
      Call mo_Tools.SetTextEnabled(txt_Price, "txt_PanelSetupChargeUNP_A", False)
      Call mo_Tools.SetTextValue(txt_Price, "txt_PanelSetupChargeUNP_M", mo_Tools.DblToScreen(ld_Price))
      Call mo_Tools.SetTextEnabled(txt_Price, "txt_PanelSetupChargeUNP_M", CanChangeManualPrice)
    
      Set lo_Offer = mo_PrdConfig.GetOfferPos(eDPCOfferDetail.odPanelSetupChargePrf, "")
      Call InitOfferPrice(lo_Offer, ld_Price, ld_PriceA, DPC_UOM_PCS)
      Call mo_Tools.SetTextValue(txt_Price, "txt_PanelSetupChargePRF_A", mo_Tools.DblToScreen(ld_PriceA))
      Call mo_Tools.SetTextEnabled(txt_Price, "txt_PanelSetupChargePRF_A", False)
      Call mo_Tools.SetTextValue(txt_Price, "txt_PanelSetupChargePRF_M", mo_Tools.DblToScreen(ld_Price))
      Call mo_Tools.SetTextEnabled(txt_Price, "txt_PanelSetupChargePRF_M", CanChangeManualPrice)
      
      Set lo_Offer = mo_PrdConfig.GetOfferPos(eDPCOfferDetail.odPanelChangeLengthCostUnp, "")
      Call InitOfferPrice(lo_Offer, ld_Price, ld_PriceA, DPC_UOM_PCS)
      Call mo_Tools.SetTextValue(txt_Price, "txt_PanelChangeAUNP_A", mo_Tools.DblToScreen(ld_PriceA))
      Call mo_Tools.SetTextEnabled(txt_Price, "txt_PanelChangeAUNP_A", False)
      Call mo_Tools.SetTextValue(txt_Price, "txt_PanelChangeAUNP_M", mo_Tools.DblToScreen(ld_Price))
      Call mo_Tools.SetTextEnabled(txt_Price, "txt_PanelChangeAUNP_M", CanChangeManualPrice)
      
      Set lo_Offer = mo_PrdConfig.GetOfferPos(eDPCOfferDetail.odPanelChangeLengthCostPrf, "")
      Call InitOfferPrice(lo_Offer, ld_Price, ld_PriceA, DPC_UOM_PCS)
      Call mo_Tools.SetTextValue(txt_Price, "txt_PanelChangeAPRF_A", mo_Tools.DblToScreen(ld_PriceA))
      Call mo_Tools.SetTextEnabled(txt_Price, "txt_PanelChangeAPRF_A", False)
      Call mo_Tools.SetTextValue(txt_Price, "txt_PanelChangeAPRF_M", mo_Tools.DblToScreen(ld_Price))
      Call mo_Tools.SetTextEnabled(txt_Price, "txt_PanelChangeAPRF_M", CanChangeManualPrice)
      
      Set lo_Offer = mo_PrdConfig.GetOfferPos(eDPCOfferDetail.odPanelChangeWidthCostUnp, "")
      Call InitOfferPrice(lo_Offer, ld_Price, ld_PriceA, DPC_UOM_PCS)
      Call mo_Tools.SetTextValue(txt_Price, "txt_PanelChangeBUNP_A", mo_Tools.DblToScreen(ld_PriceA))
      Call mo_Tools.SetTextEnabled(txt_Price, "txt_PanelChangeBUNP_A", False)
      Call mo_Tools.SetTextValue(txt_Price, "txt_PanelChangeBUNP_M", mo_Tools.DblToScreen(ld_Price))
      Call mo_Tools.SetTextEnabled(txt_Price, "txt_PanelChangeBUNP_M", CanChangeManualPrice)
    
      Set lo_Offer = mo_PrdConfig.GetOfferPos(eDPCOfferDetail.odPanelChangeWidthCostPrf, "")
      Call InitOfferPrice(lo_Offer, ld_Price, ld_PriceA, DPC_UOM_PCS)
      Call mo_Tools.SetTextValue(txt_Price, "txt_PanelChangeBPRF_A", mo_Tools.DblToScreen(ld_PriceA))
      Call mo_Tools.SetTextEnabled(txt_Price, "txt_PanelChangeBPRF_A", False)
      Call mo_Tools.SetTextValue(txt_Price, "txt_PanelChangeBPRF_M", mo_Tools.DblToScreen(ld_Price))
      Call mo_Tools.SetTextEnabled(txt_Price, "txt_PanelChangeBPRF_M", CanChangeManualPrice)
      
      fra_PanelSetupPRF.Visible = mo_PrdConfig.HasPerforation
      fra_PanelSetupUNP.Visible = Not mo_PrdConfig.HasPerforation
    End If
    
    If (ae_Screen = eDPCScreen.psGasket) Or (ae_Screen = eDPCScreen.psPanelSummary) Then
      Set lo_Offer = mo_PrdConfig.GetOfferPos(eDPCOfferDetail.odGasketSurcharge)
      Call mo_Tools.SetTextValue(txt_Price, "txt_GasketSurcharge_A", mo_Tools.DblToScreen(lo_Offer.OFD_PriceA))
      Call mo_Tools.SetTextEnabled(txt_Price, "txt_GasketSurcharge_A", False)
    
      Call mo_Tools.SetTextValue(txt_Price, "txt_GasketSurcharge_M", mo_Tools.DblToScreen(lo_Offer.OFD_Price))
      Call mo_Tools.SetTextEnabled(txt_Price, "txt_GasketSurcharge_M", CanChangeManualPrice And mo_PrdConfig.HasGasket)
    
      Set lo_Offer = mo_PrdConfig.GetOfferPos(eDPCOfferDetail.odSpacerSurcharge)
      Call mo_Tools.SetTextValue(txt_Price, "txt_GasketSurcharge2_A", mo_Tools.DblToScreen(lo_Offer.OFD_PriceA))
      Call mo_Tools.SetTextEnabled(txt_Price, "txt_GasketSurcharge2_A", False)
    
      Call mo_Tools.SetTextValue(txt_Price, "txt_GasketSurcharge2_M", mo_Tools.DblToScreen(lo_Offer.OFD_Price))
      Call mo_Tools.SetTextEnabled(txt_Price, "txt_GasketSurcharge2_M", CanChangeManualPrice And mo_PrdConfig.HasSpacer)
    End If
    
    If (ae_Screen = eDPCScreen.psInlay) Or (ae_Screen = eDPCScreen.psPanelSummary) Then
      If ao_Inlay Is Nothing Then
        Call DisplayInlayGrid
      Else
        Set lo_Offer = ao_Inlay.GetOfferPos(eDPCOfferDetail.odInlayCost)
        Call mo_Tools.SetTextValue(txt_Price, "txt_InlayPrice_A", mo_Tools.DblToScreen(lo_Offer.OFD_PriceA))
        Call mo_Tools.SetTextEnabled(txt_Price, "txt_InlayPrice_A", False)
        
        Call mo_Tools.SetTextValue(txt_Price, "txt_InlayPrice_M", mo_Tools.DblToScreen(lo_Offer.OFD_Price))
        Call mo_Tools.SetTextEnabled(txt_Price, "txt_InlayPrice_M", CanChangeManualPrice)
      
        Set lo_Offer = ao_Inlay.GetOfferPos(eDPCOfferDetail.odInlaySetupCharge)
        Call mo_Tools.SetTextValue(txt_Price, "txt_InlaySetupCharge_A", mo_Tools.DblToScreen(lo_Offer.OFD_PriceA))
        Call mo_Tools.SetTextEnabled(txt_Price, "txt_InlaySetupCharge_A", False)
        
        Call mo_Tools.SetTextValue(txt_Price, "txt_InlaySetupCharge_M", mo_Tools.DblToScreen(lo_Offer.OFD_Price))
        Call mo_Tools.SetTextEnabled(txt_Price, "txt_InlaySetupCharge_M", CanChangeManualPrice)
      End If
    End If
    
    If (ae_Screen = eDPCScreen.psCoating) Or (ae_Screen = eDPCScreen.psPanelSummary) Then
      Set lo_Offer = mo_PrdConfig.GetOfferPos(eDPCOfferDetail.odCoatingCost, "")
      Call mo_Tools.SetTextValue(txt_Price, "txt_CoatingPrice_A", mo_Tools.DblToScreen(lo_Offer.OFD_PriceA))
      Call mo_Tools.SetTextEnabled(txt_Price, "txt_CoatingPrice_A", False)
      
      Call mo_Tools.SetTextValue(txt_Price, "txt_CoatingPrice_M", mo_Tools.DblToScreen(lo_Offer.OFD_Price))
      Call mo_Tools.SetTextEnabled(txt_Price, "txt_CoatingPrice_M", CanChangeManualPrice And mo_PrdConfig.HasCoating)
    
      Set lo_Offer = mo_PrdConfig.GetOfferPos(eDPCOfferDetail.odCoatingSetupCharge, "")
      Call mo_Tools.SetTextValue(txt_Price, "txt_CoatingSetupCharge_A", mo_Tools.DblToScreen(lo_Offer.OFD_PriceA))
      Call mo_Tools.SetTextEnabled(txt_Price, "txt_CoatingSetupCharge_A", False)
      
      Call mo_Tools.SetTextValue(txt_Price, "txt_CoatingSetupCharge_M", mo_Tools.DblToScreen(lo_Offer.OFD_Price))
      Call mo_Tools.SetTextEnabled(txt_Price, "txt_CoatingSetupCharge_M", CanChangeManualPrice And mo_PrdConfig.HasCoating)
    End If
    
    If (ae_Screen = eDPCScreen.psPerforation) Or (ae_Screen = eDPCScreen.psPanelSummary) Then
      Set lo_Offer = mo_PrdConfig.GetOfferPos(eDPCOfferDetail.odPerforationCost, "")
      Call mo_Tools.SetTextValue(txt_Price, "txt_PerfPrice_A", mo_Tools.DblToScreen(lo_Offer.OFD_PriceA))
      Call mo_Tools.SetTextEnabled(txt_Price, "txt_PerfPrice_A", False)
      
      Call mo_Tools.SetTextValue(txt_Price, "txt_PerfPrice_M", mo_Tools.DblToScreen(lo_Offer.OFD_Price))
      Call mo_Tools.SetTextEnabled(txt_Price, "txt_PerfPrice_M", CanChangeManualPrice And mo_PrdConfig.HasPerforation)
    End If
    
    If (ae_Screen = eDPCScreen.psPacking) Or (ae_Screen = eDPCScreen.psPanelSummary) Then
      Set lo_Offer = mo_PrdConfig.GetOfferPos(eDPCOfferDetail.odPackingCost, "")
      Call mo_Tools.SetTextValue(txt_Price, "txt_PackingPrice_A", mo_Tools.DblToScreen(lo_Offer.OFD_PriceA))
      Call mo_Tools.SetTextEnabled(txt_Price, "txt_PackingPrice_A", False)
      
      Call mo_Tools.SetTextValue(txt_Price, "txt_PackingPrice_M", mo_Tools.DblToScreen(lo_Offer.OFD_Price))
      Call mo_Tools.SetTextEnabled(txt_Price, "txt_PackingPrice_M", CanChangeManualPrice And mo_PrdConfig.HasPacking)
    
      Set lo_Offer = mo_PrdConfig.GetOfferPos(eDPCOfferDetail.odLabelingCost, "")
      Call mo_Tools.SetTextValue(txt_Price, "txt_LabelingPrice_A", mo_Tools.DblToScreen(lo_Offer.OFD_PriceA))
      Call mo_Tools.SetTextEnabled(txt_Price, "txt_LabelingPrice_A", False)
      
      Call mo_Tools.SetTextValue(txt_Price, "txt_LabelingPrice_M", mo_Tools.DblToScreen(lo_Offer.OFD_Price))
      Call mo_Tools.SetTextEnabled(txt_Price, "txt_LabelingPrice_M", CanChangeManualPrice And mo_PrdConfig.HasLabeling)
    End If
    
    If (ae_Screen = eDPCScreen.psCutout) Or (ae_Screen = eDPCScreen.psPanelSummary) Then
      If ao_Cutout Is Nothing Then
        Call DisplayCutout
      Else
        Set lo_Offer = ao_Cutout.GetOfferPos(eDPCOfferDetail.odCutoutCost)
        Call mo_Tools.SetTextValue(txt_Price, "txt_CutoutPrice_A", mo_Tools.DblToScreen(lo_Offer.OFD_PriceA))
        Call mo_Tools.SetTextEnabled(txt_Price, "txt_CutoutPrice_A", False)
        
        Call mo_Tools.SetTextValue(txt_Price, "txt_CutoutPrice_M", mo_Tools.DblToScreen(lo_Offer.OFD_Price))
        Call mo_Tools.SetTextEnabled(txt_Price, "txt_CutoutPrice_M", CanChangeManualPrice)
        
        Set lo_Offer = ao_Cutout.GetOfferPos(eDPCOfferDetail.odCutoutSetupCharge)
        Call mo_Tools.SetTextValue(txt_Price, "txt_CutoutSetupCharge_A", mo_Tools.DblToScreen(lo_Offer.OFD_PriceA))
        Call mo_Tools.SetTextEnabled(txt_Price, "txt_CutoutSetupCharge_A", False)
        
        Call mo_Tools.SetTextValue(txt_Price, "txt_CutoutSetupCharge_M", mo_Tools.DblToScreen(lo_Offer.OFD_Price))
        Call mo_Tools.SetTextEnabled(txt_Price, "txt_CutoutSetupCharge_M", CanChangeManualPrice)
        
        Set lo_Offer = ao_Cutout.GetOfferPos(eDPCOfferDetail.odCutoutSurcharge)
        Call mo_Tools.SetTextValue(txt_Price, "txt_CutoutSurcharge_A", mo_Tools.DblToScreen(lo_Offer.OFD_PriceA))
        Call mo_Tools.SetTextEnabled(txt_Price, "txt_CutoutSurcharge_A", False)
        
        Call mo_Tools.SetTextValue(txt_Price, "txt_CutoutSurcharge_M", mo_Tools.DblToScreen(lo_Offer.OFD_Price))
        Call mo_Tools.SetTextEnabled(txt_Price, "txt_CutoutSurcharge_M", CanChangeManualPrice)
        
        Set lo_Offer = ao_Cutout.GetOfferPos(eDPCOfferDetail.odCutoutAddChangeCost)
        Call mo_Tools.SetTextValue(txt_Price, "txt_CutoutAddChange_A", mo_Tools.DblToScreen(lo_Offer.OFD_PriceA))
        Call mo_Tools.SetTextEnabled(txt_Price, "txt_CutoutAddChange_A", False)
        
        Call mo_Tools.SetTextValue(txt_Price, "txt_CutoutAddChange_M", mo_Tools.DblToScreen(lo_Offer.OFD_Price))
        Call mo_Tools.SetTextEnabled(txt_Price, "txt_CutoutAddChange_M", CanChangeManualPrice)
      End If
    End If
    
    If (ae_Screen = eDPCScreen.psVentilation) Or (ae_Screen = eDPCScreen.psPanelSummary) Then
      If ao_Cutout Is Nothing Then
        Call DisplayVentilation
      Else
        Set lo_Offer = ao_Cutout.GetOfferPos(eDPCOfferDetail.odVentilationCost)
        Call mo_Tools.SetTextValue(txt_Price, "txt_VentPrice_A", mo_Tools.DblToScreen(lo_Offer.OFD_PriceA))
        Call mo_Tools.SetTextEnabled(txt_Price, "txt_VentPrice_A", False)
        
        Call mo_Tools.SetTextValue(txt_Price, "txt_VentPrice_M", mo_Tools.DblToScreen(lo_Offer.OFD_Price))
        Call mo_Tools.SetTextEnabled(txt_Price, "txt_VentPrice_M", CanChangeManualPrice)
        
        Set lo_Offer = ao_Cutout.GetOfferPos(eDPCOfferDetail.odVentilationSetupCharge)
        Call mo_Tools.SetTextValue(txt_Price, "txt_VentSetupCharge_A", mo_Tools.DblToScreen(lo_Offer.OFD_PriceA))
        Call mo_Tools.SetTextEnabled(txt_Price, "txt_VentSetupCharge_A", False)
        
        Call mo_Tools.SetTextValue(txt_Price, "txt_VentSetupCharge_M", mo_Tools.DblToScreen(lo_Offer.OFD_Price))
        Call mo_Tools.SetTextEnabled(txt_Price, "txt_VentSetupCharge_M", CanChangeManualPrice)
        
        Set lo_Offer = ao_Cutout.GetOfferPos(eDPCOfferDetail.odVentilationAddChangeCost)
        Call mo_Tools.SetTextValue(txt_Price, "txt_VentAddChange_A", mo_Tools.DblToScreen(lo_Offer.OFD_PriceA))
        Call mo_Tools.SetTextEnabled(txt_Price, "txt_VentAddChange_A", False)
        
        Call mo_Tools.SetTextValue(txt_Price, "txt_VentAddChange_M", mo_Tools.DblToScreen(lo_Offer.OFD_Price))
        Call mo_Tools.SetTextEnabled(txt_Price, "txt_VentAddChange_M", CanChangeManualPrice)
      End If
    End If
    
    If (ae_Screen = eDPCScreen.psLoudspeaker) Or (ae_Screen = eDPCScreen.psPanelSummary) Then
      If ao_Cutout Is Nothing Then
        Call DisplayLoudspeaker
      Else
        Set lo_Offer = ao_Cutout.GetOfferPos(eDPCOfferDetail.odLoudspeakerCost)
        Call mo_Tools.SetTextValue(txt_Price, "txt_LoudPrice_A", mo_Tools.DblToScreen(lo_Offer.OFD_PriceA))
        Call mo_Tools.SetTextEnabled(txt_Price, "txt_LoudPrice_A", False)
        
        Call mo_Tools.SetTextValue(txt_Price, "txt_LoudPrice_M", mo_Tools.DblToScreen(lo_Offer.OFD_Price))
        Call mo_Tools.SetTextEnabled(txt_Price, "txt_LoudPrice_M", CanChangeManualPrice)
        
        Set lo_Offer = ao_Cutout.GetOfferPos(eDPCOfferDetail.odLoudspeakerSetupCharge)
        Call mo_Tools.SetTextValue(txt_Price, "txt_LoudSetupCharge_A", mo_Tools.DblToScreen(lo_Offer.OFD_PriceA))
        Call mo_Tools.SetTextEnabled(txt_Price, "txt_LoudSetupCharge_A", False)
        
        Call mo_Tools.SetTextValue(txt_Price, "txt_LoudSetupCharge_M", mo_Tools.DblToScreen(lo_Offer.OFD_Price))
        Call mo_Tools.SetTextEnabled(txt_Price, "txt_LoudSetupCharge_M", CanChangeManualPrice)
        
        Set lo_Offer = ao_Cutout.GetOfferPos(eDPCOfferDetail.odLoudspeakerAddChangeCost)
        Call mo_Tools.SetTextValue(txt_Price, "txt_LoudAddChange_A", mo_Tools.DblToScreen(lo_Offer.OFD_PriceA))
        Call mo_Tools.SetTextEnabled(txt_Price, "txt_LoudAddChange_A", False)
        
        Call mo_Tools.SetTextValue(txt_Price, "txt_LoudAddChange_M", mo_Tools.DblToScreen(lo_Offer.OFD_Price))
        Call mo_Tools.SetTextEnabled(txt_Price, "txt_LoudAddChange_M", CanChangeManualPrice)
      End If
    End If
    
    Set lo_Offer = mo_PrdConfig.GetOfferPos(eDPCOfferDetail.odPosition, "")
    If (GetMaxErrorType < eDPCErrorType.etNeedApproval) Then
      Call mo_Tools.SetTextBox(txt_Price, "txt_SummaryPricePCS_A", mo_Tools.DblToScreen(lo_Offer.OFD_PricePCS), False)
      Call mo_Tools.SetTextBox(txt_Price, "txt_SummaryPriceM2_A", mo_Tools.DblToScreen(lo_Offer.OFD_PriceM2), False)
    Else
      Call mo_Tools.SetTextBox(txt_Price, "txt_SummaryPricePCS_A", "", False)
      Call mo_Tools.SetTextBox(txt_Price, "txt_SummaryPriceM2_A", "", False)
    End If
    
    Call DisplayPriceVisibility
  Exit Sub
ErrHandler:
  Call ErrorHandler("DisplayPrice")
End Sub

Private Function CheckStep(ByVal ae_Screen As eDPCScreen) As Boolean
On Error GoTo ErrHandler

Dim lo_ErrCol As Collection
Dim le_Screen As eDPCScreen
Dim ll_Idx As Long

  CheckStep = False
  ' do not check anything when production user editing template
  If IsTemplate Then
    If ae_Screen = eDPCScreen.psPanelSummary Then
      Set lo_ErrCol = mo_PrdConfig.CheckAllScreenTemplate
    Else
      CheckStep = True
      Exit Function
    End If
  Else
    If ae_Screen = eDPCScreen.psPanelSummary Then
      Call ClearAllScreenErrorType
      Set lo_ErrCol = mo_PrdConfig.CheckAllScreen
    Else
      Call ClearScreenErrorType(ae_Screen)
      Set lo_ErrCol = mo_PrdConfig.CheckScreen(ae_Screen)
    End If
  End If
  
  
  
  Call ApplyScreenError(lo_ErrCol)
  If ConfirmCheckList(lo_ErrCol) Then
    If Not mo_PrdTemp Is Nothing Then
      If (mo_PrdConfig.HasErrorID(lo_ErrCol, eDPCError.erBendingPrdChangeDesc)) And _
         (StrComp(mo_PrdConfig.PRD_Name, mo_PrdTemp.PRD_Name, vbTextCompare) = 0) Then
        If mo_Db.Find(mc_ScreenLabels, "Field_name", "lbl_SpecialPanel", , 1) >= 0 Then
          mo_PrdConfig.PRD_Name = mo_Db.GetFields(mc_ScreenLabels, "Local_text")
        Else
          'only in case we do not have it in screen_constants, do a hardcode
          mo_PrdConfig.PRD_Name = "Special panel"
        End If
      End If
    End If
    CheckStep = True
  End If
  Exit Function
ErrHandler:
  Call ErrorHandler("CheckStep")
End Function

Private Function CheckStepCutoutItem(ByVal ae_Category As eDPCCategory, ByVal ao_Cutout As DPC_Cutout) As Boolean
On Error GoTo ErrHandler

Dim lo_ErrCol As New Collection

  Call mo_PrdConfig.CheckCutoutItem(lo_ErrCol, ao_Cutout)
  Call ApplyScreenError(lo_ErrCol)
  CheckStepCutoutItem = ConfirmCheckList(lo_ErrCol)
  Exit Function
ErrHandler:
  Call ErrorHandler("CheckStepCutoutItem")
End Function

Private Function CheckStepInlayItem(ByVal ae_Category As eDPCCategory, ByVal ao_Inlay As DPC_Inlay) As Boolean
On Error GoTo ErrHandler

Dim lo_ErrCol As New Collection

  Call mo_PrdConfig.CheckInlayItem(lo_ErrCol, ao_Inlay)
  Call ApplyScreenError(lo_ErrCol)
  CheckStepInlayItem = ConfirmCheckList(lo_ErrCol)
  Exit Function
ErrHandler:
  Call ErrorHandler("CheckStepInlayItem")
End Function

Private Function ConfirmCheckList(ByVal ao_ErrCol As Collection) As Boolean
On Error GoTo ErrHandler

Dim lo_ErrorMsg As frmDPC_ErrorMsg
  
  ConfirmCheckList = True
  If ao_ErrCol.Count > 0 Then
    Set lo_ErrorMsg = New frmDPC_ErrorMsg
    Load lo_ErrorMsg
    
    Set lo_ErrorMsg.Tools = mo_Tools
    Set lo_ErrorMsg.ArmDb = mo_Db
    lo_ErrorMsg.Language_Code = ms_Language_Code
    lo_ErrorMsg.U_Code = ml_U_Code
    Set lo_ErrorMsg.ErrCollection = ao_ErrCol
    Call lo_ErrorMsg.Load_A_COM
    
    Call mo_Tools.LockScreen(Me, False)
    Call mo_Tools.ShowModalForm(lo_ErrorMsg)
    Call mo_Tools.LockScreen(Me, True)
    
    If lo_ErrorMsg.Result = False Then
      ConfirmCheckList = False
    End If
    Call mo_PrdConfig.UpdateErrorText(lo_ErrorMsg.ErrCollection)
    Call lo_ErrorMsg.Unload_A_COM
    Unload lo_ErrorMsg
  End If
  Exit Function
ErrHandler:
  Call ErrorHandler("ConfirmCheckList")
End Function

Private Sub DisplayCoating()
On Error GoTo ErrHandler

Dim ll_SideIdx As Long

  If mo_Tools.WhichOptionIsTrue(opt_StandardCoating) < 0 Then
    If StrComp(mo_PrdConfig.COA_Id, mo_Tools.GetAConfigData("DPC_Default_COA1"), vbTextCompare) = 0 Then
      opt_StandardCoating(0).Value = True
    ElseIf Trim(mo_PrdConfig.COA_Id) <> "" Then
      opt_StandardCoating(1).Value = True
    End If
  End If
  
  For ll_SideIdx = eDPCSide.esSideC To eDPCSide.esSideF
    chk_SideVisible(ll_SideIdx).Value = IIf(mo_PrdConfig.RPL_BVis(ll_SideIdx), vbChecked, vbUnchecked)
    chk_NotchingClosed(ll_SideIdx).Value = IIf(mo_PrdConfig.RPL_NClo(ll_SideIdx), vbChecked, vbUnchecked)
  Next
  
  If mo_PrdConfig.RPL_CoSid = eDPCCoatingExecution.ceUndef Then
    Call mo_Tools.ResetOptionButton(opt_CoatingSide)
  Else
    If (mo_PrdConfig.RPL_CoSid >= eDPCCoatingExecution.ceOneSide) And (mo_PrdConfig.RPL_CoSid <= eDPCCoatingExecution.ceBackSideFull) Then
      opt_CoatingSide(mo_PrdConfig.RPL_CoSid - 1).Value = True
    End If
  End If
  Call mo_Tools.EnableFrame(UserControl.Controls, fra_CoatingSide, mo_PrdConfig.HasCoating And ((Not IsStandard) Or IsTemplate))
  
  Call mo_Tools.ResetOptionButton(opt_CoatingMaterial)
  If mo_PrdConfig.COA_Mat = eDPCCoatingMaterial.cmPowder Then
    opt_CoatingMaterial(0).Value = True
  ElseIf mo_PrdConfig.COA_Mat = eDPCCoatingMaterial.cmPaint Then
    opt_CoatingMaterial(1).Value = True
  End If
  
  tvw_Coating.Visible = (mo_Tools.WhichOptionIsTrue(opt_StandardCoating) > 0)
  grd_Coating.Visible = (mo_PrdConfig.COA_Type = eDPCCoatingType.ctTopRALNCS) And (opt_StandardCoating(1).Value)
  
  fra_CoatingDetail.Visible = (mo_Tools.WhichOptionIsTrue(opt_StandardCoating) > 0)
  
  Call mo_Tools.SetTextBox(txt_Textbox, "COA_Code", mo_PrdConfig.COA_Code, False)
  Call mo_Tools.SetTextBox(txt_Textbox, "COA_Name", mo_PrdConfig.COA_Name, (mo_PrdConfig.COA_Type = eDPCCoatingType.ctCustomized))
  Call mo_Tools.SetTextBox(txt_Textbox, "COA_Desc", mo_PrdConfig.COA_Desc, (mo_PrdConfig.COA_Type = eDPCCoatingType.ctOtherRALNCS) Or (mo_PrdConfig.COA_Type = eDPCCoatingType.ctCustomized))
  
'  If mo_PrdConfig.COA_IsCus Then
'    Call mo_Tools.SetTextBox(txt_Textbox, "COA_Desc", mo_PrdConfig.GetErrorText(eDPCError.erCoatingCustomSelected), True)
'    Call mo_Tools.SetTextBox(txt_Textbox, "COA_Name", mo_PrdConfig.GetErrorText(eDPCError.erCoatingName), True)
'    'cmd_Coating.Visible = True
'  Else
'    Call mo_Tools.SetTextBox(txt_Textbox, "COA_Desc", mo_PrdConfig.COA_Desc, False)
'    Call mo_Tools.SetTextBox(txt_Textbox, "COA_Name", mo_PrdConfig.COA_Name, False)
'    'cmd_Coating.Visible = False
'  End If
  Exit Sub
ErrHandler:
  Call ErrorHandler("DisplayCoating")
End Sub

Private Sub SetInlayModeList()
On Error GoTo ErrHandler

  fra_Inlay.Visible = False
  me_InlayScreen = eDPCScreenMode.smList
  Exit Sub
ErrHandler:
  Call ErrorHandler("DisplayInlay")
End Sub

Private Sub DisplayInlay()
On Error GoTo ErrHandler

  chk_NoInlay.Value = IIf(mo_PrdConfig.NoInlay, vbChecked, vbUnchecked)
  
  opt_TopPlate(mo_PrdConfig.RPL_Plate).Value = True
  Call mo_Tools.SetTextBox(txt_Textbox, "RPL_PlCnt", mo_Tools.LongToScreen(mo_PrdConfig.RPL_PlCnt), mo_PrdConfig.RPL_Plate <> eDPCPlateType.bpNone, mo_PrdConfig.RPL_Plate <> eDPCPlateType.bpNone)
  Call mo_Tools.SetLabelVisible(lbl_Label, "lbl_RivetNotchCount", mo_PrdConfig.RPL_Plate <> eDPCPlateType.bpNone)
  
  Call DrawInlaySketch(pct_Inlay)
  
  If (Not IsStandard) And (Not IsTemplate) Then
    Call mo_Tools.EnableFrame(Controls, fra_Step(DPC_TAB_STEP_IDX_INLAY), Not mo_PrdTemp.HasInlay)
  End If
  Exit Sub
ErrHandler:
  Call ErrorHandler("DisplayInlay")
End Sub

Private Sub DisplayInlayGrid()
On Error GoTo ErrHandler

  Dim lo_Inlay As DPC_Inlay
  
  Call grd_Inlay.ClearGrid
  For Each lo_Inlay In mo_PrdConfig.Inlays
    If lo_Inlay.RowStatus <> eDPCRowStatus.rsDrop Then
      Call grd_Inlay.AddLine
      Call InlayObjToGrid(lo_Inlay, grd_Inlay.Rows - 1)
    End If
  Next
  Call DrawInlaySketch(pct_Inlay)
  Exit Sub
ErrHandler:
  Call ErrorHandler("DisplayInlayGrid")
End Sub

Private Sub DisplayInlayFrame(ByVal ao_Inlay As DPC_Inlay)
On Error GoTo ErrHandler
  

  chk_StandardInlay.Value = IIf(ao_Inlay.PIN_Std, vbChecked, vbUnchecked)
  Call mo_Tools.SetTextBox(txt_Textbox, "INL_TypeDesc", ao_Inlay.INL_TypeDesc, False)
  Call mo_Tools.SetTextBox(txt_Textbox, "INL_Vend", ao_Inlay.INL_Vend, False)
  Call mo_Tools.SetTextBox(txt_Textbox, "INL_Code", ao_Inlay.INL_Code, False)
  Call mo_Tools.SetTextBox(txt_Textbox, "INL_Name", ao_Inlay.INL_Name, ao_Inlay.INL_IsCus)
  Call mo_Tools.SetTextBox(txt_Textbox, "INL_Desc", ao_Inlay.INL_Desc, ao_Inlay.INL_IsCus)
  btn_Inlay.Visible = ao_Inlay.INL_IsCus
  
  If ao_Inlay.PIN_Deliv = 0 Then
    Set cbo_InlayDelivery.SelectedItem = Nothing
  Else
    If Not cbo_InlayDelivery.SearchItem(ao_Inlay.PIN_Deliv) Then
      Call cbo_InlayDelivery.AddItem(Array(ao_Inlay.PIN_Deliv, ao_Inlay.PIN_DelivDesc), True)
    End If
  End If
  
  If ao_Inlay.PIN_Purch = 0 Then
    Set cbo_InlayPurchase.SelectedItem = Nothing
  Else
    If Not cbo_InlayPurchase.SearchItem(ao_Inlay.PIN_Purch) Then
      Call cbo_InlayPurchase.AddItem(Array(ao_Inlay.PIN_Purch, ao_Inlay.PIN_PurchDesc), True)
    End If
  End If
  cbo_InlayPurchase.Visible = IsProduction
  Call mo_Tools.SetLabelVisible(lbl_Label, "lbl_InlayPurchase", IsProduction)
  
  Call mo_Tools.SetTextBox(txt_Textbox, "PIN_SizeA", mo_Tools.DblToScreen(ao_Inlay.PIN_SizeA), (Not ao_Inlay.PIN_Std) And ((me_InlayScreen = eDPCScreenMode.smAdd) Or (me_InlayScreen = eDPCScreenMode.smUpdate)))
  Call mo_Tools.SetTextBox(txt_Textbox, "PIN_SizeB", mo_Tools.DblToScreen(ao_Inlay.PIN_SizeB), (Not ao_Inlay.PIN_Std) And ((me_InlayScreen = eDPCScreenMode.smAdd) Or (me_InlayScreen = eDPCScreenMode.smUpdate)))
  Call mo_Tools.SetTextBox(txt_Textbox, "INL_Surface", mo_Tools.DblToScreen(ao_Inlay.INL_Surface), False)
  
  'tvw_Inlay.Visible = (me_InlayScreen = eDPCScreenMode.smAdd) Or (me_InlayScreen = eDPCScreenMode.smUpdate)
  fra_InlayType.Visible = (me_InlayScreen = eDPCScreenMode.smAdd) Or (me_InlayScreen = eDPCScreenMode.smUpdate)
  grd_InlayDetail.Visible = (me_InlayScreen = eDPCScreenMode.smAdd) Or (me_InlayScreen = eDPCScreenMode.smUpdate)
  
  Call DisplayPrice(eDPCScreen.psInlay, Nothing, Nothing, ao_Inlay)
  Exit Sub
ErrHandler:
  Call ErrorHandler("DisplayInlayFrame")
End Sub

Private Sub DisplayPacking()
On Error GoTo ErrHandler

  Call InitPackingCombo
  If mo_PrdConfig.HasPacking Then
    If Not cbo_Packing.SearchItem(mo_PrdConfig.PKG_Id) Then
      Call cbo_Packing.AddItem(Array(mo_PrdConfig.PKG_Id, mo_PrdConfig.PKG_Name), True)
    End If
  Else
    Set cbo_Packing.SelectedItem = Nothing
  End If
  chk_SpcPkg.Value = IIf(mo_PrdConfig.RPL_SpcPkg = eDPCSpecialPackage.spThermoPalette, vbChecked, vbUnchecked)
  Call mo_Tools.SetTextValue(txt_Textbox, "RPL_PU_", mo_Tools.DblToScreen(mo_PrdConfig.RPL_PU))
  Exit Sub
ErrHandler:
  Call ErrorHandler("DisplayPacking")
End Sub

Private Sub DisplayLabeling()
On Error GoTo ErrHandler

  Call InitLabelingCombo
  If mo_PrdConfig.HasLabeling Then
    If Not cbo_Labeling.SearchItem(mo_PrdConfig.LAB_Id) Then
      Call cbo_Labeling.AddItem(Array(mo_PrdConfig.LAB_Id, mo_PrdConfig.LAB_Name), True)
    End If
    
    If Not cbo_LabelLanguage.SearchItem(mo_PrdConfig.RPL_LabLng) Then
      Call cbo_LabelLanguage.AddItem(Array(mo_PrdConfig.RPL_LabLng, mo_PrdConfig.RPL_LabLngDesc), True)
    End If
  Else
    Set cbo_Labeling.SelectedItem = Nothing
    Set cbo_LabelLanguage.SelectedItem = Nothing
  End If
  
  If (mo_PrdConfig.RPL_PkgLogo >= 0) And (mo_PrdConfig.RPL_PkgLogo <= opt_PackLogo.Count - 1) Then
    opt_PackLogo(mo_PrdConfig.RPL_PkgLogo).Value = True
  Else
    Call mo_Tools.ResetOptionButton(opt_PackLogo)
  End If
  
  Call mo_Tools.SetTextValue(txt_Textbox, "RPL_LabTxt", mo_PrdConfig.RPL_LabTxt)
  Exit Sub
ErrHandler:
  Call ErrorHandler("DisplayLabeling")
End Sub

Private Sub LoadOptSurcharge()
On Error GoTo ErrHandler

  Dim ls_Request As String
  
  If grd_Option.Rows = 0 Then
    ls_Request = "DPC_Option_lst2 $COF_Lang$, $CT_Code$, $CURR_Code$, $VDate$"
    
    ls_Request = Replace(ls_Request, "$CURR_Code$", mo_Tools.SQLStr(mo_PrdConfig.CURR_Code), , , vbTextCompare)
    ls_Request = Replace(ls_Request, "$CT_Code$", mo_Tools.SQLStr(CT_Code), , , vbTextCompare)
    ls_Request = Replace(ls_Request, "$VDate$", mo_Tools.SqlDate(ValidityDate), , , vbTextCompare)
    ls_Request = ReplaceCommonPlaceholders(ls_Request)
    Call grd_Option.Load(ls_Request, True)
  End If
  Exit Sub
ErrHandler:
  Call ErrorHandler("LoadOptSurcharge")
End Sub

Private Sub DisplayOptSurcharge()
On Error GoTo ErrHandler
   
  Dim lo_Offer As DPC_OfferPos
  Dim ll_Idx As Long
  
  For ll_Idx = 0 To grd_Option.Rows - 1
    grd_Option.Data(ll_Idx, "Selected") = "UNCHECK"
  Next
  
  For Each lo_Offer In mo_PrdConfig.OfferOptions
    If lo_Offer.RowStatus <> eDPCRowStatus.rsDrop Then
      If Not grd_Option.SearchKey(True, lo_Offer.PRD_Id) Then
        Call grd_Option.AddLine
        grd_Option.Row = grd_Option.Rows - 1
      End If
      grd_Option.SelectedLine(0, "OPT_Id") = lo_Offer.PRD_Id
      grd_Option.SelectedLine(0, "Selected") = "CHECK"
      grd_Option.SelectedLine(0, "OPT_Code") = lo_Offer.PRD_Code
      grd_Option.SelectedLine(0, "OPT_Name") = lo_Offer.PRD_Name
      grd_Option.SelectedLine(0, "OPT_Desc") = lo_Offer.PRD_Desc
      grd_Option.SelectedLine(0, "CURR_Code") = lo_Offer.CURR_Code
      grd_Option.SelectedLine(0, "UM_CodeC") = lo_Offer.UM_Code
      grd_Option.SelectedLine(0, "UM_Name") = lo_Offer.UM_Name
      grd_Option.SelectedLine(0, "Qty") = lo_Offer.OFD_Qty
      'grd_Option.SelectedLine(0, "PRC_QMin") = lo_Offer.POP_QMin
      'grd_Option.SelectedLine(0, "PRC_QMax") = lo_Offer.POP_QMax
      grd_Option.SelectedLine(0, "PRC_Cost") = lo_Offer.OFD_Cost
    End If
  Next
  Exit Sub
ErrHandler:
  Call ErrorHandler("DisplayOptSurcharge")
End Sub

Private Sub DisplayVentilation()
On Error GoTo ErrHandler

  Dim lo_Cutout As DPC_Cutout

  If mo_PrdConfig.NoVentilation Then
    chk_NoVentilation.Value = vbChecked
  End If
  
  Call grd_Cutout(0).ClearGrid
  For Each lo_Cutout In mo_PrdConfig.Cutouts
    If lo_Cutout.RowStatus <> eDPCRowStatus.rsDrop Then
      If lo_Cutout.PCT_Type = eDPCCutoutType.eVentilation Then
        Call grd_Cutout(0).AddLine
        Call CutoutObjToGrid(lo_Cutout, grd_Cutout(0), grd_Cutout(0).Rows - 1)
      End If
    End If
  Next
  Exit Sub
ErrHandler:
  Call ErrorHandler("DisplayVentilation")
End Sub

Private Sub DisplayLoudspeaker()
On Error GoTo ErrHandler

  Dim lo_Cutout As DPC_Cutout

  If mo_PrdConfig.NoLoudspeaker Then
    chk_NoLoudspeaker.Value = vbChecked
  End If
  
  Call grd_Cutout(1).ClearGrid
  For Each lo_Cutout In mo_PrdConfig.Cutouts
    If lo_Cutout.RowStatus <> eDPCRowStatus.rsDrop Then
      If lo_Cutout.PCT_Type = eDPCCutoutType.eLoudspeaker Then
        Call grd_Cutout(1).AddLine
        Call CutoutObjToGrid(lo_Cutout, grd_Cutout(1), grd_Cutout(1).Rows - 1)
      End If
    End If
  Next
  Exit Sub
ErrHandler:
  Call ErrorHandler("DisplayLoudspeaker")
End Sub

Private Sub DisplayCutout()
On Error GoTo ErrHandler

  Dim lo_Cutout As DPC_Cutout

  If mo_PrdConfig.NoCutout Then
    chk_NoCutout.Value = vbChecked
  End If
  
  Call grd_Cutout(2).ClearGrid
  For Each lo_Cutout In mo_PrdConfig.Cutouts
    If lo_Cutout.RowStatus <> eDPCRowStatus.rsDrop Then
      If lo_Cutout.PCT_Type = eDPCCutoutType.eCutout Then
        Call grd_Cutout(2).AddLine
        Call CutoutObjToGrid(lo_Cutout, grd_Cutout(2), grd_Cutout(2).Rows - 1)
      End If
    End If
  Next
  Exit Sub
ErrHandler:
  Call ErrorHandler("DisplayCutout")
End Sub

Private Sub DisplayPerforation()
On Error GoTo ErrHandler

  
  If (Not mo_PrdConfig.HasPerforation) And (mo_PrdConfig.NoPerforation = True) Then
    opt_StandardPerforation(0).Value = True
  ElseIf StrComp(mo_PrdConfig.PRF_Id, mo_Tools.GetAConfigData("DPC_Default_PRF1"), vbTextCompare) = 0 Then
    opt_StandardPerforation(1).Value = True
  ElseIf StrComp(mo_PrdConfig.PRF_Id, mo_Tools.GetAConfigData("DPC_Default_PRF2"), vbTextCompare) = 0 Then
    opt_StandardPerforation(2).Value = True
  ElseIf StrComp(mo_PrdConfig.PRF_Id, mo_Tools.GetAConfigData("DPC_Default_PRF3"), vbTextCompare) = 0 Then
    opt_StandardPerforation(3).Value = True
  ElseIf mo_PrdConfig.HasPerforation Then
    opt_StandardPerforation(4).Value = True
  End If
  
  If mo_PrdConfig.PRF_Id = "" Then
    Set cbo_Perforation.SelectedItem = Nothing
  Else
    If Not cbo_Perforation.SearchItem(mo_PrdConfig.PRF_Id) Then
      Call cbo_Perforation.AddItem(Array(mo_PrdConfig.PRF_Id, mo_PrdConfig.PRF_Name), True)
    End If
    Call tvw_Perforation.Find(mo_PrdConfig.PRF_Class, 0, Nothing, 0)
  End If
  Call mo_Tools.DrawDPCImage(mo_Db, mo_FSO, ms_DPCImageCachePath, mo_PrdConfig.IMG_IdPRF, pct_Perforation)
  
  cbo_PerfView.Visible = mo_Tools.WhichOptionIsTrue(opt_StandardPerforation) > 0
  tvw_Perforation.Visible = mo_Tools.WhichOptionIsTrue(opt_StandardPerforation) > 0
  cbo_Perforation.Visible = mo_Tools.WhichOptionIsTrue(opt_StandardPerforation) > 0
  pct_Perforation.Visible = mo_Tools.WhichOptionIsTrue(opt_StandardPerforation) > 0
  
  If (Not IsStandard) And (Not IsTemplate) Then
    Call mo_Tools.EnableFrame(Controls, fra_Step(DPC_TAB_STEP_IDX_PERFORATION), Not mo_PrdTemp.HasPerforation)
    Call mo_Tools.EnableFrame(Controls, fra_PerfDetail, (Not mo_PrdTemp.HasPerforation) And mo_PrdConfig.HasPerforation)
    Call mo_Tools.SetTextEnabled(txt_Price, "txt_PerfPrice_M", CanChangeManualPrice)
  End If
  Exit Sub
ErrHandler:
  Call ErrorHandler("DisplayPerforation")
End Sub

Private Sub DisplayPerforationBorder()
On Error GoTo ErrHandler

Dim ll_SideIdx As Long
Dim ll_Idx As Long

  fra_PRF_Border.Visible = (mo_PrdConfig.RPL_PBord = eDPCPerforationBorderType.pbOther)
  fra_PRF_BorderReal.Visible = mo_PrdConfig.HasPerforation
  fra_PBord.Visible = mo_PrdConfig.HasPerforation
  
  If mo_PrdConfig.RPL_PBord > eDPCPerforationBorderType.pbUndef Then
    opt_UnperfBorder(mo_PrdConfig.RPL_PBord - 1).Value = True
  Else
    Call mo_Tools.ResetOptionButton(opt_UnperfBorder)
  End If
  
  chk_CorrectStep.Value = IIf(mo_PrdConfig.PRF_IsCorrStep, vbChecked, vbUnchecked)
  chk_StandardPerf.Value = IIf(mo_PrdConfig.PRF_IsStandard, vbChecked, vbUnchecked)
  chk_StandardPerf.Enabled = (mo_PrdConfig.RPL_PBord = eDPCPerforationBorderType.pbOther)
  
  
  For ll_SideIdx = eDPCSide.esSideC To eDPCSide.esSideF
    Call mo_Tools.SetTextBox(txt_Textbox, "RPL_UBor" & mv_Edge(ll_SideIdx), mo_Tools.DblToScreen(mo_PrdConfig.RPL_UBor(ll_SideIdx)), False, True)
    Call mo_Tools.SetTextBox(txt_Textbox, "RPL_UBoW" & mv_Edge(ll_SideIdx), mo_Tools.DblToScreen(mo_PrdConfig.RPL_UBoW(ll_SideIdx)), Not mo_PrdConfig.PRF_IsStandard, True)
    chk_PerfBorder(ll_SideIdx).Value = IIf(mo_PrdConfig.RPL_UBoW(ll_SideIdx) >= 0, vbUnchecked, vbChecked)
  Next
    
  If mo_PrdConfig.HasPerforation Then
    Call mo_Tools.SetTextBox(txt_Tech, "PRF_SAMin", mo_Tools.DblToScreen(mo_PrdConfig.PRF_SAMin), False)
    Call mo_Tools.SetTextBox(txt_Tech, "PRF_SAMax", mo_Tools.DblToScreen(mo_PrdConfig.PRF_SAMax), False)
    Call mo_Tools.SetTextBox(txt_Tech, "PRF_SBMin", mo_Tools.DblToScreen(mo_PrdConfig.PRF_SBMin), False)
    Call mo_Tools.SetTextBox(txt_Tech, "PRF_Step", mo_Tools.DblToScreen(mo_PrdConfig.PRF_Step), False)
    Call mo_Tools.SetTextBox(txt_Tech, "PRF_StLim", mo_Tools.DblToScreen(mo_PrdConfig.PRF_StLim), False)
    Call mo_Tools.SetTextBox(txt_Tech, "RPL_SCorr", mo_Tools.DblToScreen(mo_PrdConfig.RPL_SCorr), False)
  Else
    Call mo_Tools.SetTextBox(txt_Tech, "PRF_SAMin", "", False)
    Call mo_Tools.SetTextBox(txt_Tech, "PRF_SAMax", "", False)
    Call mo_Tools.SetTextBox(txt_Tech, "PRF_SBMin", "", False)
    Call mo_Tools.SetTextBox(txt_Tech, "PRF_Step", "", False)
    Call mo_Tools.SetTextBox(txt_Tech, "PRF_StLim", "", False)
    Call mo_Tools.SetTextBox(txt_Tech, "RPL_SCorr", "", False)
  End If
  
  Exit Sub
ErrHandler:
  Call ErrorHandler("DisplayPerforationBorder")
End Sub

Private Sub LoadCboPerfIcon()
On Error GoTo ErrHandler

Dim lo_ComboItem As ArmComboItem
Dim ll_Idx As Long
Dim ld_PRF_MaxPW As Double, ld_PRF_MaxTW As Double, ld_PRF_MaxST As Double, ld_PRF_MaxAT As Double
Dim le_LEV_Id As eDPCLevel
Dim lc_Cursor As Long
Dim ls_Request As String

  ls_Request = "exec DPC_Perforation_lst $COF_Lang$"
  ls_Request = ReplaceCommonPlaceholders(ls_Request)
  lc_Cursor = mo_Tools.OpenSQLSafe(mo_Db, ls_Request)
  If cbo_Perforation.Count < 3 Then
    Call cbo_Perforation.Load
  End If
  
  For ll_Idx = 1 To cbo_Perforation.Count
    Set lo_ComboItem = cbo_Perforation.ComboItems(ll_Idx)
    If Trim(lo_ComboItem.Key) <> "" Then
      If mo_Db.Find(lc_Cursor, "PRD_Id", lo_ComboItem.Key) >= 0 Then
        ld_PRF_MaxPW = mo_Db.GetFields(lc_Cursor, "PRF_MaxPW")
        ld_PRF_MaxTW = mo_Db.GetFields(lc_Cursor, "PRF_MaxTW")
        ld_PRF_MaxST = mo_Db.GetFields(lc_Cursor, "PRF_MaxST")
        ld_PRF_MaxAT = mo_Db.GetFields(lc_Cursor, "PRF_MaxAT")
        le_LEV_Id = mo_Db.GetFields(lc_Cursor, "LEV_Id")
        If IsPerfValid(ld_PRF_MaxPW, ld_PRF_MaxTW, ld_PRF_MaxST, ld_PRF_MaxAT) Then
          If le_LEV_Id > eDPCLevel.lvStandard Then
            lo_ComboItem.Image = eDPCErrorType.etNeedApproval
          Else
            lo_ComboItem.Image = 0
          End If
        Else
          lo_ComboItem.Image = eDPCErrorType.etStop
        End If
      End If
    Else
      lo_ComboItem.Image = eDPCErrorType.etStop
    End If
  Next
  Call mo_Db.Close(lc_Cursor)
  Exit Sub
ErrHandler:
  Call ErrorHandler("LoadCboPerfIcon")
End Sub

Private Sub DisplayTvwPerfIcon()
On Error GoTo ErrHandler

Dim lo_TreeNodeInfo As NodeInfo
Dim lo_TreeNode As MSComctlLib.Node
Dim ll_Idx As Long
Dim ld_PRF_MaxPW As Double, ld_PRF_MaxTW As Double, ld_PRF_MaxST As Double, ld_PRF_MaxAT As Double
Dim le_LEV_Id As eDPCLevel

  For ll_Idx = 1 To tvw_Perforation.Count
    Set lo_TreeNode = tvw_Perforation.Nodes(ll_Idx)
    Set lo_TreeNodeInfo = tvw_Perforation.NodeInfo(lo_TreeNode)
    If lo_TreeNodeInfo.ml_Level = tvw_Perforation.Levels - 1 Then
      ld_PRF_MaxPW = lo_TreeNodeInfo.GetData(3)
      ld_PRF_MaxTW = lo_TreeNodeInfo.GetData(4)
      ld_PRF_MaxST = lo_TreeNodeInfo.GetData(5)
      ld_PRF_MaxAT = lo_TreeNodeInfo.GetData(6)
      le_LEV_Id = lo_TreeNodeInfo.GetData(7)
      If IsPerfValid(ld_PRF_MaxPW, ld_PRF_MaxTW, ld_PRF_MaxST, ld_PRF_MaxAT) Then
        If le_LEV_Id > eDPCLevel.lvStandard Then
          lo_TreeNode.Image = 21
        End If
      Else
        lo_TreeNode.Image = 22
      End If
      lo_TreeNode.SelectedImage = lo_TreeNode.Image
    End If
  Next
  Exit Sub
ErrHandler:
  Call ErrorHandler("DisplayTvwPerfIcon")
End Sub

Public Sub DisplayGasket()
On Error GoTo ErrHandler
Dim ll_SideIdx As Long

  If mo_PrdConfig.RPL_GskDe = eDPCGasketDelivery.gdUndef Then
    Call mo_Tools.ResetOptionButton(opt_Gasket)
  Else
    opt_Gasket(mo_PrdConfig.RPL_GskDe - 1).Value = True
  End If
  Call mo_Tools.EnableFrame(UserControl.Controls, fra_GasketDelivery, (mo_PrdConfig.IsGasketAllowed And (Not IsStandard)) Or IsTemplate)
  For ll_SideIdx = eDPCSide.esSideC To eDPCSide.esSideF
    Call DisplayGasketSide(ll_SideIdx)
  Next
  Exit Sub
ErrHandler:
  Call ErrorHandler("DisplayGasket")
End Sub

Private Sub DisplayGasketSide(ByVal Index As Long)
On Error GoTo ErrHandler

  chk_Gasket(Index).Visible = ((mo_PrdConfig.RPL_Gap(Index) > 0) And mo_PrdConfig.IsGasketAllowedOn(Index)) Or mo_PrdConfig.GTT_Selected(Index) Or IsTemplate
  If mo_PrdConfig.GTT_Selected(Index) Then
    If mo_PrdConfig.IsGasketOn(Index) Then
      If Not cbo_GSK(Index).SearchItem(mo_PrdConfig.GSK_Id(Index)) Then
        Call cbo_GSK(Index).AddItem(Array(mo_PrdConfig.GSK_Id(Index), mo_PrdConfig.GSK_Name(Index)), True)
      End If
    Else
      Call cbo_GSK(Index).Clear
    End If
    Call mo_Tools.DrawDPCImage(mo_Db, mo_FSO, ms_DPCImageCachePath, mo_PrdConfig.IMG_IdGSK(Index), pct_Gasket(Index), "")
    chk_Gasket(Index).Value = vbChecked
    cbo_GSK(Index).Visible = True
    pct_Gasket(Index).Visible = True
  Else
    chk_Gasket(Index).Value = vbUnchecked
    cbo_GSK(Index).Visible = False
    pct_Gasket(Index).Visible = False
  End If
  Exit Sub
ErrHandler:
  Call ErrorHandler("DisplayGasketSide")
End Sub

Public Sub DisplaySpacer()
On Error GoTo ErrHandler
Dim ll_SideIdx As Long

  If mo_PrdConfig.RPL_SpcDe = eDPCSpacerDelivery.sdUndef Then
    Call mo_Tools.ResetOptionButton(opt_Spacer)
  Else
    opt_Spacer(mo_PrdConfig.RPL_SpcDe - 1).Value = True
  End If
  Call mo_Tools.EnableFrame(UserControl.Controls, fra_SpacerDelivery, (mo_PrdConfig.IsSpacerAllowed And (Not IsStandard)) Or IsTemplate)
  For ll_SideIdx = eDPCSide.esSideC To eDPCSide.esSideF
    Call DisplaySpacerSide(ll_SideIdx)
  Next
  Exit Sub
ErrHandler:
  Call ErrorHandler("DisplaySpacer")
End Sub

Private Sub DisplaySpacerSide(ByVal Index As Long)
On Error GoTo ErrHandler

  
  chk_Gasket2(Index).Visible = ((mo_PrdConfig.RPL_Gap(Index) > 0) And mo_PrdConfig.IsSpacerAllowedOn(Index)) Or mo_PrdConfig.GTT_Selected2(Index) Or IsTemplate
  If mo_PrdConfig.GTT_Selected2(Index) Then
  
    If mo_PrdConfig.IsSpacerOn(Index) Then
      If Not cbo_GSK2(Index).SearchItem(mo_PrdConfig.GSK_Id2(Index)) Then
        Call cbo_GSK2(Index).AddItem(Array(mo_PrdConfig.GSK_Id2(Index), mo_PrdConfig.GSK_Name2(Index)), True)
      End If
    Else
      Set cbo_GSK2(Index).SelectedItem = Nothing
    End If
    Call mo_Tools.DrawDPCImage(mo_Db, mo_FSO, ms_DPCImageCachePath, mo_PrdConfig.IMG_Id2GSK(Index), pct_Gasket2(Index), "")
    chk_Gasket2(Index).Value = vbChecked
    cbo_GSK2(Index).Visible = True
    pct_Gasket2(Index).Visible = True
  Else
    chk_Gasket2(Index).Value = vbUnchecked
    cbo_GSK2(Index).Visible = False
    pct_Gasket2(Index).Visible = False
  End If
  Exit Sub
ErrHandler:
  Call ErrorHandler("DisplaySpacerSide")
End Sub

Public Sub DisplaySummary()
On Error GoTo ErrHandler

Dim lo_Collection As Collection
Dim lo_Offer As DPC_OfferPos
Dim ll_Idx As Long
    
'  If mo_PrdConfig.CLS_IdFIR <> 0 Then
'    If Not cbo_FireClass.SearchItem(mo_PrdConfig.CLS_IdFIR) Then
'      Call cbo_FireClass.AddItem(Array(mo_PrdConfig.CLS_IdFIR, mo_PrdConfig.CLS_NameFIR), True)
'    End If
'  Else
'    Set cbo_FireClass.SelectedItem = Nothing
'  End If
  
  If mo_PrdConfig.LEV_Id = eDPCLevel.lvNone Then
    Set cbo_Level.SelectedItem = Nothing
  Else
    Call cbo_Level.Clear
    Call cbo_Level.AddItem(Array(mo_PrdConfig.LEV_Id, "", mo_PrdConfig.LEV_Id + 3), True)
  End If
  cbo_Level.Enabled = IsTemplate
    
  Set lo_Collection = GenerateOfferDetail
  
  Call grd_Summary.ClearGrid
  For ll_Idx = 1 To lo_Collection.Count
    Set lo_Offer = lo_Collection(ll_Idx)
    If (lo_Offer.OFD_Valid) Then
      Call grd_Summary.AddLine
      grd_Summary.Data(grd_Summary.Rows - 1, "CAT_Id") = lo_Offer.CAT_Id
      grd_Summary.Data(grd_Summary.Rows - 1, "PRD_Id") = lo_Offer.PRD_Id
      grd_Summary.Data(grd_Summary.Rows - 1, "LEV_Id") = "Level" & lo_Offer.LEV_Id
      grd_Summary.Data(grd_Summary.Rows - 1, "PRD_Code") = lo_Offer.PRD_Code
      grd_Summary.Data(grd_Summary.Rows - 1, "PRD_Name") = lo_Offer.PRD_Name
      If Not lo_Offer.DOF_IsTxt Then
        grd_Summary.Data(grd_Summary.Rows - 1, "OFD_Qty") = mo_Tools.DblToScreen(lo_Offer.OFD_Qty)
        grd_Summary.Data(grd_Summary.Rows - 1, "UM_Code") = lo_Offer.UM_Code
        grd_Summary.Data(grd_Summary.Rows - 1, "UM_Name") = lo_Offer.UM_Name
        grd_Summary.Data(grd_Summary.Rows - 1, "OFD_Cost") = mo_Tools.DblToScreen(lo_Offer.OFD_Cost)
        grd_Summary.Data(grd_Summary.Rows - 1, "OFD_TotalC") = mo_Tools.DblToScreen(lo_Offer.OFD_TotalC)
        grd_Summary.Data(grd_Summary.Rows - 1, "OFD_Price") = mo_Tools.DblToScreen(lo_Offer.OFD_Price)
        grd_Summary.Data(grd_Summary.Rows - 1, "OFD_TotalP") = mo_Tools.DblToScreen(lo_Offer.OFD_TotalP)
      End If
    End If
  Next
  grd_Summary.LineColor(0) = COLOR_SUBREPLACE
  Call grd_Summary.SetAutoRowHeight("PRD_Name")
  Exit Sub
ErrHandler:
  Call ErrorHandler("DisplaySummary")
End Sub

Private Sub LoadPrice()
On Error GoTo ErrHandler

Dim lo_Inlay As DPC_Inlay
Dim lo_Cutout As DPC_Cutout

  If IsTemplate Then Exit Sub
  
  Call mo_PrdConfig.LoadPanelPrice
  Call mo_PrdConfig.LoadGasketPrice
  Call mo_PrdConfig.LoadSpacerPrice
  Call mo_PrdConfig.LoadPerforationPrice
  Call mo_PrdConfig.LoadCoatingPrice
  For Each lo_Inlay In mo_PrdConfig.Inlays
    If lo_Inlay.RowStatus <> eDPCRowStatus.rsDrop Then
      Call mo_PrdConfig.LoadInlayPrice(lo_Inlay)
    End If
  Next
  For Each lo_Cutout In mo_PrdConfig.Cutouts
    If lo_Cutout.RowStatus <> eDPCRowStatus.rsDrop Then
      Select Case lo_Cutout.PCT_Type
      Case eDPCCutoutType.eLoudspeaker
        Call mo_PrdConfig.LoadLoudspeakerPrice(lo_Cutout)
      Case eDPCCutoutType.eVentilation
        Call mo_PrdConfig.LoadVentilationPrice(lo_Cutout)
      Case eDPCCutoutType.eCutout
        Call mo_PrdConfig.LoadCutoutPrice(lo_Cutout)
      Case Else
        Err.Raise ArmErr.InvalidArgument, "lo_Cutout.PCT_Type", "Unknown cutout type: " & lo_Cutout.PCT_Type
      End Select
    End If
  Next
  Call mo_PrdConfig.LoadPackingPrice
  Call mo_PrdConfig.LoadLabelingPrice
  Call DisplayPrice(eDPCScreen.psPanelSummary)
  Exit Sub
ErrHandler:
  Call ErrorHandler("LoadPrice")
End Sub

Private Sub LoadPanelPrice()
On Error GoTo ErrHandler

  Call mo_PrdConfig.LoadPanelPrice
  Call DisplayPrice(eDPCScreen.psPanel)
  Exit Sub
ErrHandler:
  Call ErrorHandler("LoadPanelPrice")
End Sub

Private Sub LoadGasketPrice()
On Error GoTo ErrHandler

  Call mo_PrdConfig.LoadGasketPrice
  Call DisplayPrice(eDPCScreen.psGasket)
  Exit Sub
ErrHandler:
  Call ErrorHandler("LoadGasketPrice")
End Sub

Private Sub LoadSpacerPrice()
On Error GoTo ErrHandler

  Call mo_PrdConfig.LoadSpacerPrice
  Call DisplayPrice(eDPCScreen.psGasket)
  Exit Sub
ErrHandler:
  Call ErrorHandler("LoadSpacerPrice")
End Sub

Private Sub LoadPerforationPrice()
On Error GoTo ErrHandler
  
  Call mo_PrdConfig.LoadPerforationPrice
  Call DisplayPrice(eDPCScreen.psPerforation)
  Exit Sub
ErrHandler:
  Call ErrorHandler("LoadPerforationPrice")
End Sub

Private Sub LoadCoatingPrice()
On Error GoTo ErrHandler
  
  Call mo_PrdConfig.LoadCoatingPrice
  Call DisplayPrice(eDPCScreen.psCoating)
  Exit Sub
ErrHandler:
  Call ErrorHandler("LoadCoatingPrice")
End Sub

Private Sub LoadInlayPrice(ByVal ao_Inlay As DPC_Inlay)
On Error GoTo ErrHandler
  
  Call mo_PrdConfig.LoadInlayPrice(ao_Inlay)
  Call DisplayPrice(eDPCScreen.psInlay, , , ao_Inlay)
  Exit Sub
ErrHandler:
  Call ErrorHandler("LoadInlayPrice")
End Sub

Private Sub LoadVentPrice(ByVal ao_Cutout As DPC_Cutout)
On Error GoTo ErrHandler
  
  Call mo_PrdConfig.LoadVentilationPrice(ao_Cutout)
  Call DisplayPrice(eDPCScreen.psVentilation, ao_Cutout)
  Exit Sub
ErrHandler:
  Call ErrorHandler("LoadVentPrice")
End Sub

Private Sub LoadLoudPrice(ByVal ao_Cutout As DPC_Cutout)
On Error GoTo ErrHandler
  
  Call mo_PrdConfig.LoadLoudspeakerPrice(ao_Cutout)
  Call DisplayPrice(eDPCScreen.psLoudspeaker, ao_Cutout)
  Exit Sub
ErrHandler:
  Call ErrorHandler("LoadLoudPrice")
End Sub

Private Sub LoadCutoutPrice(ByVal ao_Cutout As DPC_Cutout)
On Error GoTo ErrHandler
  
  Call mo_PrdConfig.LoadCutoutPrice(ao_Cutout)
  Call DisplayPrice(eDPCScreen.psCutout, ao_Cutout)
  Exit Sub
ErrHandler:
  Call ErrorHandler("LoadCutoutPrice")
End Sub

Private Sub LoadPackingPrice()
On Error GoTo ErrHandler
  
  Call mo_PrdConfig.LoadPackingPrice
  Call DisplayPrice(eDPCScreen.psPacking)
  Exit Sub
ErrHandler:
  Call ErrorHandler("LoadPackingPrice")
End Sub

Private Sub LoadLabelingPrice()
On Error GoTo ErrHandler
  
  Call mo_PrdConfig.LoadLabelingPrice
  Call DisplayPrice(eDPCScreen.psPacking)
  Exit Sub
ErrHandler:
  Call ErrorHandler("LoadLabelingPrice")
End Sub

Private Sub LoadTreeView(ByVal ao_Tree As ArmTreeView, ByVal av_TreeviewInfo As Variant)
On Error GoTo ErrHandler

  Dim lv_NodeReq As Variant
  Dim lv_GridReq As Variant
  Dim lv_Images As Variant
  Dim lv_SelectedImages As Variant
  Dim ll_Levels As Long, ll_Idx As Long
  
  lv_NodeReq = av_TreeviewInfo(0)
  lv_GridReq = av_TreeviewInfo(1)
  lv_Images = av_TreeviewInfo(2)
  lv_SelectedImages = av_TreeviewInfo(3)
  
  ll_Levels = UBound(lv_NodeReq) + 1
  If ll_Levels > 0 Then
    ao_Tree.Levels = ll_Levels
    For ll_Idx = 0 To ll_Levels - 1
      lv_NodeReq(ll_Idx) = ReplaceCommonPlaceholders(lv_NodeReq(ll_Idx))
    Next
    ao_Tree.NodeRequests = lv_NodeReq
    ao_Tree.GridRequests = lv_GridReq
    ao_Tree.Images = lv_Images
    ao_Tree.SelectedImages = lv_SelectedImages
    If Not ao_Tree.LoadTree(LoadTypeChildsDemand) Then
      Err.Raise ArmErr.CompFncFailed, "ao_Tree.LoadTree(LoadTypeChildsDemand)", "Tree load failed: " & lv_NodeReq(0)
    End If
  End If
  Exit Sub
ErrHandler:
  Call ErrorHandler("LoadTreeView")
End Sub

Private Sub LoadGrid(ByVal ao_Tree As ArmTreeView, ByVal ao_grid As ArmGrid, ByVal ao_Toolbar As ToolbarControl, ByVal ao_Frame As VB.Frame, ByVal ab_DelayedLoad As Boolean)
On Error GoTo ErrHandler

Dim lv_Requests As Variant

  If ao_Tree.SelectedItem Is Nothing Then
    ao_grid.Visible = False
  Else
    lv_Requests = ApplyTVFilters(ao_Tree.SelectedNodeRequest, ao_Frame, ao_Tree, ao_Toolbar)
    If Not ao_grid.Load(lv_Requests, False, , , ab_DelayedLoad) Then
      Err.Raise ArmErr.CompFncFailed, "ao_Grid.Load", "Method Load failed: " & lv_Requests(0)
    End If
    ao_grid.Visible = True
  End If
  Exit Sub
ErrHandler:
  Call ErrorHandler("LoadGrid")
End Sub

Private Function ApplyTVFilters(ByVal av_Request As Variant, ByVal ao_Frame As VB.Frame, ByVal ao_Tree As ArmTreeView, ByVal ao_Toolbar As ToolbarControl) As Variant
On Error GoTo ErrHandler
    Dim lv_Requests As Variant
    
    If IsArray(av_Request) Then
      ReDim lv_Requests(UBound(av_Request))
      Dim ll_Idx As Long, ll_Count As Long
      ll_Count = UBound(lv_Requests)
      For ll_Idx = 0 To ll_Count
        If Not (ao_Frame Is Nothing) Then
          lv_Requests(ll_Idx) = mo_Tools.ReplaceRequestByFrameData(av_Request(ll_Idx), UserControl.Controls, ao_Frame)
        End If
        If Not (ao_Tree Is Nothing) Then
          lv_Requests(ll_Idx) = mo_Tools.ReplacePlaceholderByControlValue(lv_Requests(ll_Idx), ao_Tree)
        End If
        If Not (ao_Toolbar Is Nothing) Then
          lv_Requests(ll_Idx) = mo_Tools.ReplaceLanguagePlaceholderFromToolbar(lv_Requests(ll_Idx), ao_Toolbar)
        End If
        lv_Requests(ll_Idx) = ReplaceCommonPlaceholders(lv_Requests(ll_Idx))
      Next
    Else
      ReDim lv_Requests(0)
      If Not (ao_Frame Is Nothing) Then
        lv_Requests(0) = mo_Tools.ReplaceRequestByFrameData(av_Request, UserControl.Controls, ao_Frame)
      End If
      If Not (ao_Tree Is Nothing) Then
        lv_Requests(0) = mo_Tools.ReplacePlaceholderByControlValue(lv_Requests(0), ao_Tree)
      End If
      If Not (ao_Toolbar Is Nothing) Then
        lv_Requests(0) = mo_Tools.ReplaceLanguagePlaceholderFromToolbar(lv_Requests(0), ao_Toolbar)
      End If
      lv_Requests(0) = ReplaceCommonPlaceholders(lv_Requests(0))
    End If

    ApplyTVFilters = lv_Requests
    Exit Function
ErrHandler:
    Call ErrorHandler("ApplyTVFilters")
End Function

Private Sub ShowCoatingGrid(ByVal ae_CoatingType As eDPCCoatingType)
On Error GoTo ErrHandler

Dim lo_BOM As DPC_BOM
  
  If (ae_CoatingType = eDPCCoatingType.ctUndef) Or (ae_CoatingType = eDPCCoatingType.ctCustomized) Then
    grd_Coating.Visible = False
  ElseIf ae_CoatingType = eDPCCoatingType.ctTopRALNCS Then
    grd_Coating.Visible = True
  ElseIf ae_CoatingType = eDPCCoatingType.ctOtherRALNCS Then
  
'    If mo_BOMSel Is Nothing Then
'        Set mo_BOMSel = UserControl.Controls.Add("Project1.DPC_BOMSel", "mo_BOMSel")
'        Call mo_BOMSel.Move(grd_Coating.Left, grd_Coating.Top, grd_Coating.Width, grd_Coating.Height)
'        Set mo_BOMSel.ArmDb = mo_Db
'        Set mo_BOMSel.ArmDbBaeurer = mo_DbBaeurer
'        mo_BOMSel.Language_Code = gut_LangLogin.Code
'        mo_BOMSel.U_Code = 0
'
'        If Not mo_BOMSel.Load_A_Com Then
'            MsgBox "Unable to launch DPC_BOMSel"
'            Call mo_BOMSel.Unload_A_Com
'        End If
'    End If
'    mo_BOMSel.Visible = True
'    Call mo_BOMSel.Zorder
    grd_Coating.Visible = False
    If mo_Tools.ReconnectSafe(mo_DbBaeurer, ms_BaeurerServer, ms_BaeurerDatabase, ms_BaeurerLoginName, ms_BaeurerPassword, ms_BaeurerSource) Then
      Set lo_BOM = SelectRawMaterial(eDPCBOMMaterial.bcCoating, False)
      If Not lo_BOM Is Nothing Then
        mo_PrdConfig.COA_Code = lo_BOM.BOM_IdentNr
        mo_PrdConfig.COA_Name = lo_BOM.BOM_Name
        mo_PrdConfig.COA_Desc = lo_BOM.Ben1
        Call mo_PrdConfig.SetErrorText(eDPCError.erCoatingName, mo_PrdConfig.COA_Name, Nothing)
        Call mo_PrdConfig.SetErrorText(eDPCError.erCoatingDesc, mo_PrdConfig.COA_Desc, Nothing)
        Call DisplayCoating
      End If
    End If
  End If
  Exit Sub
ErrHandler:
  Call ErrorHandler("ShowCoatingGrid")
End Sub

Private Function ReplaceCommonPlaceholders(ByVal as_Request As String) As String
On Error GoTo ErrHandler

  as_Request = Replace(as_Request, "$Z_Creator$", mo_Tools.SqlInt(ml_U_Code), , , vbTextCompare)
  as_Request = Replace(as_Request, "$U_Code$", mo_Tools.SqlInt(ml_U_Code), , , vbTextCompare)
  as_Request = Replace(as_Request, "$Z_Last_Upd_User$", mo_Tools.SqlInt(ml_U_Code), , , vbTextCompare)
  as_Request = Replace(as_Request, "$Language_Code$", mo_Tools.SQLStr(ms_Language_Code), , , vbTextCompare)
  as_Request = Replace(as_Request, "$COF_Lang$", mo_Tools.SQLStr(ms_COF_Lang), , , vbTextCompare)
  ReplaceCommonPlaceholders = as_Request
  Exit Function
ErrHandler:
  Call ErrorHandler("ReplaceCommonPlaceholders")
End Function

' display standard error message
Public Sub ErrorMessage(ByVal as_Fct As String)
    Dim ls_ErrSource As String
    Dim ls_errDescription As String
    Dim ls_Message As String
    
    ls_ErrSource = as_Fct & SEP1 & Err.Source
    ls_errDescription = Err.Description
    ls_Message = SCREEN_NAME & " exception. Nr:" & Err.Number & ",Desc: " & ls_errDescription & ",Src:" & ls_ErrSource & "@"
    Call mo_Tools.LogMessage(mo_Db, ml_U_Code, SCREEN_NAME, ls_Message, "E")
    Call MsgBox("Error occured, please contact IT. Application will now shutdown." & vbCrLf & ls_ErrSource & vbCrLf & "Description: " & ls_errDescription, vbCritical, App.Title & " " & App.Major & "." & App.Minor & "." & App.Revision)
    End
End Sub

' Standard error handler
Private Sub ErrorHandler(ByVal as_Fct As String)
  
    Call Err.Raise(Err.Number, Extender.Name & "." & as_Fct & SEP1 & Err.Source, Err.Description)
End Sub

