Windows Forms Best Practices

This course demonstrates several best practices for Windows Forms application development by gradually improving a demo application. Topics covered include resizing, layout, accessibility, maintainable code, localization, usability, testability, threading, exception handling, custom control creation, and interoperability.
Course info
Rating
(320)
Level
Intermediate
Updated
Sep 27, 2014
Duration
4h 36m
Table of contents
Creating Excellent Windows Forms Applications
Resizing and Layout
Usability, Accessibility, and Localization
Exceptions and Threading
Patterns for Maintainable Code
Creating Custom Controls
Interoperability
Conclusion
Description
Course info
Rating
(320)
Level
Intermediate
Updated
Sep 27, 2014
Duration
4h 36m
Description

This course demonstrates several best practices for Windows Forms development by taking a demo application and gradually improving it to improve the user experience and code quality. We'll see how you can improve the layout and resizing of your application, and how you can make it more accessible, usable, and navigable from the keyboard. We'll explore how to approach localization, exception handling, and threading. We'll also devote time to various patterns that will help you write more maintainable and testable code. Finally, we'll provide guidelines for creating your own custom controls, and see how you can interoperate other technologies such as hosting web and WPF content within a Windows Forms application.

About the author
About the author

Mark Heath is a software developer based in Southampton, England, working for NICE Systems as a software architect creating cloud based digital evidence management systems for the police. He is the creator of NAudio, an open source audio framework for .NET.

More from the author
More courses by Mark Heath
Section Introduction Transcripts
Section Introduction Transcripts

Creating Excellent Windows Forms Applications
Hi, my name's Mark Heath and welcome to this Pluralsight course on Windows Forms Best Practices. In this course, we'll be looking at how you can create excellent Windows Forms applications. And in this first introductory module, we're going to answer the question, why would will still want to use Windows Forms, given that it's now quite an old technology? I want to explain some of the reasons why I think you can still create excellent Windows applications using Windows Forms if you apply some of the best practices that we'll be learning in this course. And in this module, we'll also introduce a demo application that we're going to be improving as we go through this course. So this application will start out with some problems that we'll be fixing as we go along.

Resizing and Layout
Hi my name's Mark Heath, and in this module of the Pluralsight course on Windows Forms best practices we're going to be looking at the issues of resizing and layout. We're going to begin this module by looking at how we can make sure that our forms have a really good resize experience, whether your resizing them larger or smaller. You'll remember from the demo application that we showed in the last module the My Podcasts application, that resizing wasn't implemented at all in this application. So if you resize the windows smaller, as you can see here, some of the controls on the right-hand side are being cut off. And you can also notice that the list of episode titles doesn't show the full titles, we can't see the whole string. So we're going to look at how we can tackle this problem of making sure the user can see all their data, no matter what size they resize the application to. And we'll be updating our demo applicaton to demonstrate some of the resizing techniques that you can make use of in Windows Forms. And we'll also talk more generally about the issue of layout. How do you make sure that your application is laid out in a way that's easy to use? We've all seen applications that are cluttered with too many controls. This application is called the Bulk Rename Utility, and the developers have decided that they're going to put every single option that the application supports all there, on the main screen. But there are I think better ways of laying out a user interface. So we'll talk about some of the options you have for decluttering your user interface, and only showing the information that's most important.

Usability, Accessibility, and Localization
Hi, my name's Mark Heath, and in this module of our Windows Forms Best Practices course, we're going to be looking at the topics of usability, accessibility, and localization. Let me just give you a quick overview of the things we'll be covering in this module. We're going to look at the topic of usability, which is really about how easy is it for users to accomplish what they're trying to do with our application. Can we help them to fall into the pit of success, where it's easy for them to do the right thing, and hard for them to do the wrong thing. How discoverable is our application? And by that I mean, do they need to get training or read a manual before they can do anything, or is it simply obvious how to make use of the features that the application offers. We'll also talk about accessibility, and here we're going to look at how we can make it possible for users to navigate our application without having to make use of the mouse. We'll also look at how we can help users who want to make use of large font sizes and high contrast color schemes, and make sure that our application works well for them. And we'll also discuss how users who are blind or visually impaired, only making use of screen reading software, can also be helped by the way we write our application. And finally, we'll look at localization. How can we support users who speak other languages, or maybe who speak the same language, but are in a different culture? So we'll be looking at different ways that we can make translations of the resource files in our application. I will be demonstrating all the principles we look at by updating our demo application to put some of them into practice.

Conclusion
Hi. My name's Mark Heath. In this final, brief module of our Windows Forms Best Practices course, we're going to summarizing the main things that we've learned throughout this course. We can break up the best practices recommendations and techniques that we've been looking at throughout this course into three broad categories. First of all, we looked at various ways in which we can enhance the user experience, making sure that our Windows Forms applications are meeting the needs of all our users. We also looked at several different ways that we can improve the way that we write our Windows Forms code in order to make it more maintainable, extensible and testable. Finally, we saw a number of options that are available to you for when what Windows Forms offers out of the box isn't enough to meet your needs. So, we saw several ways that you can extend the capabilities of your Windows Forms applications. Let's just review some of the key best practices from each of these three areas.