开发者

Moving a Button control based on GridView height

I have a GridView with a button located beneath it. The GridView's height is set dynamically. When the height is set, it displays on top of the button. What I want to do is move the button down so it still displays just below the GridView when its height is changed.

I know I can just set the location of the button, based on the height of the GridView, but is there a way to link the height to the location of the button? Like anchoring the button to the bottom edge of t开发者_JS百科he GridView.


Put the gridview and button inside a panel. Anchor the gridview on all four sides, and anchor the button on the bottom (and optionally the left and/or right). (They will be anchored to the panel rather than the form.) Then, in the application, change the size of the panel instead of the gridview. The gridview will change sizes along with the panel, and the button will keep its position underneath of the gridview.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜