First, layout and container controls
1. Layout properties
-Anchor control positioning lock dead in that position, according to which location locked dead.
-Dork fill, fill up and down around.
-Location.
2. Container controls
-The Panel is equivalent to a div in HTML.
-FlowLayoutPanel inherited from panel, multi-flow layout function
-GroupBox inherited from panel, one more title, with small dashed lines.
-TabControl Tab
tab to modify the caption, use the TAB's TabPages property to modify the content to be displayed in the Text property corresponding to each tab caption.
-SplitContainer split Panel
Properties for horizontal split vertical split: Orientation
-Tablyoutpanel table, a cell can be placed only one control.
Implementing a multi-control: Place a container in a cell that fills the cell and puts multiple controls in the container.
Second, open multi-form
Instantiate a FORM2 in the Click event.
Problems encountered:
1, the Landing Screen main window close will be opened after the window is also closed.
To resolve this problem, hide the login interface of the main window after logging in, instead of shutting it down.
2, through the open window to exit the program.
In the FormClosing event of the open window, use the constructor to pass the value to close the object you want to close.
The change of the constructor will be error in the place where the constructor is instantiated, and be aware of the changes.
Increase the scope of the F1, and then call the Close method in the event.
Cross-form transfer value (constructor pass value)
The value is passed through the constructor function.
The change of the constructor will be error in the place where the constructor is instantiated, and be aware of the changes.
Iv. opening a unique form
Create a collection of forms
List<form> formlist=new list<form> ();
Each open Form object is placed in this collection
Each time you open the form, go to the collection to determine whether the form has been opened.
1 //create a collection of forms2List<form> formlist =NewList<form>();3 4 Private voidButton1_Click (Objectsender, EventArgs e)5 {6 BOOLhas =false;7 //function Passing Value8Form3 F3 =NewFORM3 ( This);9 //traverse the formlist to see if there are any forms to openTen foreach(Form Finchformlist) One { A if(f isForm3) - { -has =true; theF3 = f asForm3; - } - } - //if it's been opened, + if(HAS) - { + //from minimized to normal state, and focus enters AF3. WindowState =Formwindowstate.normal; at F3. Focus (); - } - //If you have not been opened, place the form in the form collection and then open it. - Else - { - Formlist.add (F3); in F3. Show (); - } to } + - the //Delete the corresponding subform object in the collection of the parent form * Public voidDeleteform (Form f) $ {Panax Notoginseng Formlist.remove (f); -}
When you close a subform, you can reopen the new subform by deleting the corresponding subform object in the parent form's collection
"2017-04-27" layout and container controls, open multiple forms, constructor pass values, open unique window