开发者

How to dock in parent container using code

开发者 https://www.devze.com 2023-02-10 17:59 出处:网络
How can I d开发者_开发百科ock my report viewer control into its parent container, using code.Set the control\'s Dock property to dock to all sides of its parent container. For example:

How can I d开发者_开发百科ock my report viewer control into its parent container, using code.


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.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消