Writing a Windows Form Application For .NET Framework Using C#
This article is a very simple introduction on writing a Windows Form application for the Microsoft.NET framework using C#. The sample application demonstrates how to create and layout controls on a simple form and the handling of mouse click events. The application displays a form showing attributes of a file. This form is similar to the properties dialog box of a file (Right click on a file and Click on Properties menu item). Since attributes of a file will be shown, the sample will show how to use File IO operations in .NET framework.
…
Like every Win32 application source, we will start with the inclusion of some header files. C# does not make use of header files; it uses namespaces to accomplish this purpose. Most of the C# core functionality is implemented in the System namespace. For forms application, the functionality is included in the System.WinForms namespace. Therefore, right at the top of our source file we need to define these namespaces.
using System;
using System.WinForms;
We will need some more namespace definitions, but I will explain them as we go along with this sample application. Like every C# application, Windows Forms application will be defined as a class. Since we will be making use of the Form class, it needs to be derive from it.
public class WinFileInfo : Form
The next thing that needs to be identified is the entry point for the application. Unlike Win32 applications, the method Main (not WinMain) will be the entry point for this application.
…
Website: www.520-365.cn | Filesize: 257kb
No of Page(s): 7
Click here to download Writing a Windows Form Application For .NET Framework Using C#.
Related Tutorial
Tags: file I/O, GUI, windows application, Windows Forms
Comments
Leave a Reply