我想在我的项目中添加消息对话的tiger textbox,我不知道如何应用样式或控件在silverlight中获取tiger textbox。

是在silverlight代码/样式中获取上述图像的任何方法
发布于 2012-12-05 15:29:48
除非在silverlight中创建你自己的自定义控件,否则你不可能拥有一个那样形状的文本框。
然而,有两种方法可以让你得到你想要的。1)在文本框中添加一个简单边框。根据需要更改不透明度设置。例如:
`<Border BorderBrush="Black" BorderThickness="3" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="49,33,0,0">
<TextBox Height="72" TextAlignment="Center" Name="textBox1" Text="TextBox" Width="270" Background="White" />
</Border>`2)放置气泡的图像,并在其中放置一个文本框。您必须更改一些不透明度设置,但这里有一个示例:
<Grid HorizontalAlignment="Left" Height="96" Width="316" Margin="99,265,0,0" VerticalAlignment="Top">
<Image Name="image1" Stretch="Fill" Source="bubble.png" />
<TextBox Name="textBox2" Text="TextBox" SelectionBackground="#001BA1E2" SelectionForeground="Black" BorderBrush="Transparent" Background="Transparent" Margin="0,0,0,30" />
</Grid>您必须根据您使用的图像对页边距进行一些调整。但基本上,上面两个文本框看起来是这样的:

如果您希望为Tiger文本框创建自己的控件,可以按照以下步骤操作:
1)在Expression Blend中打开项目
2)在您要添加textbox的位置,绘制Tiger Textbox格式的图像。
3)右击此图像并选择"Make into Control...“
4)选择TextBox。
https://stackoverflow.com/questions/13716680
复制相似问题