Windows Forms Application Development 1. windows Forms Application Development

Source: Internet
Author: User

Windows Forms Application Development 1. windows Forms Application Development

1. Basic concepts of Windows Forms

2. Windows Forms applications

3. common interface elements of Windows Forms

4. Event Processing in Windows Forms

1. Basic concepts of Windows Forms

Open a Window system application. You can use Notepad as an example:

  

This notepad is a form. Interactions between users and programs are performed through graphical interface elements such as "forms" and "buttons. We use these software to achieve some goals for us, such as the txt document mentioned above, write some content and store it on the computer, there is also a word suite for office, users and programs for interaction, the program must be powerful and efficient in order to achieve the purpose of using these tools, just like the word suite at work to speed up office efficiency, when designing and using the software, you should also consider the situation when using the software.

2. Windows Forms applications

Create my first application,

  

What is different from learning programming languages is to have the idea of a Project, to build a Project first. Then, the entire project is constructed one by one based on the modular idea. Similar to writing an article, building a house, every function is implemented by a module, and finally it can be made into the software we usually use. Of course, now the first project, just like learning every programming language, is "HelloWorld" first ". After the project is created, you can see a window. This window is our most basic window. You can use the toolbox to add new controls (such as buttons and text) to the window ).

Modify the attributes of this control. For example, if I change the text attribute to "HelloRyner", the text displayed on the button is changed to a set string. To change the code of the button, click this button to enter the relevant code.

 private void button1_Click(object sender, EventArgs e) { }

When button 1 triggers an event, add "HelloWorld"

The window popped up later is the windows message box, MessageBox. Add the code MessageBox. Show ("Hello World.

 

3. common interface elements of Windows Forms

The Button used above is a type of space in common form interface elements.

Element Description
Form The entire window used above as the background
Widget

The elements on the form have buttons and other things to control some functions. Methods and events can define the appearance and behavior of controls. Commonly Used controls include Button, TextBox, Label

, Panel, ComboBox

Components Components are rarely mentioned later.
Dialog Box When we want to close the txt document, a window will pop up asking "save"

Note: The main difference between a widget and a widget is that the widget is located on a form and the widget is not. Components are generally derived from the System. ComponentModel. Component base class.

 

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.