Scale a ListBox : ListBox Style « Windows Presentation Foundation « C# / CSharp Tutorial

Home
C# / CSharp Tutorial
1.Language Basics
2.Data Type
3.Operator
4.Statement
5.String
6.struct
7.Class
8.Operator Overload
9.delegate
10.Attribute
11.Data Structure
12.Assembly
13.Date Time
14.Development
15.File Directory Stream
16.Preprocessing Directives
17.Regular Expression
18.Generic
19.Reflection
20.Thread
21.I18N Internationalization
22.LINQ
23.GUI Windows Forms
24.Windows Presentation Foundation
25.Windows Communication Foundation
26.Workflow
27.2D
28.Design Patterns
29.Windows
30.XML
31.XML LINQ
32.ADO.Net
33.Network
34.Directory Services
35.Security
36.unsafe
C# / C Sharp
C# / C Sharp by API
C# / CSharp Open Source
C# / CSharp Tutorial » Windows Presentation Foundation » ListBox Style 
24.33.2.Scale a ListBox
<Window x:Class="WPFTransformations.Scale"
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  Title="Scale Transform" Height="400" Width="300"
  >

    <Grid>
        <StackPanel Margin="8">
            <TextBlock Height="25" Width="100"/>

            <ListBox Height="100" Width="200" BorderThickness="2">
                <ListBoxItem Content="Item 1" Height="22"/>
                <ListBoxItem Content="Item 2" Height="22"/>
                <ListBoxItem Content="Item 3" Height="22"/>
                <ListBoxItem Content="Item 4" Height="22"/>
                <ListBox.RenderTransform>
                    <ScaleTransform ScaleX="{Binding Path=Value, ElementName=sliderScaleX}" 
                                    ScaleY="{Binding Path=Value, ElementName=sliderScaleY}"
            CenterX="{Binding Path=Value, ElementName=sliderScaleCX}" 
            CenterY="{Binding Path=Value, ElementName=sliderScaleCY}" 
            />
                </ListBox.RenderTransform>
            </ListBox>

            <TextBlock Height="65" Width="100"/>
            <Grid HorizontalAlignment="Center" Margin="2">
                <Grid.RowDefinitions>
                    <RowDefinition/>
                    <RowDefinition/>
                    <RowDefinition/>
                    <RowDefinition/>
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="62" />
                    <ColumnDefinition Width="93"/>
                    <ColumnDefinition Width="16*" />
                </Grid.ColumnDefinitions>

                <TextBlock Text="Scale X:" Margin="0,0,16.323,0" />
                <Slider Name="sliderScaleX" Maximum="2.5" Minimum="0" Value="1" TickFrequency=".1" Grid.ColumnSpan="2" Margin="45.677,0,0,0" />
                <TextBox Grid.Row="0" Grid.Column="2" Text="{Binding Path=Value, ElementName=sliderScaleX}"/>

                <TextBlock Grid.Row="1" Text="Scale Y:" Margin="0,0,16.323,0" />
                <Slider Grid.Row="1" Name="sliderScaleY" Maximum="2.5" Minimum="0" Value="1" TickFrequency=".1" Grid.ColumnSpan="2" Margin="45.677,0,0,0" />
                <TextBox Grid.Row="1" Grid.Column="2" Text="{Binding Path=Value, ElementName=sliderScaleY}"/>

            </Grid>
        </StackPanel>
        <StackPanel Margin="8">
            <TextBlock Height="25" Width="100"/>
            <Rectangle Height="100" Width="200" Stroke="Red" Fill="Red" Opacity=".05"/>
        </StackPanel>
    </Grid>
</Window>
WPF Scale A List Box
24.33.ListBox Style
24.33.1.Rotate a ListBoxRotate a ListBox
24.33.2.Scale a ListBoxScale a ListBox
24.33.3.Skew Transforms for a ListBoxSkew Transforms for a ListBox
24.33.4.Different Font Family and Size for each ListBoxItemDifferent Font Family and Size for each ListBoxItem
24.33.5.Create a style that will produce a horizontal ListBox.Create a style that will produce a horizontal ListBox.
24.33.6.Change the Appearance of Alternate Items in a ListChange the Appearance of Alternate Items in a List
24.33.7.Change the Appearance of a List Item When It's SelectedChange the Appearance of a List Item When It's Selected
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.