C#:如何在Windows应用程序中自由移动win窗体上的控件?

发布于 2024-09-03 04:05:46 字数 80 浏览 2 评论 0原文

C#:如何在Windows应用程序中自由移动win窗体上的控件?

我不希望 IDE 为我控制我的控件的位置。

谢谢

C#: How can I move my controls on a win form in windows application freely?

I do NOT want IDE control the position of my controls for me.

Thank you

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

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

发布评论

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

评论(3

佞臣 2024-09-10 04:05:46

Visual Studio 尝试通过将控件“捕捉”到对齐线来帮助您对齐控件(例如,另一个控件的左侧、另一个控件的右侧、距另一个控件或表单边缘的较短距离等),因此这可能就是您想要的是否有无法自由移动控件的体验?

如果是这种情况,您可以使用键盘上的箭头微调位置。使用鼠标将控件移动到您想要的大致位置,然后使用键盘进行最终调整。

Visual Studio tries to help you align your controls by "snapping" them to an alignment line (e.g. left of another control, right of another control, a short distance from another control or the form edge etc.), so this might be what you experience as not being able to move your controls freely?

If this is the case, you can fine-tune the position by using the arrows on your keyboard. Move the control approximately where you want it with your mouse, and then use the keyboard for the final adjustment.

机场等船 2024-09-10 04:05:46

您的意思是在运行时拖动控件吗?

如果是这样:您必须检查何时单击鼠标,找到控件,并在单击按钮时拖动它来移动它。

Do you mean at runtime dragging the controls around?

If so: you have to check when the mouse is clicked, find the control, and move it around on drag as long as the button is clicked.

羁绊已千年 2024-09-10 04:05:46

您似乎正在寻找与 Visual Studio 表单设计器类似的实现。 system.design 程序集定义了 DesignSurface ,它肯定可以满足您的需要。检查这个

http://www.codeproject.com/KB/cs/DesignSurfaceExtended.aspx

it seems u r looking for similar implementation as in visual studio forms designer. system.design assembly defines DesignSurface that can certainly do what u need. check this out.

http://www.codeproject.com/KB/cs/DesignSurfaceExtended.aspx

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