VERSION 5.00
Begin VB.Form frmMoneyQuery 
   BackColor       =   &H00404040&
   BorderStyle     =   0  'None
   Caption         =   "Question"
   ClientHeight    =   2415
   ClientLeft      =   7035
   ClientTop       =   4110
   ClientWidth     =   4320
   KeyPreview      =   -1  'True
   LinkTopic       =   "Form2"
   ScaleHeight     =   161
   ScaleMode       =   3  'Pixel
   ScaleWidth      =   288
   ShowInTaskbar   =   0   'False
   Begin VB.CheckBox chkMinus 
      BackColor       =   &H00404040&
      Caption         =   "+"
      BeginProperty Font 
         Name            =   "Verdana"
         Size            =   21.75
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H0000FF00&
      Height          =   660
      Left            =   90
      Style           =   1  'Graphical
      TabIndex        =   18
      Top             =   720
      Width           =   375
   End
   Begin Synapsis.SimpleButton btnDown 
      Height          =   240
      Index           =   4
      Left            =   540
      TabIndex        =   3
      Top             =   1395
      Width           =   690
      _ExtentX        =   2487
      _ExtentY        =   1931
      Picture         =   "frmSimpleQuery.frx":0000
   End
   Begin VB.CommandButton cmdCancel 
      BackColor       =   &H00606060&
      Caption         =   "&Cancelar"
      BeginProperty Font 
         Name            =   "Tahoma"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   285
      Left            =   3240
      Style           =   1  'Graphical
      TabIndex        =   2
      Top             =   2070
      Width           =   1005
   End
   Begin VB.CommandButton cmdOk 
      BackColor       =   &H00606060&
      Caption         =   "&Ok"
      BeginProperty Font 
         Name            =   "Tahoma"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   285
      Left            =   2160
      Style           =   1  'Graphical
      TabIndex        =   1
      Top             =   2070
      Width           =   1005
   End
   Begin Synapsis.MicroHeader mchMain 
      Align           =   1  'Align Top
      Height          =   255
      Left            =   0
      TabIndex        =   0
      Top             =   0
      Width           =   4320
      _ExtentX        =   7620
      _ExtentY        =   450
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "Tahoma"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Caption         =   "Informe o valor a ser creditado"
   End
   Begin Synapsis.SimpleButton btnUp 
      Height          =   240
      Index           =   4
      Left            =   540
      TabIndex        =   4
      Top             =   450
      Width           =   690
      _ExtentX        =   2487
      _ExtentY        =   1931
      Picture         =   "frmSimpleQuery.frx":0912
   End
   Begin Synapsis.SimpleButton btnDown 
      Height          =   240
      Index           =   3
      Left            =   1260
      TabIndex        =   6
      Top             =   1395
      Width           =   690
      _ExtentX        =   2487
      _ExtentY        =   1931
      Picture         =   "frmSimpleQuery.frx":1224
   End
   Begin Synapsis.SimpleButton btnUp 
      Height          =   240
      Index           =   3
      Left            =   1260
      TabIndex        =   7
      Top             =   450
      Width           =   690
      _ExtentX        =   2487
      _ExtentY        =   1931
      Picture         =   "frmSimpleQuery.frx":1B36
   End
   Begin Synapsis.SimpleButton btnDown 
      Height          =   240
      Index           =   2
      Left            =   1980
      TabIndex        =   9
      Top             =   1395
      Width           =   690
      _ExtentX        =   2487
      _ExtentY        =   1931
      Picture         =   "frmSimpleQuery.frx":2448
   End
   Begin Synapsis.SimpleButton btnUp 
      Height          =   240
      Index           =   2
      Left            =   1980
      TabIndex        =   10
      Top             =   450
      Width           =   690
      _ExtentX        =   2487
      _ExtentY        =   1931
      Picture         =   "frmSimpleQuery.frx":2D5A
   End
   Begin Synapsis.SimpleButton btnDown 
      Height          =   240
      Index           =   1
      Left            =   2790
      TabIndex        =   12
      Top             =   1395
      Width           =   690
      _ExtentX        =   2487
      _ExtentY        =   1931
      Picture         =   "frmSimpleQuery.frx":366C
   End
   Begin Synapsis.SimpleButton btnUp 
      Height          =   240
      Index           =   1
      Left            =   2790
      TabIndex        =   13
      Top             =   450
      Width           =   690
      _ExtentX        =   2487
      _ExtentY        =   1931
      Picture         =   "frmSimpleQuery.frx":3F7E
   End
   Begin Synapsis.SimpleButton btnDown 
      Height          =   240
      Index           =   0
      Left            =   3510
      TabIndex        =   15
      Top             =   1395
      Width           =   690
      _ExtentX        =   2487
      _ExtentY        =   1931
      Picture         =   "frmSimpleQuery.frx":4890
   End
   Begin Synapsis.SimpleButton btnUp 
      Height          =   240
      Index           =   0
      Left            =   3510
      TabIndex        =   16
      Top             =   450
      Width           =   690
      _ExtentX        =   2487
      _ExtentY        =   1931
      Picture         =   "frmSimpleQuery.frx":51A2
   End
   Begin VB.Label lblValue 
      Alignment       =   1  'Right Justify
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      BeginProperty Font 
         Name            =   "Tahoma"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00FFFFFF&
      Height          =   195
      Left            =   1905
      TabIndex        =   26
      Top             =   2115
      Width           =   45
   End
   Begin VB.Label lblDeco 
      Alignment       =   2  'Center
      BackColor       =   &H00000000&
      BackStyle       =   0  'Transparent
      Caption         =   ","
      BeginProperty Font 
         Name            =   "Verdana"
         Size            =   36
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H0000FF00&
      Height          =   870
      Index           =   0
      Left            =   2655
      TabIndex        =   19
      Top             =   540
      Width           =   150
   End
   Begin VB.Label lblDecPlace 
      Alignment       =   2  'Center
      BackColor       =   &H00000000&
      BackStyle       =   0  'Transparent
      Caption         =   "0"
      BeginProperty Font 
         Name            =   "Verdana"
         Size            =   36
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H0000FF00&
      Height          =   870
      Index           =   0
      Left            =   3465
      TabIndex        =   17
      Top             =   540
      Width           =   780
   End
   Begin VB.Label lblDecPlace 
      Alignment       =   2  'Center
      BackColor       =   &H00000000&
      BackStyle       =   0  'Transparent
      Caption         =   "0"
      BeginProperty Font 
         Name            =   "Verdana"
         Size            =   36
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H0000FF00&
      Height          =   870
      Index           =   1
      Left            =   2745
      TabIndex        =   14
      Top             =   540
      Width           =   780
   End
   Begin VB.Label lblDecPlace 
      Alignment       =   2  'Center
      BackColor       =   &H00000000&
      BackStyle       =   0  'Transparent
      Caption         =   "0"
      BeginProperty Font 
         Name            =   "Verdana"
         Size            =   36
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H0000FF00&
      Height          =   870
      Index           =   2
      Left            =   1935
      TabIndex        =   11
      Top             =   540
      Width           =   780
   End
   Begin VB.Label lblDecPlace 
      Alignment       =   2  'Center
      BackColor       =   &H00000000&
      BackStyle       =   0  'Transparent
      Caption         =   "0"
      BeginProperty Font 
         Name            =   "Verdana"
         Size            =   36
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H0000FF00&
      Height          =   870
      Index           =   3
      Left            =   1215
      TabIndex        =   8
      Top             =   540
      Width           =   780
   End
   Begin VB.Label lblDecPlace 
      Alignment       =   2  'Center
      BackColor       =   &H00000000&
      BackStyle       =   0  'Transparent
      Caption         =   "0"
      BeginProperty Font 
         Name            =   "Verdana"
         Size            =   36
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H0000FF00&
      Height          =   870
      Index           =   4
      Left            =   495
      TabIndex        =   5
      Top             =   540
      Width           =   780
   End
   Begin VB.Label lblDeco 
      Alignment       =   2  'Center
      BackColor       =   &H00000000&
      BackStyle       =   0  'Transparent
      Caption         =   ","
      BeginProperty Font 
         Name            =   "Verdana"
         Size            =   36
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00000000&
      Height          =   870
      Index           =   1
      Left            =   2700
      TabIndex        =   25
      Top             =   585
      Width           =   150
   End
   Begin VB.Label lblDecPlaceShadow 
      Alignment       =   2  'Center
      BackColor       =   &H00000000&
      BackStyle       =   0  'Transparent
      Caption         =   "0"
      BeginProperty Font 
         Name            =   "Verdana"
         Size            =   36
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00000000&
      Height          =   870
      Index           =   4
      Left            =   540
      TabIndex        =   24
      Top             =   585
      Width           =   780
   End
   Begin VB.Label lblDecPlaceShadow 
      Alignment       =   2  'Center
      BackColor       =   &H00000000&
      BackStyle       =   0  'Transparent
      Caption         =   "0"
      BeginProperty Font 
         Name            =   "Verdana"
         Size            =   36
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00000000&
      Height          =   870
      Index           =   3
      Left            =   1260
      TabIndex        =   23
      Top             =   585
      Width           =   780
   End
   Begin VB.Label lblDecPlaceShadow 
      Alignment       =   2  'Center
      BackColor       =   &H00000000&
      BackStyle       =   0  'Transparent
      Caption         =   "0"
      BeginProperty Font 
         Name            =   "Verdana"
         Size            =   36
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00000000&
      Height          =   870
      Index           =   2
      Left            =   1980
      TabIndex        =   22
      Top             =   585
      Width           =   780
   End
   Begin VB.Label lblDecPlaceShadow 
      Alignment       =   2  'Center
      BackColor       =   &H00000000&
      BackStyle       =   0  'Transparent
      Caption         =   "0"
      BeginProperty Font 
         Name            =   "Verdana"
         Size            =   36
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00000000&
      Height          =   870
      Index           =   1
      Left            =   2790
      TabIndex        =   21
      Top             =   585
      Width           =   780
   End
   Begin VB.Label lblDecPlaceShadow 
      Alignment       =   2  'Center
      BackColor       =   &H00000000&
      BackStyle       =   0  'Transparent
      Caption         =   "0"
      BeginProperty Font 
         Name            =   "Verdana"
         Size            =   36
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00000000&
      Height          =   870
      Index           =   0
      Left            =   3510
      TabIndex        =   20
      Top             =   585
      Width           =   780
   End
End
Attribute VB_Name = "frmMoneyQuery"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim MainValue(4) As Integer
Private Sub btnDown_Click(Index As Integer)
CalcValue Index, -1
DrawValues
End Sub
Private Sub btnUp_Click(Index As Integer)
CalcValue Index, 1
DrawValues
End Sub
Sub DrawValues()
Dim Counter As Long, uNull As Boolean, uValue As Double
uNull = True

    For Counter = 4 To 0 Step -1
    uValue = uValue + ((10 ^ Counter) * MainValue(Counter))
    Me.lblDecPlace(Counter) = MainValue(Counter)
    Me.lblDecPlaceShadow(Counter) = MainValue(Counter)
    
        If MainValue(Counter) = 0 Then
        Me.lblDecPlace(Counter).Visible = (Counter < 3 Or (Not uNull))
        Me.lblDecPlaceShadow(Counter).Visible = (Counter < 3 Or (Not uNull))
            
        Else
        Me.lblDecPlace(Counter).Visible = True
        Me.lblDecPlaceShadow(Counter).Visible = True
        uNull = False
        
        End If
        
    Next Counter

uValue = uValue / 100 * IIf(Me.chkMinus = 1, -1, 1)

Me.lblValue = Format$(uValue, "R$ 0.00")

End Sub
Sub CalcValue(ByVal Pos As Integer, Value As Integer)

MainValue(Pos) = MainValue(Pos) + Value

    If MainValue(Pos) > 9 Then
    
        If Pos < UBound(MainValue) Then CalcValue Pos + 1, Int(MainValue(Pos) / 10)
    
    MainValue(Pos) = MainValue(Pos) Mod 10
    
    ElseIf MainValue(Pos) < 0 Then
    
        If Pos < UBound(MainValue) Then CalcValue Pos + 1, Int(MainValue(Pos) / 10)
        
    MainValue(Pos) = (MainValue(Pos) + 10) Mod 10
    
    End If

End Sub
Private Sub chkMinus_Click()
Me.chkMinus.Caption = IIf(Me.chkMinus = 1, "-", "+")
DrawValues
End Sub
Private Sub Form_KeyPress(KeyAscii As Integer)
Dim Counter As Long

    Select Case KeyAscii
    Case 48 To 57
        
        For Counter = 3 To 0 Step -1
        MainValue(Counter + 1) = MainValue(Counter)
        Next Counter
    
    MainValue(0) = Val(Chr$(KeyAscii))
    
    DrawValues
    
    Case 8
        For Counter = 1 To 4
        MainValue(Counter - 1) = MainValue(Counter)
        Next Counter
    
    MainValue(4) = 0
    
    DrawValues
    End Select

End Sub

Private Sub Form_Load()

ApplyLanguage Me

DrawValues
End Sub
