Click here to Skip to main content
13,446,400 members (34,656 online)
Click here to Skip to main content


211 bookmarked
Posted 28 Dec 2010

WPF Tutorial : Layout-Panels-Containers & Layout Transformation

, 21 Aug 2011
This article describes the basics of WPF application, how you can deal with layout, placements of controls and position.
<Window x:Class="LayoutDemo.wndGrid"
    Title="Grid" Height="300" Width="300">
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*" />
        <StackPanel Grid.Row="0" Orientation="Horizontal">
            <TextBlock Text="Row"/>
            <TextBox x:Name="txtRow" Width="50"/>
            <TextBlock Text="Row"/>
            <TextBox x:Name="txtCol" Width="50" />
            <Button Content="Apply" Click="Button_Click" Width="100" />
        <Grid Grid.Row="1">
                <RowDefinition />
                <RowDefinition />
                <RowDefinition />
            <Border Background="BurlyWood" x:Name="brdElement">
                <TextBlock x:Name="tbElement" Text="Row 0, Column 0" HorizontalAlignment="Center" VerticalAlignment="Center"/>

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Abhishek Sur
India India
Did you like his post?

Oh, lets go a bit further to know him better.
Visit his Website : to know more about Abhishek.

Abhishek also authored a book on .NET 4.5 Features and recommends you to read it, you will learn a lot from it.

Basically he is from India, who loves to explore the .NET world. He loves to code and in his leisure you always find him talking about technical stuffs.

Presently he is working in WPF, a new foundation to UI development, but mostly he likes to work on architecture and business classes. ASP.NET is one of his strength as well.
Have any problem? Write to him in his Forum.

You can also mail him directly to

Want a Coder like him for your project?
Drop him a mail to

Visit His Blog

Dotnet Tricks and Tips

Dont forget to vote or share your comments about his Writing

You may also be interested in...

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web04 | 2.8.180314.2 | Last Updated 22 Aug 2011
Article Copyright 2010 by Abhishek Sur
Everything else Copyright © CodeProject, 1999-2018
Layout: fixed | fluid