Weifenluo.winformsui.doc king details, weifenluo. winformsui

Source: Internet
Author: User

Weifenluo.winformsui.doc king details, weifenluo. winformsui

The basic layout is available on the Internet. I will not repeat it again. Here I will only describe some of the highlights, which are not easy to find, but may encounter the following problems:

1. Suppose there are three areas in total. If you want to display the layout in the left area, the right side is in the upper and lower areas. Show one by one using dockpanel. show (parameters), but the layout may be different from what you think.

The result layout may be the layout of the previous region, the left and right regions,

Figure:

,

Solution: change the code show sequence. Figure:

2. Click the home page button to automatically add a home page in the document area. My capabilities are limited, and I am confused about this problem for a while, because the tab page of dockpanel is actually a form. If we use the Form1 frm1 = new Form1 () method, it is actually implemented, however, you can also see that the home page is easy to handle, but there are so many columns on the left. Click here to create a new form, how many forms need to be created in the project to solve the problem. Obviously, this is unrealistic.

Solution: It is very simple. Just click new. For details, see the figure below:

3. Take the area on the left as an example. Click the X number in the area and the form is missing. However, a display button is usually added to the menu bar so that when you want to see it again, no need to restart the program. How can this problem be solved? Step 1: Set isHidden instead of hide (). Step 2: Set HideOnClose to true (false by default) for the left-side form. Figure:

4. Click the tree column on the left and use the column id to query the datagridview on the right.

The main difficulties to be solved are as follows: (1) This is not created by winform's resource manager. It is a value transfer between two forms, but with the dockpanel plug-in added, the method of passing values is not the same as that of winform. (2) there is only one dockpanel plug-in, and the region is allocated by itself. The parameter passing through the click event of treeview on the dpLeft form is invalid, that is, only parameters can be transmitted using the main form object, but the click event needs to be obtained in the main form; (3,), cannot pass the solution new of problem 2; otherwise, a new tab form will appear, however, the number of tabs in the right area is fixed and the form cannot be added.

Well, there is no need to say more, directly:

6. Disable the document function in all document regions.

As mentioned above, it is impossible to add a new tab and add a form. All these tabs are new to an object, that is, the dpContent object is new. If this is disabled, use dpContent .. if IsHidden is set to true, only one tab is closed. If a new tab is added, an exception is reported.

Solution: loop the processes. The specific code is shown in the following figure:

I usually focus on the web. This is the first time I contacted winform and added a dockpanel plug-in. Some problems may be solved by winform itself. I hope this will be helpful to you, thank you.

 

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.