all windows controls has property called anchor by which i can force control to stick on its surface and if anyone re-size form the controls height & width also increase & decrease along with form size.
i asked some one that how to do it in wpf and he said as below
‘Docking’ in WPF can be done by Setting the HorizontalAllignment and the VerticalAllignment properties of a child control.
‘Anchoring’ in WPF can be done by setting the Margin on the child and/or the Padding on the container.
unfortunately i am not being able to do so. so here is my sample xaml.
<Window x:Class="WpfApplication1.Window3"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Window3" Height="300" Width="515">
<Grid>
<Label Name="lblName" Content="Enter Name" Height="28" HorizontalAlignment="Left" Margin="-17,5,0,0" VerticalAlignment="Top" />
<Label Content="Enter Address" Height="28" HorizontalAlignment="Left" Margin="-17,39,0,0" Name="label2" VerticalAlignment="Top" />
<Label Content="Enter Company" Height="28" HorizontalAlignment="Left" Margin="-17,68,0,0" Name="label3" VerticalAlignment="Top" />
<TextBox Height="23" HorizontalAlignment="Left" Margin="83,10,0,0" Name="textBox1" VerticalAlignment="Top" Width="222" />
<TextBox Height="23" HorizontalAlignment="Left" Margin="83,73,0,0" Name="textBox2" VerticalAlignment="Top" Width="222" />
<TextBox Height="23" HorizontalAlignment="Left" Margin="83,42,0,0" Name="textBox3" VerticalAlignment="Top" Width="222" />
</Grid>
</Window>
so please do edit ny xaml to achieve what i am looking for….thanks
Here’s an alternative approach. It will give you static layout: