Once you've met the basic controls of windows, you can use these basic controls in a deeper level to make our form program layout more reasonable
"MenuStrip and ToolStrip in Windows
So what exactly do these two controls do?
"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 user 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 |
The basic control of WinForm using the "
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
" parent form is a container for all other windows in the application
" Each application interface can have only one MDI parent form
You can open more than one subform at any given time
" no MDI child form can remove MDI frame area
" close MDI parent form automatically closes 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 |
This is the end of today's knowledge sharing! Your support is the most important driving force for my progress!
Build a well-laid Windows program