ASP.NET 自定义控件

发布于 2024-08-30 15:03:29 字数 131 浏览 3 评论 0原文

我正在构建一个 ASP.NET Web 用户控件,其中有一个面板。

如何在 Visual Studio 中的设计时使用户控件内的面板可调整大小(即带有手柄)。

我需要创建一个设计类或其他东西?

谢谢。

I am building an ASP.NET Web User Control which has a panel within it.

How do I make the Panel within the user control resizable (i.e. with handles) at design time in Visual Studio.

I need to create a design class or something??

Thanks.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

ˇ宁静的妩媚 2024-09-06 15:03:29

我将创建一个包含该面板的 Web 用户控件:
http://webproject.scottgu.com/CSharp/UserControls/UserControls.aspx

然后我将属性 PanelWidth 和 PanelHeight 添加到该控件。使用这些属性的设置器来设置控件内面板的宽度和高度。

为了使您的属性在属性浏览器中可见,请使用 Browsable 属性:
http://msdn.microsoft。 com/en-us/library/system.componentmodel.browsableattribute%28VS.71%29.aspx

为了检测您是否处于设计模式,请使用此处描述的方法:
http://www.west-wind.com/WebLog/posts/189。 aspx

这不是 100% 您想要的,但可能会给您一些有用的想法。

I would create a Web User Control with that Panel in it:
http://webproject.scottgu.com/CSharp/UserControls/UserControls.aspx

Then I would add property PanelWidth and PanelHeight to that control. Use setter of these properties to set width and height of the panel inside your control.

In order for your properties to be visible in property browser use Browsable attribute:
http://msdn.microsoft.com/en-us/library/system.componentmodel.browsableattribute%28VS.71%29.aspx

In order to detect if you are in design mode or not use the method described here:
http://www.west-wind.com/WebLog/posts/189.aspx

This is not 100% what you wanted but might give you some useful ideas.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文