Mono: Use glade to design the interface

Source: Internet
Author: User

Mono: Use glade to design the interface

 

Monodevelop does not have any interface design tools, but you can design the interface through glade, and then write code in monodevelop. Developing the glade program using monodevelop is very simple and convenient.

 

First, create a glade solution:


Figure 2.4.0

 

Open the glade program, select new GTK + project, and design our program interface:

 

 


Figure 2.4.1

 

Only one window (window1) and one button (button1) are designed here. window1 has a delete_event event and button1 has a clicked event.

 

Figure 2.4.2

 

Save the file to the directory of the newly created Project to overwrite the GUI. Glade file.

 

Modify the main. CS file because we need to control button1 in the program, so we added the button1 declaration,

[Glade. widget]

Button button1;

 

The window1 statement is also added here.

 

Because we set two events in the design interface, we add two event handling methods to the program.


Figure 2.4.3

Compile the program by pressing F8 and run the program in the terminal:

Figure 2.4.4

 

C # class library development will not be explained in a single chapter. Because it is too simple, it is nothing more than developing a class library for other programs to call. Don't tell me what a class library is.

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.