다음을 통해 공유


방법: 내용에 맞게 자동으로 창의 크기 조정

이 예제에서는 SizeToContent 속성을 설정하여 창의 크기가 해당 콘텐츠에 맞게 조정되도록 만드는 방식을 지정하는 방법을 보여 줍니다.

예제


            ' Manually alter window height and width
            Me.SizeToContent = SizeToContent.Manual

            ' Automatically resize width relative to content
            Me.SizeToContent = SizeToContent.Width

            ' Automatically resize height relative to content
            Me.SizeToContent = SizeToContent.Height

            ' Automatically resize height and width relative to content
            Me.SizeToContent = SizeToContent.WidthAndHeight

// 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;