一个“Rectangle”元素

starryholiday 2012-04-06 02:15:13
一个“Rectangle”元素:
<Rectangle Height="17" HorizontalAlignment="Left" Margin="100,142,0,0" Name="rectangle1" Stroke="Black" StrokeThickness="1" VerticalAlignment="Top" Width="94" Fill="#FF3E4049" />

问题一:在VS2010中看不到“Z-Index”属性(Blend4可以),应该怎样将其显示顺序,设置在其它的“XAML元素”之上???

这个可以设置么?

<UserControl.Resources>
<Style x:Key="BarStyle" TargetType="my:BarIndicator">
<Setter Property="StartWidth" Value="0"/>
<Setter Property="Placement" Value="Inside"/>
</Style>
</UserControl.Resources>

问题二:“<Setter Property="Z-Index" Value="1"/>”这样设置可以么?
...全文
133 14 打赏 收藏 转发到动态 举报
写回复
用AI写文章
14 条回复
切换为时间正序
请发表友善的回复…
发表回复
starrycheng 2012-05-14
  • 打赏
  • 举报
回复
Blend的使用需要熟悉啊。。。
starryholiday 2012-04-13
  • 打赏
  • 举报
回复
继续顶。。。
starrycheng 2012-04-10
  • 打赏
  • 举报
回复
[Quote=引用 7 楼 的回复:]

在blend里面设计的 都能在 vs和正常情况下使用的
[/Quote]

是的。

<Grid x:Name="LayoutRoot" Background="White">
<Canvas>
<Canvas.Resources>
<Style x:Key="BarStyle" TargetType="my:NeedleIndicator">
<Setter Property="Canvas.ZIndex" Value="2"></Setter>
</Style>
</Canvas.Resources>
<my:Gauge Name="SLGauges" Height="242" Width="290">
<my:Gauge.Indicators>
<my:NeedleIndicator Name="BI_Value" Style="{StaticResource BarStyle}" ></my:NeedleIndicator>
</my:Gauge.Indicators>
<my:Gauge.CircularScales>
<my:CircularScale Minimum="0" Maximum="10000" >

</my:CircularScale>
</my:Gauge.CircularScales>
</my:Gauge>
</Canvas>
<TextBox Height="23" HorizontalAlignment="Left" Margin="101,144,0,0" Name="tb_Value" VerticalAlignment="Top" Width="88" Foreground="#FFD7D9DC" Background="#FF3E4049" Text="" />
</Grid>

问题:

现在是想“my:NeedleIndicator”元素(BI_Value),显示在“TextBox”(tb_Value)的上面,是不是把“TextBox”(tb_Value)放在“Canvas”元素里面就可以了?
gio301 2012-04-09
  • 打赏
  • 举报
回复
术业有专攻,界面性的放在BLEND下开发比较适合
ycproc 2012-04-09
  • 打赏
  • 举报
回复
在blend里面设计的 都能在 vs和正常情况下使用的
starrycheng 2012-04-09
  • 打赏
  • 举报
回复
没有效果啊,XAML如下:

<Canvas>
<Canvas.Resources>
<Style x:Key="BarStyle" TargetType="my:NeedleIndicator">
<Setter Property="Canvas.ZIndex" Value="2"></Setter>
</Style>
</Canvas.Resources>
<my:Gauge Name="SLGauges" Height="242" Width="290">
<my:Gauge.Indicators>
<my:NeedleIndicator Name="BI_Value" Style="{StaticResource BarStyle}" ></my:NeedleIndicator>
</my:Gauge.Indicators>
<my:Gauge.CircularScales>
<my:CircularScale Minimum="0" Maximum="10000" >

</my:CircularScale>
</my:Gauge.CircularScales>
</my:Gauge>
</Canvas>
starrycheng 2012-04-07
  • 打赏
  • 举报
回复
请问如下这样,使用“UserControl.Resources”,可以设置“XAML”元素“my:BarIndicator”的“Z-Index”顺序么???
<UserControl.Resources>
<Style x:Key="BarStyle" TargetType="my:BarIndicator">
<Setter Property="StartWidth" Value="0"/>
<Setter Property="Placement" Value="Inside"/>
</Style>
</UserControl.Resources>
starrycheng 2012-04-06
  • 打赏
  • 举报
回复
Silverlight...

110,533

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧