r/visualbasic • u/VinylHorror • Jul 09 '18
Making text-boxes appear and disappear while checkboxes are selected?
Hey, everyone. I was wondering if you guys could help me out or if you just have a solution. This is an interface for a school assignment. When the box/lawn/pavilion checkboxes are checked, a textbox becomes visible underneath. When the same checkbox is unchecked, the textbox's Visible property evaluate to false and disappears. The Visible property is set to false when the application is first run. You are allowed to have any number of the checkboxes checked at the same time as long as their accompanying textbox disappears when they are unchecked.
Does anyone have any ideas? I've been able to get everything else done but for whatever reason I can't figure this out. I've used both if...then statements and case statements but just can't crack it. If you need any other information feel free to message me. Thank you so much!
1
u/Bonejob VB Guru Jul 09 '18
As I understand it you want to show or hide the textbox based upon the selected value of the checkbox above it. The first thing you need is an event to put code into. I would suggest either onchange or click of the corresponding checkbox.
in that event you need to write code that modifies the visible status of textbox.
so the way to make an object visiable or not is
Figure out the event you want to use, then write code that makes the checkbox appear or disappear in that event.
Post your code so we can help.