简体   繁体   English

Windows窗体的扩展并使它成为Visual Studio的一部分

[英]Extension of a Windows Form and make it part of Visual Studio

If I search around in the Visual Studio Express Toolbox I find the TabControl and Tab. 如果在Visual Studio Express工具箱中四处搜索,则会找到TabControl和Tab。 I want to extend the Tab so that I can give it a few standard features instead of doing it again and again for every time I add a new default tab. 我想扩展选项卡,以便为它提供一些标准功能,而不是每次添加新的默认选项卡时都一次又一次地执行它。

In NetBeans (Java) you can extend any Swing Component, and then drag it into the GUI Builder for continuous usage. 在NetBeans(Java)中,您可以扩展任何Swing组件,然后将其拖动到GUI Builder中以连续使用。

How would I do this in VS Express 2012? 我将如何在VS Express 2012中做到这一点? It doesn't seem like I can. 看来我做不到。

If I make a class that extends Tab, I can't seem to drag it into the Toolbox. 如果我创建一个扩展Tab的类,则似乎无法将其拖动到“工具箱”中。 Do I just have to make a new "Custom Control"/"User Control" class like the C# Wizard gives me the ability to do, and it will take care of the rest? 我是否只需要制作一个新的“自定义控件” /“用户控件”类,例如C#向导就可以使我做到这一点,其余的工作就可以解决? I am a bit new to C# and the VS Express IDE. 我对C#和VS Express IDE有点陌生。

Yes, the "User Control" is the solution. 是的,“用户控件”是解决方案。

just create a new "user control" and add the Tab control in it then you'll find it appear into the tools box automatically. 只需创建一个新的“用户控件”并在其中添加Tab控件,您就会发现它自动出现在工具框中。

then you can change the properties as you want. 然后您可以根据需要更改属性。

Regards, 问候,

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

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