【发布时间】:2015-01-16 11:44:15
【问题描述】:
我制作了一个应用程序,让我可以控制 Microsoft NXT 2.0 Mindstorms 机器人,我最近添加了一个滑块,我想用它来设置当前引擎速度而不是固定值,所以我需要帮助.
这里有我想要使用的标签和滑块的 XAML:
<Slider x:Name="Speed" HorizontalAlignment="Left" Margin="40,58,0,0" VerticalAlignment="Top" Width="30" Orientation="Vertical" Height="187" Maximum="90" Minimum="-90" SmallChange="1" LargeChange="10" IsSnapToTickEnabled="True" TickFrequency="5" TickPlacement="BottomRight" AutoToolTipPlacement="BottomRight" MouseUp="Speed_MouseUp" BorderBrush="#00000000" Background="#00000000" Foreground="#FF858585">
<Label x:Name="Current_Speed" Content="Currently: " HorizontalAlignment="Right" Margin="0,0,478,257" Width="60" Height="29" VerticalAlignment="Bottom" Foreground="Black" />
我希望Current_Speed 写入Currently: {SliderValue} 我希望它在我上下移动滑块时立即写入滑块的当前值,就像使用工具提示选项一样。
有什么想法吗?
(请记住,我不是很熟练,因此非常感谢详细的解决方案)
提前谢谢你:)
【问题讨论】:
标签: c# slider windows-applications