简体   繁体   中英

how to make a custom textblock in windows phone 7 application development

I am building an application for windows phone 7 where i need to make a few custom textblocks. Please have a look at the image below:

Is it possible to code my textblock inorder to look like this. If possible please share code. Moreover its not necessary that it is a textblock but it should not be button. I just want this design and make these clickable

you can use Expression blend to customize your textblock. Right click on your project and open in blend and there you can make your textblock in your desire shape. you can see the example of custom button in this http://msdn.microsoft.com/en-us/library/bb613598(v=vs.110).aspx . in which they use rectangle and made it to button

You can do something like this,

 <Border Background="Red" Style="{StaticResource TitleBorder}" Width="38" Margin="0,0,5,0">
                <TextBlock Text="City "  Height="19" Width="26" />
 </Border>

put this style in Application.Resources

<Style x:Key="TitleBorder" TargetType="Border">
    <Setter Property="CornerRadius" Value="10"/>
    <Setter Property="BorderThickness" Value="3"/>
    <Setter Property="Margin" Value="0,0,5,0"/>
    <Setter Property="BorderBrush" Value="Orange"></Setter>
    <Setter Property="Grid.Column" Value="0"/>
</Style>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM