4天玩转wp7的第一天作业
using System.Windows;
using Microsoft.Phone.Controls;
namespace WindowsPhoneApplication1
{
public partial class MainPage : PhoneApplicationPage
{
// Constructor
public MainPage()
{
InitializeComponent();
}
private void MyButton_Click(object sender, RoutedEventArgs e)
{
if (textBox1.Text == "12 34")
{
textBlock1.Text = "您将会安全的再过180天了";
}
else
{
textBlock1.Text = "地球要爆炸了";
}
}
private void textBox1_GotFocus(object sender, RoutedEventArgs e)
{
textBox1.Text = ""; //当textBox获取焦点时清除其中的提示文本内容
}
}
}