Quantcast
Viewing all articles
Browse latest Browse all 12583

Autosizing a Form to fit nicely around re-sized Columns in Outlook 2007

I am using DataGridview to display a Form within Outlook 2007 of my SQLCE Table.

I have set the property AutoSizeColumnsMode as AllCells and this resizes the Columns nicely for the data it is displaying.

However, how do I automatically resize the Form itself to fit nicely around the re-sized Columns ?

I am not so worried about the height of the Form, as I assume I can put (or there will be) a scroll bar, but it would be nice for the Width of the Form to match the re-sized Columns (there are only 2 and they will NEVER be too large for a screen).

I am experimenting with AutoSize & AutoSizeMode, but I can't get it to resize as I want. If I have AutoSize set to True & AutoSizeMode set to GrowAndShrink it always opens as a tiny little window, whereas if I have it as grow only, it doesn't seem to change size ... weird !

Any help muchly appreciated ... thanks ...

Viewing all articles
Browse latest Browse all 12583

Trending Articles