Winform Information Management System, winform

Source: Internet
Author: User

Winform Information Management System, winform

Effect:

 

Explanation:

The main window is an MDI window with subwindows. The Child Window controls include tree structure treeview, panel control, listview control (this is a window listview), and butten control.

Function:

Click "Employee management" panel in the tree structure to display listview data.

Other functions are not yet written ......

 

Main Window Form1

Form attributes:

IsMdiContainer = true;

[The window can only have one parent window, and the Child Window cannot be changed to the parent window (nesting not allowed) by setting IsMdiContainer = true )]

Background code:

1 2 3 4 private void Form1_Load (object sender, EventArgs e) 5 {
6 Form1_son son = new Form1_son (); // subwindow object
7 son. Text = "Information Management System Maintenance Information Feedback ";

8 son. MdiParent = this; // note

9 son. Dock = DockStyle. Fill; // maximize the sub-window (overlay the main window)
10

11 son. Show (); // The subwindow is displayed in the main window.

12

13 // son. WindowState = FormWindowState. Maximized;

14

15
}

 

 

Child form: Form1_son

Background code:

1 Form1_son_panel fpanel = new Form1_son_panel (); // Sun Tzu window object 2 3 4 private void treeView1_AfterSelect (object sender, TreeViewEventArgs e) 5 {
// You can also use swith () 6 if (treeView1.SelectedNode. text = "Employee management") 7 {8 fpanel. topLevel = false; // Make Sun Tzu's window not a top-level window, so that window 9 fpanel can be embedded. formBorderStyle = FormBorderStyle. none; // remove the border 10 this from the Sun Tzu window. panel1.Controls. add (fpanel); // Add the grandson window 11 fpanel in the panel control. show (); // display in the subwindow of the grandson (this sentence is not displayed) 12}
}

 

Explanation:

TopLevel attribute [true/false]

IfTrue, The form is displayed as a top-level window; otherwiseFalse. The default value isTrue. Top-level window: no parent window or primary window]

 

 

Sun Tzu form: Form1_son_panel

Sun Tzu attributes: FormBorderStyle = None [retain content only, remove 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}

 

Related Article

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.