Mostrar Mensajes

Esta sección te permite ver todos los posts escritos por este usuario. Ten en cuenta que sólo puedes ver los posts escritos en zonas a las que tienes acceso en este momento.


Mensajes - JOREGONA1

Páginas: [1]
1
Buenas tardes, gracias por esos excelentes cursos. He seguido el de programación en VB, pero por ningún lado muestran las diferentes formas de Vista preliminar, ocultar formulario e impresión del formulario. Me explico: Tengo un formulario que diseñe y programe en VB, el formulario se desarrollo en VB 2005 y se le dio el nombre de frmCaptura, los eventos principales son: Imprimir y Guardar. Cuando se presiona el Boton de imprimir debe: Permitir la Visualización del formulario y poder realizar los ajustes necesarios para imprimir, el formulario se debe de ocultar mientras se hacen los ajustes en vista previa, permitir la impresión del formulario con los ajustes de impresión y una vez impreso volver a cargar el formulario. El segundo evento es guardar y debe permitir copiar los datos del formulario en la matriz que se diseño para este evento, este evento se encuentra funcionando perfectamente y por eso no voy a entrar en detalle. Solicito me colaboren para poder realizar la impresion con los requerimientos exigidos, de antemano muchas gracias

Código: [Seleccionar]
Private Sub UserForm_Initialize()

    Rem Me.Width = Application.Width
    Rem Me.Height = Application.Height
   
    Rem Posiciona el userform donde deseo en la Hoja de Excel
    Rem Me.Top = 30
    Rem Me.Left = 1200
   
   
End Sub

Private Sub Valor_Change()
 
    Dim strCad As String
    Dim i
    Application.ScreenUpdating = False
    strCad = Format(Val(Replace(Replace(Valor, ",", ""), ".", "")) / 100, "#,##0.00")
    Valor = strCad
        If iPosCursor = 0 Then
        iPosCursor = Len(strCad) + 1
        Else
        iPosCursor = Valor.SelStart
        End If
        If KeyCode = 37 Or KeyCode = 39 Then KeyCode = 0: Exit Sub
        If KeyCode = 8 Then iPosCursor = Valor.SelStart + 1
        If KeyCode = 46 Then iPosCursor = Valor.SelStart
        Valor.SelStart = iPosCursor
        KeyCode = 0
       
End Sub

Private Sub Valor_Cheque_Change()

        Dim strCad As String
        Dim i
        Application.ScreenUpdating = False
        strCad = Format(Val(Replace(Replace(Valor_Cheque, ",", ""), ".", "")) / 100, "#,##0.00")
        Valor_Cheque = strCad
        If iPosCursor = 0 Then
        iPosCursor = Len(strCad) + 1
        Else
        iPosCursor = Valor_Cheque.SelStart
        End If
        If KeyCode = 37 Or KeyCode = 39 Then KeyCode = 0: Exit Sub
        If KeyCode = 8 Then iPosCursor = Valor_Cheque.SelStart + 1
        If KeyCode = 46 Then iPosCursor = Valor_Cheque.SelStart
        Valor_Cheque.SelStart = iPosCursor
        KeyCode = 0

End Sub

Private Sub Valor_Cheque1_Change()

    Dim strCad As String
    Dim i
    Application.ScreenUpdating = False
    strCad = Format(Val(Replace(Replace(Valor_Cheque1, ",", ""), ".", "")) / 100, "#,##0.00")
    Valor_Cheque1 = strCad
        If iPosCursor = 0 Then
        iPosCursor = Len(strCad) + 1
        Else
        iPosCursor = Valor_Cheque1.SelStart
        End If
        If KeyCode = 37 Or KeyCode = 39 Then KeyCode = 0: Exit Sub
        If KeyCode = 8 Then iPosCursor = Valor_Cheque1.SelStart + 1
        If KeyCode = 46 Then iPosCursor = Valor_Cheque1.SelStart
        Valor_Cheque1.SelStart = iPosCursor
        KeyCode = 0

End Sub

Private Sub Valor_Cheque2_Change()

    Dim strCad As String
    Dim i
    Application.ScreenUpdating = False
    strCad = Format(Val(Replace(Replace(Valor_Cheque2, ",", ""), ".", "")) / 100, "#,##0.00")
    Valor_Cheque2 = strCad
        If iPosCursor = 0 Then
        iPosCursor = Len(strCad) + 1
        Else
        iPosCursor = Valor_Cheque2.SelStart
        End If
        If KeyCode = 37 Or KeyCode = 39 Then KeyCode = 0: Exit Sub
        If KeyCode = 8 Then iPosCursor = Valor_Cheque2.SelStart + 1
        If KeyCode = 46 Then iPosCursor = Valor_Cheque2.SelStart
        Valor_Cheque2.SelStart = iPosCursor
        KeyCode = 0

End Sub

Private Sub Valor_Cheque3_Change()

    Dim strCad As String
    Dim i
    Application.ScreenUpdating = False
    strCad = Format(Val(Replace(Replace(Valor_Cheque3, ",", ""), ".", "")) / 100, "#,##0.00")
    Valor_Cheque3 = strCad
        If iPosCursor = 0 Then
        iPosCursor = Len(strCad) + 1
        Else
        iPosCursor = Valor_Cheque3.SelStart
        End If
        If KeyCode = 37 Or KeyCode = 39 Then KeyCode = 0: Exit Sub
        If KeyCode = 8 Then iPosCursor = Valor_Cheque3.SelStart + 1
        If KeyCode = 46 Then iPosCursor = Valor_Cheque3.SelStart
        Valor_Cheque3.SelStart = iPosCursor
        KeyCode = 0

End Sub

Private Sub Valor_ICA_Change()

    Dim strCad As String
    Dim i
    Application.ScreenUpdating = False
    strCad = Format(Val(Replace(Replace(Valor_ICA, ",", ""), ".", "")) / 100, "#,##0.00")
    Valor_ICA = strCad
        If iPosCursor = 0 Then
        iPosCursor = Len(strCad) + 1
        Else
        iPosCursor = Valor_ICA.SelStart
        End If
        If KeyCode = 37 Or KeyCode = 39 Then KeyCode = 0: Exit Sub
        If KeyCode = 8 Then iPosCursor = Valor_ICA.SelStart + 1
        If KeyCode = 46 Then iPosCursor = Valor_ICA.SelStart
        Valor_ICA.SelStart = iPosCursor
        KeyCode = 0
       
        Valor_ICA = strCad
        Valor_Pagar = Orden_Pago - Valor_Retencion - Valor_ICA
   
End Sub

Private Sub Valor_Pagar_Change()

    Dim strCad As String
    strCad = Format(Val(Replace(Replace(Valor_Pagar, ",", ""), ".", "")) / 100, "#,##0.00")
       
End Sub

Private Sub Valor_Retencion_Change()
   
    Dim strCad As String
    Dim i
    Application.ScreenUpdating = False
    strCad = Format(Val(Replace(Replace(Valor_Retencion, ",", ""), ".", "")) / 100, "#,##0.00")
    Valor_Retencion = strCad
        If iPosCursor = 0 Then
        iPosCursor = Len(strCad) + 1
        Else
        iPosCursor = Valor_Retencion.SelStart
        End If
        If KeyCode = 37 Or KeyCode = 39 Then KeyCode = 0: Exit Sub
        If KeyCode = 8 Then iPosCursor = Valor_Retencion.SelStart + 1
        If KeyCode = 46 Then iPosCursor = Valor_Retencion.SelStart
        Valor_Retencion.SelStart = iPosCursor
        KeyCode = 0
       
        Valor_Retencion = strCad
        Valor_Pagar = Orden_Pago - Valor_Retencion
             
End Sub


Páginas: [1]

Sobre la educación, sólo puedo decir que es el tema más importante en el que nosotros, como pueblo, debemos involucrarnos.

Abraham Lincoln (1808-1865) Presidente estadounidense.

aprenderaprogramar.com: Desde 2006 comprometidos con la didáctica y divulgación de la programación

Preguntas y respuestas

¿Cómo establecer o cambiar la imagen asociada (avatar) de usuario?
  1. Inicia sesión con tu nombre de usuario y contraseña.
  2. Pulsa en perfil --> perfil del foro
  3. Elige la imagen personalizada que quieras usar. Puedes escogerla de una galería de imágenes o subirla desde tu ordenador.
  4. En la parte final de la página pulsa el botón "cambiar perfil".