Visual Basic - Ocultar txtBox al seleccionar otra opcion

Life is soft - evento anual de software empresarial
 
Vista:
sin imagen de perfil

Ocultar txtBox al seleccionar otra opcion

Publicado por Jason (1 intervención) el 09/04/2022 20:15:40

Buenos días colegas, quisiera saber si alguien me puede orientar como hacer para ocultar otras opciones con su txtbox al seleccionar otra opcion , ejemplo (op 1, op2 , op3) al seleccionar op1 , ocultar el llenado de dato de op2 y op3 .




Modulo-Parametros
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
Imports VB = Microsoft.VisualBasic
Imports Janus.Windows.GridEX
 
Public Class FrmParametros_Estampado
 
    Dim STRSQL, StCod_Cliente As String
    Public codigo As Object
    Public Descripcion As String, TipoAdd As String
    Dim ohp As New clsHELPER
    Private oDT As New DataTable
    Dim vOpcion As String
 
 
    Private Sub ButtonBar2_ItemClick(sender As Object, e As Janus.Windows.ButtonBar.ItemEventArgs) Handles ButtonBar2.ItemClick
        Call Reporte()
    End Sub
 
    Private Sub BtnBuscar_Click(sender As Object, e As EventArgs)
        BUSCAR()
    End Sub
 
    Private Sub frmPosicionOrdenesProdLima_Load(sender As Object, e As EventArgs)
        dtpDesde.Value = Today
        dtpHasta.Value = Today
    End Sub
    Private Sub optPO_Checked()
        If vOpcion.Chars(vOpcion) = "" Then
 
            txtPO.Visible = True
 
        Else
 
            txtPO.Visible = False
 
        End If
 
    End Sub
    Sub BUSCAR()
        If optPO.Checked = True Then
            vOpcion = "1"
        ElseIf optOP.Checked = True Then
            vOpcion = "2"
        Else
            vOpcion = "3"
        End If
 
        STRSQL = "EXEC PL_ESTAMPADOS " & vOpcion & ",'" & Me.txtPO.Text & "','" & txtOP.Text & "','" & dtpDesde.Value.ToShortDateString & "','" & dtpHasta.Value.ToShortDateString & "'"
        oDT = ohp.DevuelveDatos(STRSQL, cconnect)
        GridEX1.RootTable.Columns.Clear()
        GridEX1.DataSource = oDT
        CheckLayoutGridEx(GridEX1)
 
 
 
 
    End Sub
 
    Sub Reporte()
        Try
            Dim oo As Object
            oo = CreateObject("excel.application")
 
            If optPO.Checked = True Then
                vOpcion = "1"
            ElseIf optOP.Checked = True Then
                vOpcion = "2"
            Else
                vOpcion = "3"
            End If
 
            STRSQL = "EXEC PL_ESTAMPADOS " & vOpcion & ",'" & Me.txtPO.Text & "','" & txtOP.Text & "','" & dtpDesde.Value & "','" & dtpHasta.Value & "'"
 
 
            oo.Workbooks.Open(vruta & "\--.xlt")
            oo.Visible = True
            oo.DisplayAlerts = False
 
            oo.Run("reporte", STRSQL, cconnectVB6)
            oo = Nothing
        Catch ex As Exception
 
        End Try
    End Sub
 
    Private Sub txtOP_KeyPress(sender As Object, e As KeyPressEventArgs) Handles txtOP.KeyPress
 
    End Sub
 
    Private Sub BtnBuscar_Click_1(sender As Object, e As EventArgs) Handles BtnBuscar.Click
        BUSCAR()
    End Sub
 
    Private Sub txtOP_TextChanged(sender As Object, e As EventArgs) Handles txtOP.TextChanged
 
    End Sub
 
    Private Sub txtPO_TextChanged(sender As Object, e As EventArgs) Handles txtPO.TextChanged
 
    End Sub
End Class
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder
sin imagen de perfil
Val: 145
Ha aumentado 1 puesto en Visual Basic (en relación al último mes)
Gráfica de Visual Basic

Ocultar txtBox al seleccionar otra opcion

Publicado por Sah1d Ra (191 intervenciones) el 10/04/2022 22:17:16
Hola, te dejo el siguiente código, espero te sirva.

Se me hace mas fácil solo ocultar una cosa que cada uno de sus componentes
coloca un frame y option (el option debe estar fuera del frame para que siempre
este visible)
1
2
3
4
5
6
Private Sub Option1_Click(Index As Integer)
 Dim Tempo As Integer
 For Tempo = 0 To Option1.Count - 1
  Frame1(Tempo).Visible = Option1(Tempo).Value
 Next Tempo
End Sub

Colocas un frame1 y un option1 con índices y dentro de cada frame metes todos
los componentes que requieras.

imagen https://ibb.co/JmQ2VVC
imagen

cuéntame como te resulto.

Saludos y felices líneas de programac10n.
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar