Put textboxes one over one and disable based on the combobox selection

softhard

Active member
Joined
Sep 29, 2012
Messages
35
Programming Experience
Beginner
Hi,
As i stated in my headline, I would like put one or more text boxes in one region and based on the user selection in combox they should appear or some disappear.

I am quiet new VB.Net and any help is much appreciated.
 
Hi,

Easy enough. You need to set the .Visible property of the textbox controls that you want to show or Not as the case may be. i.e:-

In the selectedIndexChanged event of the ComboBox you could say something like:-

VB.NET:
If ComboBox1.SelectedItem.ToString = "Only Show First Three Boxes" then
  TextBox1.Visible =True
  TextBox2.Visible =True
  TextBox3.Visible =True
  TextBox4.Visible =False
  TextBox5.Visible = False
  TextBox6.Visible = False
End If
If you want to manipulate enabling or disabling the controls then use the .Enabled property.

Hope that Helps.

Cheers,

Ian
 
Back
Top