Finish the effect:
Explain:
The main window is an MDI window, the window has child windows, the control in the child window has a tree chart TreeView, a Panel control, a ListView control (which is a ListView in a window), and a Butten control.
Function:
Click the "Employee Management" Panel in the tree chart to display the ListView data
Other features are temporarily not written ...
Main Window Form1
Form properties:
Ismdicontainer=true;
Window can have only one parent window, child windows can no longer be set by ismdicontainer=true, parent window (no nesting allowed)
Background code:
Form1_Load ( form1_son son = //Child window object
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; (same as 10 lines function)
Fpanel. Show (); } }
Explain:
TopLevel Property "True/false"
trueto display the form as a top-level window, otherwise false. The default value is true. "Top-level window: no parent window or main window"
Grandson form: Form1_son_panel
Grandson Properties: Formborderstyle=none "Keep content only, borders, etc."
Background code:
1 public static Form1_son_panel FPANEL;//2 3 public Form1_son_panel () 4 {5 InitializeComponent (); 6 7 fpanel= this;//Note 8}