Use a GroupBox control to create a container for a TabControl.

image_pdfimage_print


   
 

<Page x:Class="GroupBoxExample.Page1"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Loaded="OnLoad" Name="GroupBoxPage">

    <DockPanel>
        <GroupBox Width="300" Height="410">
            <GroupBox.Header>
                <Label>Title of the GroupBox</Label>
            </GroupBox.Header>
            <StackPanel>
                <TabControl Name="myTabControl" TabStripPlacement="Top" Margin="0, 0, 0, 10" Height="350">
                    <TabItem Name="PersonalInfo">
                        <TabItem.Header>_Personal</TabItem.Header>
                        <StackPanel>
                            <TextBlock>Employee</TextBlock>
                            <TextBlock>Select your name</TextBlock>
                            <ListBox Name="empName" SelectionChanged="updateSummary">
                                <ListBoxItem IsSelected="true">A</ListBoxItem>
                                <ListBoxItem>B</ListBoxItem>
                                <ListBoxItem>C</ListBoxItem>
                                <ListBoxItem>D</ListBoxItem>
                            </ListBox>
                        </StackPanel>
                    </TabItem>
                    <TabItem>
                        <TabItem.Header>_Job</TabItem.Header>
                        <StackPanel>
                            <TextBlock>Select a job</TextBlock>
                            <ListBox Name ="job" SelectionChanged="updateSummary">
                                <ListBoxItem IsSelected="true">A</ListBoxItem>
                                <ListBoxItem>B</ListBoxItem>
                                <ListBoxItem>C</ListBoxItem>
                                <ListBoxItem>D</ListBoxItem>
                            </ListBox>
                        </StackPanel>
                    </TabItem>
                    <TabItem Name="Summary" >
                        <TabItem.Header>Su_mmary</TabItem.Header>
                        <StackPanel>
                            <TextBlock Name="emp"/>
                            <TextBlock Name="ejob"/>
                            <TextBlock Name="eskill"/>
                        </StackPanel>
                    </TabItem>
                </TabControl>
                <Button Content="Show Summary" Click="goToSummaryTab"/>
            </StackPanel>
        </GroupBox>
    </DockPanel>
</Page>

//File:Window.xaml.cs

using System;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Media;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace GroupBoxExample
{
    public partial class Page1 : Page
    {
        private void displayData()
        {
            ListBoxItem lbi = empName.SelectedItem as ListBoxItem;
            emp.Text = "Name: " + lbi.Content.ToString();
            lbi = job.SelectedItem as ListBoxItem;
            ejob.Text = "Job: " + lbi.Content.ToString();
            eskill.Text = "Skill: " + lbi.Content.ToString();
        }
        private void OnLoad(object sender, RoutedEventArgs e)
        {
            displayData();
        }
        private void updateSummary(object sender, RoutedEventArgs e)
        {
            if (GroupBoxPage.IsLoaded)
                displayData();
        }
        private void goToSummaryTab(object sender, RoutedEventArgs e)
        {
            displayData();
            Summary.IsSelected = true;
        }
    }
}

   
     


TextBlock VerticalAlignment

image_pdfimage_print


   
     

<Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  x:Class="TextDecorationExample.Window1"
  Title="TextDecoration Example"
  Width="720"
  Height="400">
  <StackPanel>
      <TextBlock 
        FontSize="24" 
        Width="180" 
        VerticalAlignment="Center" 
        TextDecorations="OverLine">The lazy dog</TextBlock>
  </StackPanel>
</Window>

   
    
    
    
    
     


Emboss Text

image_pdfimage_print


   
     



<Grid xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
    <Grid.Resources>
        <Style TargetType="{x:Type TextBlock}">
            <Setter Property="FontFamily" Value="Times New Roman" />
            <Setter Property="FontSize" Value="144" />
            <Setter Property="HorizontalAlignment" Value="Center" />
            <Setter Property="VerticalAlignment" Value="Center" />
        </Style>
    </Grid.Resources>

    <Grid.RowDefinitions>
        <RowDefinition />
        <RowDefinition />
    </Grid.RowDefinitions>

    <TextBlock Foreground="{DynamicResource 
                    {x:Static SystemColors.GrayTextBrushKey}}">
        Emboss
        <TextBlock.RenderTransform>
            <TranslateTransform X="2" Y="2" />
        </TextBlock.RenderTransform>
    </TextBlock>


    <TextBlock Foreground="{DynamicResource 
                    {x:Static SystemColors.WindowBrushKey}}">
        Emboss
    </TextBlock>


</Grid>

   
    
    
    
    
     


Engrave Text

image_pdfimage_print


   
     



<Grid xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
    <Grid.Resources>
        <Style TargetType="{x:Type TextBlock}">
            <Setter Property="FontFamily" Value="Times New Roman" />
            <Setter Property="FontSize" Value="144" />
            <Setter Property="HorizontalAlignment" Value="Center" />
            <Setter Property="VerticalAlignment" Value="Center" />
        </Style>
    </Grid.Resources>

    <Grid.RowDefinitions>
        <RowDefinition />
        <RowDefinition />
    </Grid.RowDefinitions>


    <TextBlock Grid.Row="1" Foreground="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}">
        Engrave
        <TextBlock.RenderTransform>
            <TranslateTransform X="-2" Y="-2" />
        </TextBlock.RenderTransform>
    </TextBlock>


    <TextBlock Grid.Row="1" Foreground="{DynamicResource {x:Static SystemColors.WindowBrushKey}}">
        Engrave
    </TextBlock>


</Grid>

   
    
    
    
    
     


TextBlock ScaleTransform ScaleX

image_pdfimage_print


   
     

<Canvas xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:s="clr-namespace:System;assembly=mscorlib">
    <Canvas.Resources>
        <FontFamily x:Key="fntfam">Times New Roman</FontFamily>
        <s:Double x:Key="fntsize">96</s:Double>

        <TransformGroup x:Key="xform">
            <ScaleTransform ScaleX="{Binding Source={StaticResource fntfam}, Path=Baseline}" />
            <ScaleTransform ScaleX="{StaticResource fntsize}" />
        </TransformGroup>

        <Style TargetType="{x:Type TextBlock}">
            <Setter Property="FontFamily" Value="{StaticResource fntfam}" />
            <Setter Property="FontSize" Value="{StaticResource fntsize}" />
            <Setter Property="Text" Value="Reflect" />
            <Setter Property="Canvas.Left" Value="400" />
            <Setter Property="Canvas.Top" Value="48" />
        </Style>
    </Canvas.Resources>

    <TextBlock>asdf</TextBlock>
    <TextBlock>
        <TextBlock.RenderTransform>
            <ScaleTransform ScaleX="-1" />
        </TextBlock.RenderTransform>
    </TextBlock>


</Canvas>

   
    
    
    
    
     


TextBlock ScaleTransform ScaleY and TransformGroup

image_pdfimage_print


   
     

<Canvas xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:s="clr-namespace:System;assembly=mscorlib">
    <Canvas.Resources>
        <FontFamily x:Key="fntfam">Times New Roman</FontFamily>
        <s:Double x:Key="fntsize">96</s:Double>

        <TransformGroup x:Key="xform">
            <ScaleTransform ScaleX="{Binding Source={StaticResource fntfam}, Path=Baseline}" />
            <ScaleTransform ScaleX="{StaticResource fntsize}" />
        </TransformGroup>

        <Style TargetType="{x:Type TextBlock}">
            <Setter Property="FontFamily" Value="{StaticResource fntfam}" />
            <Setter Property="FontSize" Value="{StaticResource fntsize}" />
            <Setter Property="Text" Value="Reflect" />
            <Setter Property="Canvas.Left" Value="400" />
            <Setter Property="Canvas.Top" Value="48" />
        </Style>
    </Canvas.Resources>

    <TextBlock>asdf</TextBlock>
    <TextBlock>
        <TextBlock.RenderTransform>
            <ScaleTransform ScaleY="-1" 
                CenterY="{Binding Source={StaticResource xform},Path=Value.M11}" />
        </TextBlock.RenderTransform>
    </TextBlock>

</Canvas>