开发者

Relative control position in .NET / Visual Studio Editor

开发者 https://www.devze.com 2022-12-13 17:46 出处:网络
I am editi开发者_Go百科ng custom control in control editor of Visual Studio 2008 My custom control has datagrid view on the left and buttons on the right. I want my control when resized to keep butto

I am editi开发者_Go百科ng custom control in control editor of Visual Studio 2008

My custom control has datagrid view on the left and buttons on the right. I want my control when resized to keep button size constant always and keep them aligned to right border and only my datagrid control to be resized so that horizontal distances between borders and control remained the same. (See illustration below) I remember there was some feature in WinForms and Editor like anchors or other that would me to do that automatically. I just cannot find it in MSVS.

==============================
| ****************  *button*  |
| * datagridview *  *button*  |
| *              *  *button*  |
| ****************            |
==============================


=================================
| *******************  *button*  |
| * datagridview    *  *button*  |
| *                 *  *button*  |
| *******************            |
================================


Anchor the buttons right, top. Then anchor the datagrid left, right and top.

That should do it.

Have a look at

Control.Anchor Property

and

Form Anchor

0

精彩评论

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