简体   繁体   English

C#:在VS表单设计器中将控件从表单移动到tabPage

[英]C#: Move Controls From Form to tabPage in VS Form Designer

I decided to change a utility I'm working on to use a tabpage. 我决定更改一个我正在使用的工具来使用标签页。 When I tried to drag various controls from the form to a tab page on top of the form, it made copies of the control, giving it a different name. 当我尝试将各种控件从表单拖到表单顶部的标签页时,它会创建控件的副本,为其指定不同的名称。 It's easy enough to just remake the form on top of the tab or just edit the source code in the designer to have everything be added to the tab instead (and this is what I did, which worked), but it seems like there would probably be a better way to do this via the gui. 只需在选项卡顶部重新创建表单或者只是编辑设计器中的源代码就可以将所有内容添加到选项卡中(这就是我所做的,哪个有效),但似乎很可能通过gui做一个更好的方法。

The correct tool for this is the Document Outline (CTRL+W, U). 对此的正确工具是文档大纲(CTRL + W,U)。 Simply drag your set of controls in the outline so that they are under the tab page. 只需在轮廓中拖动控件集,使它们位于选项卡页面下。 Voila. 瞧。

The document outline dramatically simplifies these types of operations, especially when you are dealing with complex layouts. 文档大纲大大简化了这些类型的操作,尤其是在处理复杂布局时。

Have you tried cut and paste. 你试过剪切和粘贴吗? That usually works for me. 这通常对我有用。

Your control key is stuck. 你的控制键卡住了。 Do not press control key when dragging controls. 拖动控件时不要按控制键。

I drag controls from form control to tab page controls all the time no problem. 我将控件从表单控件拖动到标签页控件一直没有问题。 Answer #1 is totally correct. 答案#1完全正确。

You can use the Document Outline window and move the controls to the tab page one by one by dragging tree nodes. 您可以使用“文档大纲”窗口,通过拖动树节点将控件逐个移动到选项卡页面。

The hardest problem is retaining control locations on the tab page. 最难的问题是在标签页上保留控制位置。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM