I have a Windows form with the default size 1100x400, and I have a control DataGridViewthat is bound to the Top, Left, Bottom, Right.
Resizing the form on the screen with a resolution higher 1100x400works fine, and snapping works fine by resizing the control DataGridViewas expected.
When I run the form on the screen with permission 800x600, the form shuts down and sets in accordance with 800x600. DataGridViewdisabled and cannot be fully visible - it resets the form on the right, so it does not comply with the correct binding. Resizing the form in this situation, for some reason, does not take into account the binding settings: the control DataGridViewdoes not change when the form is resized.
Is there a way programmatically (on a resize event or something else) to force the child control to DataGridViewsnap to the sides of the form?
I already tried calling the event PerformLayoutand Refresh in the form resize, but it's pretty redundant, right?
source
share