An Introduction to the WinForm samples in the All-In-One Framework - Microsoft All-In-One Code Framework - Site Home - MSDN Blogs
Microsoft All-In-One Code Framework - Developers' Pain Killer

An Introduction to the WinForm samples in the All-In-One Framework

  • Comments 1

Introduction

This article introduces some common Windows Forms scenarios. The samples are from the All-In-One Framework, and it is only a portion of the All-In-One Framework. You can receive more samples from http://cfx.codeplex.com/.

Background

Microsoft All-In-One Code Framework delineates the framework and skeleton of Microsoft development techniques through typical sample codes in three popular programming languages (Visual C#, VB.NET, Visual C++). Each sample is elaborately selected, composed, and documented to demonstrate a frequently-asked, tested, or used coding scenario.

Using the code

1.       CSWinFormGeneral

This sample demonstrates some common scenarios of the Windows Forms technology, including:

1. Drag-and-drop operations;

2. Control customization;

3. Graphics;

4. Printing;

5. Time-consuming operation handling(BackgroundWorker component);

6. Object persistence;

7. Pass value between forms.

 

Below are some screenshots of the sample.

 

 

 

 

 

 

 

2.       CSWinFormDataBinding

 

This sample demonstrates the Windows Forms Data Binding

technology. It shows how to perform simple binding and complex binding in a

Windows Forms application. It also shows how to navigate through items in a

data source.

           

3.       CSWinFormBindToNestedProp

  

Consider this scenario: we have a class Person, which contains three properties: ID, Name and HomeAddr; where The HomeAddr is of Address type, similar to the following:

Public class Person
    {
          public int ID {get;set;}
          public string Name {get;set;}
          public Address HomeAddr {get;set;}
    }

    Public class Address
    {
         public string CityName {get;set;}
         public string PostCode {get; set;}
    }

Now, we want to display the ID,Name properties from the Person class along with the CityName and PostCode properties from the Address class in a single DataGridView, the following screenshot demonstrates this.

How do we display the nested properties in the same DataGridView as shown above? The answer is in our CSWinFormBindToNestedProp sample.

4.       CSWinFormDesigner

This sample demonstrates the common Windows Forms designer features, including Adornment, Smart tag, Custom Editor, Design time mouse/keyboard events, etc.

Design Time Smart Tag:

Custom ProperyGrid Tab:

Detect design-time mouse/keyboard events:

Adornment painting:

 

 

5.       CSWinFormLocalization

This sample demonstrates how to localize a Windows Forms application.

 

 

6.       CSWinFormSingleInstanceApp

This sample demonstrates how to achieve the goal that only one instance of the application is allowed in the Windows Forms application. In this sample, we are taking advantage of the VB.NET Framework since it has built-in support for single instance application.

 

7.       CSWinFormSplashScreen

This sample demonstrates how to create a splash screen in Windows Forms application.

 

Points of interest

If there is a problem, please read the ReadMe.txt file in each sample project, which contains a step by step tutorial of how to build the project.

If you want to receive more samples, please visit this link: Microsoft All-In-One Code Framework.

 

 

Leave a Comment
  • Please add 8 and 3 and type the answer here:
  • Post
  • Thanks

Page 1 of 1 (1 items)