Files
docs-desktop/dotnet-desktop-guide/framework/wpf/app-development/how-to-automatically-size-a-window-to-fit-its-content.md
Andy De George da363692ff Initial WPF content migrated (#17)
* Reset branch for WPF changes

* Convert BMP to PNG; fix link-out-of-scope err

* Add snippets for WPF... 6794 files!!!!

* Add missing snippets

* update file updated between migration

* Fix paths to include

* update breadcrumb and toc

* fix index links

* fix index links

* fix index links

* fix markdown
2020-09-04 09:46:28 -07:00

1.1 KiB

title, description, ms.date, dev_langs, helpviewer_keywords, ms.assetid
title description ms.date dev_langs helpviewer_keywords ms.assetid
How to: Automatically Size a Window to Fit Its Content Learn how to set the property that specifies how a window resizes to fit its content in Windows Presentation Foundation (WPF). 03/30/2017
csharp
vb
resizing windows to fit content [WPF]
windows [WPF], resizing to fit content
sizing windows to fit content [WPF]
333ca72a-c2f3-4414-9303-3fdabaaa1b32

How to: Automatically Size a Window to Fit Its Content

This example shows how to set the xref:System.Windows.Window.SizeToContent%2A property to specify how a window resizes to fit its content.

Example

[!code-csharpHOWTOWindowManagementSnippets#SetWindowSizeToContentPropertyCODE] [!code-vbHOWTOWindowManagementSnippets#SetWindowSizeToContentPropertyCODE]