
//Check whether a password has been entered
IF edPassword == ""
{
btEnter.Disable()
}
ELSE
{
btEnter.Enable()
}
Note:
edPassword – a Form control, edit control used password entry field.
btEnter – a Form control, button.
A disabled button will appear shaded out on the form.
This expression could be executed upon every text change in the edit control to make sure that a user cannot login with an empty password.
IF boolShow == false
{
btEnter.Hide()
}
ELSE
{
btEnter.Show()
}
Note:
boolShow – a Form Variable, used as a flag in this instance to check whether to display or hide the button.
btEnter – a Form control, button.
The button will not be visible on the form when it is hidden.
btEnter.SetFocus()
Note:
btEnter – a Form control, button.
Set Focus would usually be used when opening a form or when prompting the user to press the button. It is like setting the button to be the default button.