有没有一种简单的方法可以在运行时重新创建 WinForms 布局体验以供用户定位控件

发布于 2024-07-10 02:56:49 字数 307 浏览 2 评论 0原文

在 Visual Studio 中布局 WinForm 时,您可以使用拖动手柄和边框对齐提示轻松调整控件的大小和对齐控件。

我想对运行时控件执行相同的操作,以使用户能够在页面上放置图像。

例如,如果用户有一张照片,并且他们希望将其作为桌面上的背景,我希望控件能够帮助他们在迷你桌面视觉效果中移动照片缩略图并调整其大小。

我可以做到所有这些,但我真正的问题是,有谁知道一种从标准 WinForms 布局编辑器继承的方法,以便我可以选择使用漂亮的停靠、对齐提示和控件调整大小,而无需再次编码?

预先感谢

瑞安

When laying out a WinForm in Visual Studio you get the ability to resize and align your controls very easily with drag handles and border alignment hints.

I'd like to do the same with a runtime control to enable the user to position an image on a page.

For example, if the user has a photo and they want to place it as a background on the desktop I'd like the control to help them move and size the photo thumbnail in a mini desktop visual.

I can do all of this, but my real question is, does anyone know of a way to inherit from the standard WinForms layout editor so that I can choose to use the nice docking, alignment hints and control resizing without coding it all again?

Thanks in advance

Ryan

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

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

发布评论

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

评论(1

信仰 2024-07-17 02:56:49

我不知道简单,但您可以在自己的应用程序中托管实际的 winforms 设计器,而不会出现太多问题。请参阅 此处

I don't know about easy, but you can host the actual winforms designer in your own applications without too many problems.. See here.

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