VERSION 5.00
Begin VB.Form frmDen 
   Caption         =   "Maximos"
   ClientHeight    =   1410
   ClientLeft      =   24015
   ClientTop       =   4620
   ClientWidth     =   2580
   BeginProperty Font 
      Name            =   "Arial"
      Size            =   12
      Charset         =   0
      Weight          =   400
      Underline       =   0   'False
      Italic          =   0   'False
      Strikethrough   =   0   'False
   EndProperty
   KeyPreview      =   -1  'True
   LinkTopic       =   "Form1"
   ScaleHeight     =   1410
   ScaleWidth      =   2580
   ShowInTaskbar   =   0   'False
   Begin VB.CommandButton cmdAceptar 
      Caption         =   "Aceptar"
      Height          =   360
      Left            =   525
      TabIndex        =   2
      Top             =   870
      Width           =   1530
   End
   Begin VB.TextBox txt 
      Alignment       =   1  'Right Justify
      Height          =   390
      Index           =   0
      Left            =   1763
      TabIndex        =   1
      Text            =   "15"
      Top             =   210
      Width           =   645
   End
   Begin VB.Label lblDenom 
      Alignment       =   1  'Right Justify
      BackStyle       =   0  'Transparent
      Caption         =   "Denom"
      Height          =   270
      Index           =   0
      Left            =   173
      TabIndex        =   0
      Top             =   270
      Width           =   1365
   End
End
Attribute VB_Name = "frmDen"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit

Public CK As CKeeperLibV2.CKeeper

Public Sub ShowMax()
    Dim i As Integer
    Dim cnt As Integer
    
    cnt = 0
    For i = LBound(CCC) To UBound(CCC)
        If cnt > 0 Then
            Load lblDenom(cnt)
            lblDenom(cnt).Top = lblDenom(0).Top + (510 * cnt)
            lblDenom(cnt).Visible = True
            Load txt(cnt)
            txt(cnt).Top = txt(0).Top + (510 * cnt)
            txt(cnt).Visible = True
        End If
        lblDenom(cnt).Caption = Format(CCur(CCC(i).Valor) / 100, "standard")
        txt(cnt).text = CCC(i).max
        cnt = cnt + 1
    Next i
    For i = LBound(CCN) To UBound(CCN)
        If cnt > 0 Then
            Load lblDenom(cnt)
            lblDenom(cnt).Top = lblDenom(0).Top + (510 * cnt)
            lblDenom(cnt).Visible = True
            Load txt(cnt)
            txt(cnt).Top = txt(0).Top + (510 * cnt)
            txt(cnt).Visible = True
        End If
        lblDenom(cnt).Caption = Format(CCur(CCN(i).Valor) / 100, "standard")
        txt(cnt).text = CCN(i).max
        cnt = cnt + 1
    Next i
    cmdAceptar.Top = lblDenom(0).Top + (510 * cnt)
    cmdAceptar.TabIndex = 50
    Me.Height = 1050 + cmdAceptar.Top
End Sub

Private Sub cmdAceptar_Click()
    Dim i As Integer
    Dim cnt As Integer
    Dim denoms As String
    Dim values As String
    
    cnt = 0
    For i = LBound(CCC) To UBound(CCC)
        If Len(denoms) > 0 Then
            denoms = denoms & ","
            values = values & ","
        End If
        denoms = denoms & CCC(i).Valor
        values = values & txt(cnt).text
        CCC(i).max = CInt(txt(cnt).text)
        cnt = cnt + 1
    Next i
    For i = LBound(CCN) To UBound(CCN)
        If Len(denoms) > 0 Then
            denoms = denoms & ","
            values = values & ","
        End If
        denoms = denoms & CCN(i).Valor
        values = values & txt(cnt).text
        CCN(i).max = CInt(txt(cnt).text)
        cnt = cnt + 1
    Next i
    If Not CK.SetMaxLevel(denoms, values) Then
        MsgBox "error SetMaxLevel"
        LoadMaxLevels
    End If
    Unload Me
End Sub

Private Sub Form_KeyUp(KeyCode As Integer, Shift As Integer)
    If KeyCode = vbKeyReturn And ((Shift And 6) = 0) Then
        SendKeys "{TAB}"
    End If
End Sub

Private Sub txt_LostFocus(Index As Integer)
    If Not IsNumeric(txt(Index).text) Then
        txt(Index).text = 0
    Else
        txt(Index).text = Val(txt(Index).text) \ 1
    End If
End Sub

Private Sub txt_Validate(Index As Integer, Cancel As Boolean)
    If Not IsNumeric(Replace(txt(Index).text, ".", ",")) Then
        Cancel = True
    End If
End Sub
