如何使用代码停靠在父容器中

发布于 2024-10-17 04:43:18 字数 30 浏览 1 评论 0原文

如何使用代码将报表查看器控件停靠到其父容器中。

How can I dock my report viewer control into its parent container, using code.

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

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

发布评论

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

评论(2

2024-10-24 04:43:18

设置控件的 Dock属性 停靠到其父容器的所有侧面。例如:

reportViewer.Dock = DockStyle.Fill

所有可用的对接选项均由 提供DockStyle枚举,总结如下:

Name       Description
-----------------------------------------------------------------
None      Not docked.
Top       Top edge is docked to the top of its containing control.
Bottom    Bottom edge is docked to the bottom of its containing control.
Left      Left edge is docked to the left edge of its containing control.
Right     Right edge is docked to the right edge of its containing control.
Fill      All edges are docked to the edges of its containing control and sized appropriately.

Set the control's Dock property to dock to all sides of its parent container. For example:

reportViewer.Dock = DockStyle.Fill

All of your available docking options are given by the DockStyle enumeration, summarized here:

Name       Description
-----------------------------------------------------------------
None      Not docked.
Top       Top edge is docked to the top of its containing control.
Bottom    Bottom edge is docked to the bottom of its containing control.
Left      Left edge is docked to the left edge of its containing control.
Right     Right edge is docked to the right edge of its containing control.
Fill      All edges are docked to the edges of its containing control and sized appropriately.
栖竹 2024-10-24 04:43:18

如果您不相信停靠,您可以响应父容器的 OnSize 事件,并根据父容器手动重新定位/调整控件大小。

If you don't believe in docking, you can respond to the parent containers' OnSize event and reposition/resize your control manually according to the parents.

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