更新 : 2007 年 11 月
この例では、コンテンツに合わせてウィンドウのサイズを変更する方法を指定するために、SizeToContent プロパティを設定する方法を示します。
使用例
// Manually alter window height and width
this.SizeToContent = SizeToContent.Manual;
// Automatically resize width relative to content
this.SizeToContent = SizeToContent.Width;
// Automatically resize height relative to content
this.SizeToContent = SizeToContent.Height;
// Automatically resize height and width relative to content
this.SizeToContent = SizeToContent.WidthAndHeight;