Rules to Better Windows Forms Applications

Elevate your Windows Forms applications with a set of best practices designed to enhance user experience and maintainability. This guide covers key principles for design consistency, error logging, user settings management, and efficient data handling, ensuring your applications are both functional and user-friendly.

  1. Almost everyone assumes today to use web forms for broad reach because of easy installation and cross platform compatibility. That is correct.

    In the old days (1995-2000) companies used Windows Forms, later (2000-2007) they rolled their own ASP.NET solution, however since then (2007+) SharePoint has become the default choice for an intranet. When you need something richer and you can control the environment.

  2. Code generators can be used to generate whole Windows and Web interfaces, as well as data access layers and frameworks for business layers, making them an excellent time saver. It's not crucial which one you use as long as you invest the time and find one you are happy with. The one important thing is they must have command line support and the files they generate should be recognizable as code generated by prefix or a comment like "Don't touch" as this was automatically generated code. Make it easy to run by putting all the command line operations in a file called '_Regenerate.bat'.

  3. Use colours on incomplete is so useful in design time:

    • <span style="background-color:red">Red</span> = Controls which are incomplete, e.g. An incomplete button
    • <span style="background-color:yellow">Yellow</span> = Controls which are deliberately invisible that are used by developers e.g. Test buttons
  4. All applications should be compatible with the Windows XP user interface and should be fully themed. Applications that do not use XP themes look like they were designed only for an earlier version of Windows. Mixing themed and non-themed controls looks equally unprofessional.

  5. If you ask a new .NET developer (from the Access or VB6 world) what is the best thing about .NET Windows Forms, most of your answers will be "Form Inheritance" that allows them to keep a nice consistent look for all forms. If you ask them a couple of months later, they will probably tell you the worst thing about .NET Windows Forms is "Form Inheritance". This is because they have had too many problems with the bugs in the form designer regarding this feature. Many abandon them altogether and jump on the user control band wagon. Please don't... we have a solution to this...

  6. One useful feature of inherited forms is the ability to lock the value of certain properties on the inherited copy. E.g.:

  7. User controls allow you to have groups of elements which can be placed on forms.

  8. Designing a user-friendly search system is crucial in today’s information-driven world, as it significantly enhances the user experience by enabling efficient and effective access to relevant data. A well-structured search interface not only simplifies the process of locating specific information amidst vast datasets but also caters to a variety of user needs, from basic inquiries to complex queries.

    By prioritizing clarity, simplicity, and adaptability in search design, we can ensure that users can navigate and utilize applications more intuitively, leading to increased productivity, satisfaction, and overall success of the software.

  9. Validation is extremely important on a data entry form. There are two ways to do validation:

  10. In .NET, there are 2 ways to pass data through the layers of your application. You can:

per page
1 - 10 of 51 items
We open source.Loving SSW Rules? Star us on GitHub. Star