Winforms UI Best practices: Form.AutoValidate = EnableAllowFocusChange

Set on every form: Form.AutoValidate = EnableAllowFocusChange

 

image
image Figure: Form.AutoValidate = EnablePreventFocusChange, prevents you from leaving your textbox until your data entry is correct

 

image
image Figure: Form.AutoValidate = EnableAllowFocusChange with Errorproviders tell you bad data entry, but let you change to other controls

3 comments:

Anonymous said...

dham, this should be default!

Anonymous said...

For users who enter data only with the keyboard and change fields with TAB, the first solution is better because the cursor stays on the non correct textbox.

Dominique

Dain said...

And here I was digging why focus was locked on that particular listbox... Well, now I know.

Post a Comment

Latest Posts

Popular Posts