开发者

Relative control position in .NET / Visual Studio Editor

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜