Complete effect:
Explanation:
The main window is an MDI window, and there are sub-windows in the window. The controls include treeview, panel control, listview control (this is a listview in a window), and button control.
Function:
Click the "Employee Management" panel in the tree map to display the listview data
Other functions have not been written yet. . . . . .
Main window Form1
Form properties:
IsMdiContainer=true;
[There can only be one parent window in the window, and the child window can no longer become a parent window by setting IsMdiContainer=true; (nesting is not allowed)]
Backend code:
Form1_Load( Form1_son son = //子窗口对象
son.Text = son.MdiParent = son.Dock = }
Subform: Form1_son
Background Code:
Form1_son_panel fpanel= treeView1_AfterSelect( (treeView1.SelectedNode.Text == fpanel.TopLevel = ; fpanel.FormBorderStyle = FormBorderStyle.None; fpanel.parent=this.panel1;(同10行功能一致)
fpanel.Show(); } }
Explanation:
TopLevel 属性【true/false】
Iftrue, the form will be displayed as top level window; otherwise,false.The default value istrue. [Top-level window: no parent window or main window]
Grandchild form: Form1_son_panel
Sunson attribute: FormBorderStyle=None [Keep only the content part, remove the borders]
1 public static Form1_son_panel fpanel;//2 3 public Form1_son_panel()4 {5 InitializeComponent();6 7 fpanel= this;//注意8 }
The above is the detailed content of Winform information management system graphic example. For more information, please follow other related articles on the PHP Chinese website!