WP7你是否在为考研还是就业而迷茫?
前台界面:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using Microsoft.Phone.Controls;
using System.Windows.Threading;
namespace PhoneApp2
{
public partial class MainPage : PhoneApplicationPage
{
// 构造函数
DispatcherTimer timer = new DispatcherTimer();
int a = 0;
public MainPage()
{
InitializeComponent();
}
private void button2_Click(object sender, RoutedEventArgs e)
{
timer.Interval = new TimeSpan(0, 0, 0, 0, 50);
timer.Tick += new EventHandler(timer_Tick);
timer.Start();
}
void timer_Tick(object sender, EventArgs e)
{
a+=1;
if (a % 2 == 1)
{
textBox1.Text = "考研";
}
else
textBox1.Text = "就业";
}
private void button1_Click(object sender, RoutedEventArgs e)
{
timer.Stop();
}
}
}