1.控件代码
<pre name="code" class="csharp"> <Slider x:Name="slider1" HorizontalAlignment="Left" Margin="0,261,0,0" VerticalAlignment="Top" Width="446" ValueChanged="Slider_ValueChanged_1" Maximum="60"/>
2.事件代码
public partial class MainPage : PhoneApplicationPage{// 构造函数public MainPage(){InitializeComponent();slider1.ValueChanged += new RoutedPropertyChangedEventHandler<double>(Slider_ValueChanged_1);}private void Button_Click_1(object sender, RoutedEventArgs e){string i = (3 + 5).ToString();MessageBox.Show(i);}private void Slider_ValueChanged_1(object sender, RoutedPropertyChangedEventArgs<double> e){text1.FontSize = Convert.ToInt32(e.NewValue);}}
3.界面显示