Build a well-laid Windows program

Source: Internet
Author: User

Build a well-laid Windows program

MenuStrip refers to the list of options that appear on the interface when the application is running, for the user to choose to perform. In a visualizer, the menu bar allows you to present the various features provided by the application to the consumer in one by one.

ToolStrip in Windows programs, toolbars are an area that combines various tools for the user to use.

Next we see the main properties and events that are described below.

Main properties of a menu bar control
Property Description
Name Name of the menu object in the code
Items A collection of items that are displayed in a menu
Text Text associated with the menu

Main properties and events for a menu item
Property Description
Name The name of the menu item object in the code
DropDownItems A collection of items that are displayed in submenus
Text Text associated with the menu item
Event Description
Click This event is triggered when the menu item is selected

Settings for Administrator Form properties
Property Value Description
Name Frmadminmain The name of the form object
Text myschool-Administrator The text that the form title bar displays
WindowState Maximized The form is the largest when it appears

Form really quits

Application.exit () and this. The difference between Close ()
Application.exit () This. Close ()

Static methods for application class application,

Used to exit the current application

instance method to close the current form, or if the current form is a system startup form,

The application exits after the method is executed to close the form

If more than one form is open for the current application,

Then close all Forms

Close the current form only

The form's formclosing is not triggered when the form is closed

and formclosed Events

The formclosing and formclosed events of the form are triggered

——————————————————————————————————————————————————————————————————————————————————

Main properties of a toolbar control
Property Description
Imagescalingsize The size of the image displayed by the item in the toolbar
Items Display a collection of items in a toolbar

Key properties and events for buttons and labels on the toolbar
Property Description
Displaystyle

Set how images and text are displayed, including display text,

Display images, display text and images, or do not display anything

Image

Picture displayed on button/label

Imagescaling Adjust the size of the picture displayed on the button/label
Text Text displayed on the button/label
Textimagerelation The relative position of the button/label like the text
Event Description
Click Trigger this event when a stand-alone button/tag

Basic controls for using WinForm

radio button (Readiobutton): Provides the user with a collection of options consisting of two or more mutually exclusive options.

Key properties and Events for button options
Property Description
Checked Indicates whether the radio button is selected
Text The text that the radio button displays
Event Description
Click Occurs when the stand-alone option button

Group Box (GROUPBOX): Used to provide a recognizable grouping for other controls. You typically use the group box to subdivide a form by function.

Panel: Similar to the function of a group box, which is used to group controls, the only difference is that the panel has no caption, but the scroll bar can be displayed.

The difference between a container control GroupBox and a panel

GroupBox

Panel

Used to combine a set of controls, such as the R-Di euro button and the CheckBox control, in a logical

Show a frame with a title on it

Used to contain multiple controls so that they can be made into a group for easy manipulation of these controls

Date control (DateTimePicker): Provides a drop-down calendar that can be used to select dates to avoid errors caused by manual input.

The main properties of the date control
Property Description
MaxDate Get set maximum date and time
MinDate Get set minimum date and time
Value Date/Time value selected by the control
Format Format for setting the date and time displayed in the control

Using the Anchor property

The Anchor property is provided for the control in WinForms, as long as the anchor property of the control is set to maintain the layout of the control when the form is run.

Anchor is the anchoring meaning that sets the control's distance relative to the edge of a form (some) to remain unchanged,

This allows the control to be resized dynamically as the form changes, and each control in the WinForms has that property.

MDI Form

Several notable features of MDI

When you start an MDI application, the parent form is displayed first

The parent form is a container for all other windows in the application

Each application interface can have only one MDI parent form

Multiple subforms can be opened at any given time

No MDI child forms can remove MDI frame areas

Close MDI parent form to automatically close all open MDI child forms

Combo Box combobox Control

ComboBox. Common properties and methods for objectcollection types
Property Description
Count Gets the number of items in the collection
Dorpdownstyle Gets or sets the value of the combo box style
IsReadOnly Gets a value that indicates the ability to modify the collection
Item Retrieves the item of the specified index in the collection
Method Description
ADD () Add an item to the list of items in a combo box
Clear () Remove all items from a combo box
Remove Removes the specified item from the combo box

Build a well-laid Windows program

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.