I've been searching google for a little bit now and not having much luck..I don't think this would be very hard to do but I am still a little new to VB.. Basically, I have a 2 Panel's with some text boxes in them and I have 2 radio buttons...I want both panels to be hidden, but when RadioButton1 is selected I want Panel1 to show and vice versa, when RadioButton2 is selected I want Panel2 to display and Panel1 to be hidden. Can anyone shed some light on this for me as far as what would go in RadioButton1 and RadioButton2? Maybe post a URL to a tutorial or something? Thanks!
I guess you can use a simple function, on events click on both radio buttons: Private Sub ToggleVisible() If (RadioButton1.Checked.Equals(True)) Then Panel1.Visible = True Panel2.Visible = False End If If (RadioButton2.Checked.Equals(True)) Then Panel1.Visible = False Panel2.Visible = True End If End Sub Code (markup):
Required steps are listed below. 1. Make Visible property of Panel1 to true 2. Make Visible property of Panel2 to false 3. Double click on RadioButton1 and add the following code. Private Sub RadioButton1_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton1.CheckedChanged Panel1.Visible = True Panel2.Visible = False End Sub 4. Double click on RadioButton2 and add the following code. Private Sub RadioButton2_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton2.CheckedChanged Panel1.Visible = False Panel2.Visible = True End Sub I assumed you have RadioButton1, RadioButton2, Panel1 and Panel2 on a form and RadioButton1 is associated with Panel1 and 2 with the other. To see whether this is working correctly, make sure you set the BorderStyle = FixedSingle of both panels and add few command buttons on panels. That's it.
Thanks for the input guys! Forgot about .Visible = True/False...Got it working Rep left for both of you!