为什么visual studio 2010的文档大纲中的控件顺序与设计器视图显示的不匹配? [英] Why does the order of controls in document outline of visual studio 2010 not match what the designer view shows?

查看:28
本文介绍了为什么visual studio 2010的文档大纲中的控件顺序与设计器视图显示的不匹配?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是 Visual Studio 的新手;使用2010.我继承了一个项目,在一个表单中有很多控件.在窗体的顶层是一个 TabControl、一个 TableLayoutPanel、一个 GroupBox 和一个按钮.它们以 TabControl、GroupBox、TableLayoutPanel、Button 的顺序出现在屏幕上(从上到下).在文档大纲中,它们以不同的顺序显示:首先是 TableLayoutPanel(最上面)、Button、GroupBox、TabControl.

I'm new to Visual Studio; using 2010. I have inherited a project that has a lot of controls in one Form. At the top level in the Form are a TabControl, a TableLayoutPanel, a GroupBox, and a Button. They appear on the screen (top to bottom) in the order TabControl, GroupBox, TableLayoutPanel, Button. In the Document Outline they are shown in a different order: TableLayoutPanel first (topmost), Button, GroupBox, TabControl.

如果我将 TabControl 拖到文档大纲的顶部,它会转到 GUI 的底部,如设计器视图中所示.

If I drag the TabControl to the top in the Document Outline, it goes to the bottom of the GUI as shown in the designer view.

谁能给我一个立足点,让我开始了解这是如何工作的?具体控件在文档大纲中出现的顺序是什么意思?

Can anyone give me a foothold to getting started in understanding how this works? Specifically what is the meaning of the order in which the controls appear in the Document Outline?

谢谢!

推荐答案

文档大纲"窗口按控件的 z 顺序显示控件.重叠一些控件,您会看到最靠近前面的控件显示在最靠近文档大纲窗口顶部的位置.

The Document Outline window displays controls by their z-order. Overlap some controls and you'll see that those closest to the front are displayed closest to the top of the Document Outline window.

如果两个控件停靠在其父控件的同一边缘,则每个控件相对于该边缘的位置由 z-order 确定.那些具有最低 z-index 的控件离边缘最远.

If two controls are docked to the same edge of their parent, the position of each control relative to that edge is determined by z-order. Those controls with the lowest z-index will be furthest from the edge.

简而言之,文档窗口中的顺序与控件的Location 属性完全没有关系.它仅取决于 z 顺序.

In short, the order in the Document Window has absolutely no relationship to the Location properties of the controls. It depends on z-order only.

这篇关于为什么visual studio 2010的文档大纲中的控件顺序与设计器视图显示的不匹配?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆