views:

103

answers:

1

Hi, I am editing 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*  |
| *******************            |
================================
+2  A: 

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

astander
Is there some WISIWIG interface in editor? button, check box or mouse trick
Captain Comic
If you are looking for the property, it is in the property grid called *Anchor*. When you click it, it will show a dropdown from where you can select the anchors.
astander