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
精彩评论