Public Class frmReporteVentaSeleccion
    Private sender As New Object
    Private CodigoTitulo As String = String.Empty
    Private Sub frmReporteVentaSeleccion_Load(sender As Object, e As EventArgs) Handles MyBase.Load

    End Sub
    Sub New()

        ' Esta llamada es exigida por el diseñador.
        InitializeComponent()

        ' Agregue cualquier inicialización después de la llamada a InitializeComponent().

    End Sub
    Sub New(sender As Object, Codigo As String)

        Me.New
        Me.sender = sender
        Me.CodigoTitulo = Codigo
    End Sub
    Sub ReporteVenta(ByRef Tipo As String)
        If Tipo = "Nuevo" Then
            If MsgBox("¿Esta Seguro que Desea Generar un nuevo reporto?", MsgBoxStyle.OkCancel) = DialogResult.OK Then
                sender.close()
                Me.Close()

            End If
        ElseIf Tipo = "Existente" Then
            If MsgBox("¿Esta Seguro que Desea Usar un registro existente de reporto?", MsgBoxStyle.OkCancel) = DialogResult.OK Then
                Dim frmBustarVenta As New frmBuscarReporteVenta(Me.CodigoTitulo)
                frmBustarVenta.ShowDialog()
            End If

        End If

    End Sub

    Private Sub btnExistente_Click(sender As Object, e As EventArgs) Handles btnExistente.Click
        ReporteVenta("Existente")
    End Sub

    Private Sub btnNuevo_Click(sender As Object, e As EventArgs) Handles btnNuevo.Click
        ReporteVenta("Nuevo")
    End Sub

    Private Sub TableLayoutPanel1_Paint(sender As Object, e As PaintEventArgs)

    End Sub

    Private Sub TableLayoutPanel1_Paint_1(sender As Object, e As PaintEventArgs)

    End Sub
    Sub EstadoReporto()
        If chkUnitario.Checked Then
            lblReportoExistente.Visible = False
            btnExistente.Visible = False
        Else
            lblReportoExistente.Visible = True
            btnExistente.Visible = True
        End If
    End Sub

    Private Sub chkUnitario_CheckedChanged(sender As Object, e As EventArgs) Handles chkUnitario.CheckedChanged
        EstadoReporto()
    End Sub
End Class