Files
docs-desktop/dotnet-desktop-guide/framework/wpf/advanced/how-to-use-automatic-layout-to-create-a-button.md
T
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.9 KiB

title, ms.date, helpviewer_keywords, ms.assetid
title ms.date helpviewer_keywords ms.assetid
How to: Use Automatic Layout to Create a Button 03/30/2017
Button controls [WPF], creating with automatic layout
automatic layout [WPF], creating buttons
96c206d0-9e77-4784-9d2d-5045aed2021c

How to: Use Automatic Layout to Create a Button

This example describes how to use the automatic layout approach to create a button in a localizable application.

Localization of a [!INCLUDETLA#tla_ui] can be a time consuming process. Often localizers need to resize and reposition elements in addition to translating text. In the past each language that a [!INCLUDETLA2#tla_ui] was adapted for required adjustment. Now with the capabilities of [!INCLUDETLA#tla_winclient] you can design elements that reduce the need for adjustment. The approach to writing applications that can be more easily resized and repositioned is called automatic layout.

Example

The following two [!INCLUDETLA#tla_xaml] examples create applications that instantiate a button; one with English text and one with Spanish text. Notice that the code is the same except for the text; the button adjusts to fit the text.

[!code-xamlLocalizationBtn_snip#1]

[!code-xamlLocalizationBtn#1]

The following graphic shows the output of the code samples with auto-resizable buttons:

The same button with text in different languages

See also