. NET platform Introduction to Windows Forms programming

Source: Internet
Author: User
Tags garbage collection new features web services visual studio

Introduction:

Microsoft's. NET platform is a new generation of Internet platform. For technical developers,. The two features of the net platform are remarkable, first of all, the common language runtime, the common language runtime platform, and the large and comprehensive unified programming class.

The C # language is a Microsoft company target. NET platform to launch a new language, as. NET platform, which concentrates almost all the latest results on software development and software engineering research. It not only inherits the C + +, Java and other object-oriented powerful features, but also inherits the VB, Delphi and other programming languages of the rapid development of visual function, it is currently the first fully oriented components of the language.

. NET platform is divided into the following four aspects: Web Forms, Windows Forms, Web service, and Windows service, so let me introduce you to the design of the Windows Forms program.

1. Essentials of Basic knowledge

C # language: C # language has evolved from C + +. It is modern, simple, fully object-oriented and type-safe. If you are a C/s + + programmer, the learning curve will be very flat. Many C # statements borrow directly from your favorite language, including expressions and operators. C # is a modern programming language. C # reduces some of the features of C + +, with no more macros, templates, and multiple inheritance. New features that make programming more convenient are strict type safety, versioning, garbage collection (garbage collect), and so on. All of these features aim to target the development of component-oriented software. C # is therefore also referred to as a component-oriented language.

Class: A class is a set of objects that have the same data structure and the same operations. A class is an abstraction of a series of objects of the same nature, a description of the common characteristics of objects. For example, every car is an object, all cars can be used as a template, we define the car this class. C # is object-oriented, and all C # code must be placed in a class, with no global variables and global names.

. NET class Library: Microsoft has designed a very large programming class for the. NET platform. These classes range from the bottom of the operating system to the Windows interface, from database development to Web services, and so on. These classes are both on the common language runtime and are administrative, secure code. by using. NET provides a "super" class library that you can easily develop. NET platform for four types of programs: Web Forms, Windows Forms, Web service, and Windows service.

Windows Forms programs: Similar to Windows programs, programs that run on platforms such as Windows 98,windows NT and Windows2000, with very beautiful faces (such as forms, menus, various controls, and so on). Windows Forms is the first concept that appears in the. NET platform, also known as Windows Forms, and because it is a. NET Windows forms program, your Windows system must be installed first. NET platform in order to run.

Events: In a Windows system, all of our actions on a form will raise an event, such as pressing a button to raise a click (click), which will raise the text change event of the text box when you enter content in the text box. When an event is generated, a message is sent and the message is translated and processed by a specialized message handler.

Visual Studio. NET: A powerful software development tool that integrates multiple development languages on the Microsoft. NET Platform. Through this development tool, most. NET programming languages can be implemented in RAD (rapid development).

2 several basic concepts in Windows forms

Start Program

The Windows forms program differs from the general application in that it interacts with the user through a very beautiful form of appearance and various controls on the form. A program is not a step-by-step execution, but a message loop that chooses to perform the function according to the events raised by the user's various actions. In order to manage, interpret various messages for Windows, user keyboard or mouse input, and respond to various events. NET class library provides us with a class dedicated to starting Windows programs: System.Windows.Forms.Application, by using the application class, we can easily start a Windows Forms program, And the interpretation of the message, keyboard and mouse input management, the response to all kinds of events are entrusted to application responsible for processing.

In addition, in a Windows application, as with a general application, the entry of a program is also the main () method in a class (note that main requires a first letter capitalization), and the same must be a static (static) method, otherwise the program will not find the entry point.

Here's a very simple example of starting a Windows program in C #:

static public void Main()
{
 Application.Run(new Form());
}

In addition, the end of the Windows forms program is also performed by the application class.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.