Wednesday, February 7, 2007

Why toggling control?

A good software need be simple and able to hide those complexity contains in the software. User interface (UI) design is extremely important to make sure your software look simple. One of the tips that i find very useful technique is 'toggling control' to be applied in your UI design. What does this means? We toggle control because we want to limit a user to access of some controls (mind his business). if fewer choices means fewer mistakes made by user. We can either disable or enable those controls ; or we can visible or invisible them.

Here is a good example:

Create a method so that it can be used again and again


public void ToggleControl(bool enableToggle)
{
if (enableToggle)
{
txtEmail.Enabled = true;
txtUsername.Enabled =
true;
}
else
{
txtEmail.Enabled = false;

txtUsername.Enabled = false;
}
}


so u can call this method as simple as ToggleControl(true) to enable the control otherwise ToggleControl(false) to disable it.

No comments: