Strange Form Resizing Issue

timh

Well-known member
Joined
Nov 28, 2008
Messages
50
Programming Experience
Beginner
I have a very strange problem with form resizing.

The form contains a datagridview and is initially set to 576 pixels wide. If the user clicks a filter button, the form width grows to 626 pixels as another column is displayed. I have set the width so that no horizontal scrolling is needed. When the filter is removed, the form width shrinks again to 576 pixels as the extra column is removed.

Whilst debugging in Visual Studio, the form displays correctly, with no white space between the DGV and vertical scroll bar. When I deploy the application though and run the installed version, the form initially loads correctly, but when I click the filter button, it grows in excess of 626 pixels (looks like about an extra 5 - 10 pixels). I have confirmed the size difference by running the deployed application and the debugger at the same time. When I clear the filter, the form contracts, but not to its original size. I've looked through the code, but cannot see what is going on. The form is not manually resizeable.

Can anyone please offer an explanation as to why there would be a size difference between the form when running in debug mode and the deployed application??

Scratching my head here...
 
Back
Top