Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you deal with temporary useless controls in Winforms (hiding vs disabling)?

It's quite common to have a form with a checkbox stating "Use foo" immediately followed by a textbox where the user can input the "foo value" he want's to use. Of course, this textbox is useful only if "Use foo" is checked

I don't know the best way to deal with this situation :

  1. Disable the textbox (ie textboxfoo.Enabled=false;)
  2. Hide it (ie textboxfoo.Visible=false;)
  3. Let the user input a foo value if he wants to, and ignore the value he entered.

Is there a best practice that I can follow ?

like image 640
Brann Avatar asked Jan 29 '09 22:01

Brann


2 Answers

The textbox should be disabled.

If the textbox is hidden, then the visible alteration of the form will make the program less user-friendly. An example of this is the old (very unpopular) disappearing menu items that used to be in Microsoft Office. People don't want things moving around on their screens. It's disorienting.

If the user is permitted to input a useless value, then that gives the false impression that entering the value has some effect.

like image 190
Jeffrey L Whitledge Avatar answered Nov 06 '22 10:11

Jeffrey L Whitledge


Disabling the text box is the best option in this case. The fact that the text box is enabled/disabled as the checkbox is checked/unchecked provides useful feedback to the user: the use foo option expects a foo value, and the foo value is only meaningful if the use foo option is selected.

Hiding the text box is less satisfactory - if the box isn't checked, the user won't realize that enabling the foo option will allow them to specify the foo value. Imagine them thinking to themselves: "I'd better not select the use foo option, as I have no idea what foo value will be used."

The third option is the worst, since doesn't indicate that the entered value will be ignored.

like image 2
Stephen C. Steel Avatar answered Nov 06 '22 09:11

Stephen C. Steel