VERSION 5.00 Begin VB.Form frmEstadoEmprestimo Caption = "Estado do Empréstimo" ClientHeight = 4860 ClientLeft = 165 ClientTop = 450 ClientWidth = 7455 LinkTopic = "Form1" MDIChild = -1 'True ScaleHeight = 4860 ScaleWidth = 7455 WindowState = 2 'Maximized Begin VB.Frame fraOutrasOperacoes Caption = "Outras Operações" Height = 2655 Left = 4560 TabIndex = 9 Top = 1800 Width = 2295 Begin VB.OptionButton optOutrasOperacoes Alignment = 1 'Right Justify Caption = "Alterar Taxa de Juro" Height = 375 Index = 1 Left = 240 TabIndex = 13 Top = 840 Width = 1815 End Begin VB.OptionButton optOutrasOperacoes Alignment = 1 'Right Justify Caption = "Amortizar" Height = 375 Index = 0 Left = 1080 TabIndex = 12 Top = 480 Width = 975 End Begin VB.CommandButton cmdRealizar Caption = "Realizar" Height = 375 Left = 960 TabIndex = 11 Top = 2040 Width = 1095 End Begin VB.TextBox txtValor BackColor = &H8000000B& Height = 375 Left = 480 TabIndex = 10 Top = 1440 Width = 1575 End End Begin VB.CommandButton cmdPagarPrestacao Caption = "PagarPrestacao" Height = 495 Left = 2160 TabIndex = 8 Top = 2880 Width = 1335 End Begin VB.TextBox txtCapital BackColor = &H8000000B& Enabled = 0 'False BeginProperty Font Name = "MS Sans Serif" Size = 8.25 Charset = 0 Weight = 700 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 375 Left = 2160 TabIndex = 0 Top = 600 Width = 1695 End Begin VB.TextBox txtTaxaJuro BackColor = &H8000000B& Enabled = 0 'False BeginProperty Font Name = "MS Sans Serif" Size = 8.25 Charset = 0 Weight = 700 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 375 Left = 2160 TabIndex = 3 Top = 1080 Width = 1695 End Begin VB.TextBox txtNrPrestacoes BackColor = &H8000000B& Enabled = 0 'False BeginProperty Font Name = "MS Sans Serif" Size = 8.25 Charset = 0 Weight = 700 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 375 Left = 2160 TabIndex = 2 Top = 1560 Width = 1695 End Begin VB.TextBox txtPrestacao BackColor = &H8000000B& Enabled = 0 'False BeginProperty Font Name = "MS Sans Serif" Size = 8.25 Charset = 0 Weight = 700 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 375 Left = 2160 TabIndex = 1 Top = 2040 Width = 1695 End Begin VB.Label lblEmprestimoPago Caption = "Empréstimo pago" BeginProperty Font Name = "MS Sans Serif" Size = 12 Charset = 0 Weight = 700 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 495 Left = 1680 TabIndex = 14 Top = 3840 Width = 2175 End Begin VB.Label lblNrPrestacoes Alignment = 1 'Right Justify Caption = "Nr de Prestações" Height = 375 Left = 600 TabIndex = 7 Top = 1560 Width = 1335 End Begin VB.Label lblPrestacao Alignment = 1 'Right Justify Caption = "Prestacao" Height = 375 Left = 600 TabIndex = 6 Top = 2040 Width = 1335 End Begin VB.Label lblTaxaJuro Alignment = 1 'Right Justify Caption = "Taxa de Juro" Height = 375 Left = 600 TabIndex = 5 Top = 1080 Width = 1335 End Begin VB.Label lblCapital Alignment = 1 'Right Justify Caption = "Capital " Height = 375 Left = 720 TabIndex = 4 Top = 600 Width = 1335 End Begin VB.Menu mnuEmprestimo Caption = "Empréstimo" Begin VB.Menu mnuFechar Caption = "Fechar" End End Begin VB.Menu mnuQuadro Caption = "Quadro de Amortização" End End Attribute VB_Name = "frmEstadoEmprestimo" Attribute VB_GlobalNameSpace = False Attribute VB_Creatable = False Attribute VB_PredeclaredId = True Attribute VB_Exposed = False Option Explicit Const Amortizacao = 0 Const ALTERACAO_TAXA_JURO = 1 Const BRANCO = &H80000005 Const CINZENTO = &H8000000F Private OutraOperacao As Integer Private WithEvents mEmprestimo As cEmprestimo Attribute mEmprestimo.VB_VarHelpID = -1 Private Sub cmdPagarPrestacao_Click() Emprestimo.PagarPrestacao txtCapital.Text = FormatCurrency(Emprestimo.CapitalDivida) txtNrPrestacoes.Text = CStr(Emprestimo.NrPrestacoes) End Sub Private Sub cmdRealizar_Click() Select Case OutraOperacao Case Amortizacao Emprestimo.Amortizar (CDbl(txtValor.Text)) txtCapital.Text = FormatCurrency(Emprestimo.CapitalDivida) txtPrestacao.Text = FormatCurrency(Emprestimo.Prestacao) Case ALTERACAO_TAXA_JURO Emprestimo.TaxaJuro = CDbl(txtValor.Text) txtTaxaJuro.Text = Format(Emprestimo.TaxaJuro, "Percent") txtPrestacao.Text = FormatCurrency(Emprestimo.Prestacao) End Select optOutrasOperacoes(OutraOperacao).Value = False txtValor.Enabled = False txtValor.Text = "" txtValor.BackColor = CINZENTO End Sub Private Sub Form_Load() txtCapital.Text = FormatCurrency(Emprestimo.CapitalDivida) txtTaxaJuro.Text = Format(Emprestimo.TaxaJuro, "Percent") txtNrPrestacoes.Text = CStr(Emprestimo.NrPrestacoes) txtPrestacao.Text = FormatCurrency(Emprestimo.Prestacao) lblEmprestimoPago.Visible = False Set mEmprestimo = Emprestimo End Sub Private Sub mEmprestimo_EmprestimoPago() cmdPagarPrestacao.Enabled = False fraOutrasOperacoes.Enabled = False lblEmprestimoPago.Visible = True End Sub Private Sub mnuFechar_Click() Unload Me End Sub Private Sub mnuQuadro_Click() frmQuadro.Show vbModal End Sub Private Sub optOutrasOperacoes_Click(Index As Integer) OutraOperacao = Index txtValor.Enabled = True txtValor.BackColor = BRANCO txtValor.SetFocus End Sub