So as we've said, usability is all about helping the user to get it right,
helping them to use our application successfully.
And I'm going to list very quickly several ways in
Windows Forms that we can achieve that.
And then we're going to go back to our demo application
and put a number of these into practice.
So there are lots of ways that you can explain to the user
what's going on and how to use your application.
And tooltips are one way that we've already mentioned,
and you can add these very easily with the tooltip
component that comes with Windows Forms.
Also, Windows Forms allows you to plum in to the help system.
If the user presses F1, an events going to be raised that we can handle,
and you can also add a help button to your form.
Another useful technique is to have first run tutorials or hints.
So the first time the user runs your application,
text appears or message boxes pop up that give them some hints as
to how to use your application successfully,
and what they need to do next.
Some operations in your application may have enough
complexity to require wizards that guide the users through
entering information step by step.
And if the user does enter something wrong,
maybe on a form of data entry with lots of inputs,
it's useful to indicate which field that got wrong,
and what the problem was.
And the Windows Forms error provider control allows you to do that,
associating an error with a particular control.
In fact, in many line of business applications,
there'll be views or forms where the user has to enter a large amount of data,
maybe information about a customer or an order.
And so again,
it's gonna be very useful if we can help them in those
controls where they enter the data, not to enter the wrong thing.
So if you've got a text box for text input,
then make use of properties like max length,
so that they can't enter more data than the
underlying database field will allow.
Or make use of the auto complete feature of text box,
with which you can prompt the user to reuse things that they entered before.
If you need to take numeric input, you could use a text box for that,
but then you have to deal with what happens when the user
enters something that's not a number.
Windows Forms does actually come with a number of
controls like the NumericUpDown,
which you can see in our demo application for the rating.
Or even the track bar, which is a slider.
The advantage of using these is,
it's not possible to enter something that's out of range,
or that isn't a number.
In fact, this principle's even more important if you need to take date input.
Don't just give the user a text box,
because there is so many different ways people can format dates,
and there's a good chance you won't be able to
interpret what the user's written.
Instead, again Windows Forms comes with a couple of choices for entering dates,
such as the DateTimePicker, or the MonthCalendar.
And in fact,
many third party control libraries for Windows Forms provides
you with some really nice alternatives if you don't like the
ones that come out of the box.
But that's enough talking now,
we could go on giving many examples of ways in which you can
help the user to enter the right data,
and to understand what they're suppose to do in your application.
But let's take a few of these suggestions that I've just given,
and apply them to our demo application.