开发者

Placing TabControl vertically

开发者 https://www.devze.com 2023-01-21 06:09 出处:网络
How do I make a Silverlight TabContro开发者_Go百科l arrange the tabs vertically?TabControl Formatting (Right Justified and Vertical Text)

How do I make a Silverlight TabContro开发者_Go百科l arrange the tabs vertically?


TabControl Formatting (Right Justified and Vertical Text)

<Controls2:TabControl HorizontalContentAlignment="Right" HorizontalAlignment="Right" TabStripPlacement="Left"></Controls2:TabControl> 


Make sure you have install the silverlight toolkit and then use the rotate layout to turn the tab header.

<UserControl xmlns:controls=”clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls” 
x:Class=”SilverlightApplication18.MainPage”
xmlns=”http://schemas.microsoft.com/winfx/2006/xaml/presentation“
xmlns:x=”http://schemas.microsoft.com/winfx/2006/xaml“
xmlns:toolkit=”clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Layout.Toolkit”            
Width=”400″ Height=”300″>
<Grid x:Name=”LayoutRoot” Background=”White”>
    <controls:TabControl Margin=”10″ TabStripPlacement=”Left”>
        <controls:TabItem  >
            <controls:TabItem.Header>
                <toolkit:LayoutTransformer >
                    <TextBlock Text=”Tab1″/>
                    <toolkit:LayoutTransformer.LayoutTransform>
                        <RotateTransform Angle=”-90″></RotateTransform>
                    </toolkit:LayoutTransformer.LayoutTransform>
                </toolkit:LayoutTransformer>
            </controls:TabItem.Header>
            <TextBlock  Margin=”10″ Text=”some content in Tab1″/>               
        </controls:TabItem>

The result will like:

Placing TabControl vertically

!

May be I can't upload a picture, the result will like this, but all the text is rotated -90 in the real result.

+--+------------------------------
|l |
|a |
|c |
|i |
|t |
|r |
|e |
|v |
+--+
|
|
+--------------------------------

The relative article is here

0

精彩评论

暂无评论...
验证码 换一张
取 消