slider控件控制文本框字体大小

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.界面显示


你可能感兴趣的:(slider控件控制文本框字体大小)