i have a radio button and a text box. when i select the radio button, then will come out the text box to let user fill in. may i know to show the text box?
below are my coding.

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
         TextBox2.Visible = True

        If RadioButton4.Checked = True Then
            TextBox2.Visible = True
        Else
            TextBox2.Visible = False
        End If


    End Sub
End Class

hope someone can help me. thx

Recommended Answers

All 8 Replies

write the same code on the Radiobutton's CheckChanged event..

i had try it, but still cannot work. may i know what error that i did?

try changing visible to enable....

i had try enabled and visible, but still cannot show the result that i want.
At the beginning, the text box is invisible, but when i select the radio button, the text box would not be show out.

can you post a screen shot..??

i think you might be having the texbox or the radiobutton on different containers (like panel or group box)..


you should try textbox1.BringToFront() Method..

i have a radio button and a text box. when i select the radio button, then will come out the text box to let user fill in. may i know to show the text box?
below are my coding.

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
         TextBox2.Visible = True

        If RadioButton4.Checked = True Then
            TextBox2.Visible = True
        Else
            TextBox2.Visible = False
        End If


    End Sub
End Class

hope someone can help me. thx

Hi,

You can do it like this example.
Add a textbox and 2 radiobuttons then try it:

Public Class Form1

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        TextBox1.Visible = False
    End Sub

    Private Sub RadioButton2_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton2.CheckedChanged
        If RadioButton2.Checked = True Then
            TextBox1.Visible = True
        Else
            TextBox1.Visible = False
        End If
    End Sub
End Class

thx Luc001. it working nw.

Hi,

No problem, glad to help :)

Mark your thread as solved :)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.