Reputation: 448
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
Upvotes: 1
Views: 236
Reputation: 222722
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>
Upvotes: 1
Reputation: 27
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
Upvotes: 1