Programming Blog
My digital history about programming experience
Sunday, December 14, 2014
Wednesday, October 22, 2014
Grid Layout in Windows Presentation Foundation (WPF)
It is fresh code after create new Item Window in WPF Project.
We can setup our layout of windows based on ROW oriented. We will control height of row. There are 4 types of height value,
"Auto" is used to define height of layout based on highest component inside container.
"*" is used to define height of layout rest of space container sibling.
Comparison Value is used to define height of layout based on comparison value with sibling. Numeric Value is used to define height of layout based on fixed value that declared using numeric.
Code:
Setup Column in Grid Layout
Setup Row in Grid Layout
We can setup our layout of windows based on ROW oriented. We will control height of row. There are 4 types of height value,
- 'Auto'
- '*'
- Comparison Value
- Numeric Value.
"Auto" is used to define height of layout based on highest component inside container.
"*" is used to define height of layout rest of space container sibling.
Comparison Value is used to define height of layout based on comparison value with sibling. Numeric Value is used to define height of layout based on fixed value that declared using numeric.
Code:
<Window x:Class="WPF01.Layout.LearnGrid"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="LearnGrid" Height="300" Width="300">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
<RowDefinition Height="50" />
</Grid.RowDefinitions>
<Grid Grid.Row="0" Background="Red">
<Label Content="Row Height is Auto, based on height of this lable"/>
</Grid>
<Grid Grid.Row="1" Background="Green">
<Label Content="Row Height '*' is rest of space siblings height" />
</Grid>
<Grid Grid.Row="2" Background="Yellow">
<Label Content="Row Height is 50 pixels" />
</Grid>
</Grid>
</Window>
Setup Column in Grid Layout
Membuat Project Windows Presentation Foundation (WPF)
Dalam posting kali ini saya akan menjelaskan tentang pembuatan project Windows Presentation Foundation (WPF).
Tools: Visual Studio 2013 Express for Windows
Language: C#
Tahapan Membuat Project:
Tools: Visual Studio 2013 Express for Windows
Language: C#
Tahapan Membuat Project:
- Pilih menu: File > New Project. Tampil jendela New Project
- Templates > Visual C# > WPF Application
- Tentukan Project Name dan Location
- Ok
- Tekan F5 untuk menjalankan program atau melalu menu Debug > Start Debuging
![]() |
| Jendela New Project |
Hello World
It's first time I write a code in my blog.
public static void main(string whatever[])
{
Console.WriteLine("Hello World");
}
Subscribe to:
Posts (Atom)

