C # winform in question can not be displayed in the panel overlay

C # winform in question can not be displayed in the panel overlap:

  Recently developed a project there is a demand that requiring multiple mode switching back and forth, was considering the use of multiple windows to achieve this function, but this waste of resources and heavy workload, so think of using the control panel to solve this problem. But in the process we encountered a problem that when multiple panel controls overlap occurs when some content can not be displayed in the control panel, thought it was my own hands mistakenly deleted the control panel, but the call in the code not compile-time error can not be displayed control compiler. So be sure not to delete controls. Finally we found out that C # winform hierarchy of controls in the form wrong, so I give the following workaround.

 Solution:

  First, find out the missing controls, open the control window in VS2017, click View -> Other Windows -> Document Outline, click to open the document outline. As shown below:

  In the document outline, we can see all the controls on the form, you need to do now is to control you need to drag to the appropriate level and then rebuild the solution can be, as shown below:

 

  When using a multilayer overlap control, it is prone to the above problems, accuracy is not required if it can make a bit offset between the control, to avoid this problem, the control may be set to several different sizes overlapping process due to demand.

  These are the methods I give, I hope to help to you, if you encounter the same problem or if you have more good solution, I hope you can give me a message.

Guess you like

Origin www.cnblogs.com/zhicungaoyuan-mingzhi/p/mingzhi_Csharp_panel.html