First of all,
If RadioButton2.Checked = True
is not, formally speaking, a bug, but is more than pointless; it should rather be
If RadioButton2.Checked Then
Moreover, it can be something like
ytcampname.Enabled = Not RadioButton2.Checked
Checked
is already Boolean, no need to compare it with a Boolean constant true or false.
As to your functionality, it does what you have written, not anything else. You try to control
Enabled
property, not visibility. If you want to change visibility, modify
Visible
property.
Too bad you did not specify what exactly UI framework/library you are using. If this is
System.Windows.Forms
,
System.Windows.Forms.Control.Visible
should be used. If not, it will be something similar.
—SA